MRTG开源监控安装手册
环境要求:
CentOS6以上版本
2G内存
16G存储
1.安装snmp:
yum install -y net-snmp net-snmp-devel net-snmp-utils
yum install -y gcc gcc-c++ libtool*
配置snmp:
删除/etc/snmp/snmpd.conf配置文件中所有内容,粘贴如下内容到配置文件
com2sec notConfigUser default public group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser view mib2 included .iso.org.dod.internet.mgmt.mib- fc view systemview included .1.3.6.1.2.1.
view systemview included .1.3.6.1.2.1.
view systemview included .1.3.6.1.2.1.25.1. access notConfigGroup "" any noauth exact mib2 none none syslocation Unknown (edit /etc/snmp/snmpd.conf) syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
启动SNMP:
准备好安装包:
2.安装zlib:
[root@localhost software]# tar -zxf zlib-1.2..tar.gz
[root@localhost zlib-1.2.]# ./configure --prefix=/usr/local/zlib
[root@localhost zlib-1.2.]# make
[root@localhost zlib-1.2.]# make install
3安装apache:
root@localhost httpd-2.2.]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-usertrack --enable-rewrite --with-z=/usr/local/zlib root@localhost httpd-2.2.]# make && make install
配置apache:
修改配置文件中的ServerName 127.0.0.1
启动apache:
[root@localhost software]# /usr/local/apache/bin/apachectl -k restart
4.安装libpng:
[root@localhost software]# tar -zxf libpng-1.2..tar.gz
[root@localhost software]# cd libpng-1.2. [root@localhost libpng-1.2.]# cp scripts/makefile.linux makefile
修改makefile指定的zlib的路径:
[root@localhost libpng-1.2.]# make
[root@localhost libpng-1.2.]# make install
5.安装freetype:
[root@localhost software]# tar -zxf freetype-2.1..tar.gz
[root@localhost software]# cd freetype-2.1.
[root@localhost freetype-2.1.]# mkdir -p /usr/local/freetype
[root@localhost freetype-2.1.]# ./configure --prefix=/usr/local/freetype
[root@localhost freetype-2.1.]# make
[root@localhost freetype-2.1.]# make install
6.安装jpeg:
[root@localhost software]# tar -zxf jpegsrc.v6b.tar.gz
[root@localhost software]# cd jpeg-6b/
[root@localhost jpeg-6b]#
jpeg默认不会自动创建安装目录手动创建:
[root@localhost jpeg-6b]# mkdir -pv /usr/local/jpeg6/{,bin,lib,include,man/{,man1},man1}
mkdir: created directory `/usr/local/jpeg6/'
mkdir: created directory `/usr/local/jpeg6/bin'
mkdir: created directory `/usr/local/jpeg6/lib'
mkdir: created directory `/usr/local/jpeg6/include'
mkdir: created directory `/usr/local/jpeg6/man/'
mkdir: created directory `/usr/local/jpeg6/man/man1'
mkdir: created directory `/usr/local/jpeg6/man1'
[root@localhost jpeg-6b]#
[root@localhost jpeg-6b]# cp /usr/share/libtool/config/config.sub /root/software/jpeg-6b/ #copy系统下libtool下的这两个文件覆盖jpeg下同
cp: overwrite `/root/software/jpeg-6b/config.sub'? y #样的文件
[root@localhost jpeg-6b]# cp /usr/share/libtool/config/config.guess /root/software/jpeg-6b/
cp: overwrite `/root/software/jpeg-6b/config.guess'? y
[root@localhost jpeg-6b]#
[root@localhost jpeg-6b]# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
[root@localhost jpeg-6b]# make [root@localhost jpeg-6b]# make install
7.安装libxml2:
[root@localhost software]# tar -zxf libxml2-2.6..tar.gz
[root@localhost software]# cd libxml2-2.6.
[root@localhost libxml2-2.6.]# mkdir -p /usr/local/libxml2
[root@localhost libxml2-2.6.]# ./configure --prefix=/usr/local/libxml2
[root@localhost libxml2-2.6.]# make
[root@localhost libxml2-2.6.]# make install
8.安装gd:
[root@localhost gd-2.0.]# tar -zxf gd-2.0..tar.gz
[root@localhost gd-2.0.]# ./configure --prefix=/usr/local/gd2 --with-png=/usr/local/lib --with-zlib=/usr/local/zlib --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/jpeg6
[root@localhost gd-2.0.]# make
[root@localhost gd-2.0.]# make install
9.安装mrtg:
[root@localhost software]# tar -zxf mrtg-2.15..tar.gz
[root@localhost software]# cd mrtg-2.15.
[root@localhost software]# mkdir /etc/mrtg
[root@localhost mrtg-2.15.]# ./configure --prefix=/usr/local/mrtg --sysconfdir=/etc/mrtg --with-gd=/usr/local/gd2/include --with-gd-lib=/usr/local/gd2/lib --with-gd-inc=/usr/local/gd2/include --with-png=/usr/local/include --with-png-lib=/usr/local/lib --with-png-inc=/usr/local/include --with-zlib=/usr/local/zlib/include --with-zlib-lib=/usr/local/zlib/lib --with-zlib-inc=/usr/local/zlib/include
[root@localhost mrtg-2.15.]# make
[root@localhost mrtg-2.15.]# make install
[root@localhost ~]# /usr/local/mrtg/bin/cfgmaker public@localhost > /etc/mrtg/mrtg.cfg
--base: Get Device Info on public@localhost:
--base: Vendor Id:
--base: Populating confcache
--coca: populate confcache public@localhost:
--coca: store in confcache public@localhost_ Name lo -->
--coca: store in confcache public@localhost_ Name eth0 -->
--coca: store in confcache public@localhost_ Name eth1 -->
--coca: store in confcache public@localhost_ Descr lo -->
--coca: store in confcache public@localhost_ Descr eth0 -->
--coca: store in confcache public@localhost_ Descr eth1 -->
--coca: store in confcache public@localhost_ Type -->
--coca: store in confcache public@localhost_ Type -->
--coca: store in confcache public@localhost_ Type --> (duplicate)
--coca: store in confcache public@localhost_ Ip 127.0.0.1 -->
--coca: store in confcache public@localhost_ Ip 172.16.56.215 -->
--coca: store in confcache public@localhost_ Eth -->
--coca: store in confcache public@localhost_ Eth -0c--a8-d9- -->
--coca: store in confcache public@localhost_ Eth -0c--a8-d9-9e -->
--base: Get Interface Info
--base: Walking ifIndex
--base: Walking ifType
--base: Walking ifAdminStatus
--base: Walking ifOperStatus
--base: Walking ifMtu
--base: Walking ifSpeed [root@localhost ~]#
10.修改MRTG配置文件:
[root@localhost ~]# vi /etc/mrtg/mrtg.cfg
11.新建网页文件存放目录:
[root@localhost ~]# mkdir /usr/local/apache/htdocs/mrtg
12.生成网页文件:
[root@localhost ~]# /usr/local/mrtg/bin/indexmaker /etc/mrtg/mrtg.cfg --output=/usr/local/apache/htdocs/mrtg/index.html --title="MY MRTG"
[root@localhost ~]#
[root@localhost ~]# cd /usr/local/apache/htdocs/mrtg/
[root@localhost mrtg]# ls
index.html .启动MRTG:
[root@localhost ~]# env LANG=C /usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg
-- ::, Rateup WARNING: /usr/local/mrtg/bin/rateup could not read the primary log file for localhost_2
-- ::, Rateup WARNING: /usr/local/mrtg/bin/rateup The backup log file for localhost_2 was invalid as well
-- ::, Rateup WARNING: /usr/local/mrtg/bin/rateup Can't remove localhost_2.old updating log file
-- ::, Rateup WARNING: /usr/local/mrtg/bin/rateup Can't rename localhost_2.log to localhost_2.old updating log file
[root@localhost ~]# env LANG=C /usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg
-- ::, Rateup WARNING: /usr/local/mrtg/bin/rateup Can't remove localhost_2.old updating log file
[root@localhost ~]# env LANG=C /usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg
[root@localhost ~]#
PS:上面env LANG=C /usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg 命令会有错误信息输出,忽略执行三次命令即可
因为mrtg生成的是静态html文件,不断刷新则需要加入计划任务:
重启计划任务:
访问mrtg:
在浏览器输入:http://x.x.x.x/mrtg
MRTG配置文件mrtg.cfg配置文件中参数说明:
mrtg.cfg 里面几个参数的意思.
Target:是要执行的脚本
Xsize:生成图表的横向宽度(最大600)
Ysize:生成图表的纵向高度(最大200)
Title:标题
kMG: Change the default multiplier prefixes
Ytics:纵向划分为几个块(格子)
MaxBytes:图表纵向数值的最大上限
PageTop:页面上面的提示
kilo:一般是写1024,如果需要的话,是1000在计算机里的单位
LegendI:从SHELL返回的数据中的第一个
LegendO:从SHELL返回的数据中的第二个
Options: growright,表示图表向右延展
MRTG开源监控安装手册的更多相关文章
- lepus3.7 天兔监控安装手册 CentOS6.5+mysql5.6
lepus3.7 天兔监控安装配置手册 CentOS6.5+mysql5.6 整体环境 192.168.1.250为监控机 192.168.1.248为被监控机 安装LAMP环境 [root@HE3~ ...
- 开源项目大全 >> ...
http://www.isenhao.com/xueke/jisuanji/kaiyuan.php 监控系统-Nagios 网络流量监测图形分析工具-Cacti 分布式系统监视-zabbix 系统 ...
- 开源监控软件ganglia安装手册
Ganglia是一个监控服务器,集群的开源软件,能够用曲线图表现最近一个小时,最近一天,最近一周,最近一月,最近一年的服务器或者集群的cpu负载,内存,网络,硬盘等指标. Ganglia的强大在于:g ...
- dropzonejs中文翻译手册 DropzoneJS是一个提供文件拖拽上传并且提供图片预览的开源类库.
http://wxb.github.io/dropzonejs.com.zh-CN/dropzonezh-CN/ 由于项目需要,完成一个web的图片拖拽上传,也就顺便学习和了解了一下前端的比较新的技术 ...
- 开源ceph管理平台inkscope部署手册
一.前情提要 关于inkscope就不做过多介绍了,就是ceph的一个开源管理控制平台,跟ceph官方的calamary以及intel的VSM差不多一类,只是各自侧重点不一样. 相对而言,因为inks ...
- .NET开源Protobuf-net组件修炼手册
一.前言 Protocol Buffer(简称Protobuf或PB) 是一个跨平台的消息交互协议,类似xml.json等 :别只会用Json和XML了,快来看看Google出品的Protocol B ...
- .NET开源Protobuf-net组件葵花手册
一.前言 我们都知道 protobuf是由Google开发的一款与平台无关,语言无关,可扩展的序列化结构数据格式,可用做数据存储格式, 通信协议 ! 在前面<.NET开源Protobuf-net ...
- .NET开源类库Nini手册(INI、XML、注册表的配置应用)-中文翻译
目录 1.简介 1.1什么是应用程序配置数据? 1.2问题 1.3介绍Nini 2.入门 2.1一个简单的例子 2.2默认值 2.3设置.保存和删除键 2.4添加和删除配置 2.5键值扩展 3.高级主 ...
- SmartIDE v0.1.19 - 码云(Gitee)最有价值开源项目奖项、工作区策略、类虚拟机镜像VMLC、Server安装手册
SmartIDE v0.1.19 (CLI Build 3909, Server Build 3890) 已经发布,本次Sprint主要完成2个重要特性,工作区策略和类虚拟机容器(VM Like Co ...
随机推荐
- c语言学习之基础知识点介绍(一):输出语句和变量简单介绍
本系列是为了学习ios做准备的,也能作为c语言入门的教程看看. c语言的程序结构: 1.顺序结构:自上而下依次执行. 2.分支结构:程序有选择的执行某段代码或者不执行某段代码. 3.循环结构:程序循环 ...
- oracle数据库导入导出命令!(转)
oracle数据库导入导出命令! Oracle数据导入导出imp/exp 功能:Oracle数据导入导出imp/exp就相当与oracle数据还原与备份. 大多情况都可以用Oracle数据导入导出完成 ...
- OC - 17.AFNetworking原理及常用操作
AFN的六大模块 NSURLConnection,主要对NSURLConnection进行了进一步的封装,包含以下核心的类: AFURLConnectionOperation AFHTTPReques ...
- 使用Ubuntu 新建vpn过程
1.更新软件源 sudo apt-get update 2.安装pip sudo apt-get install python-pip 3.安装shadowsocks s ...
- jQuery分析(2) - $工厂函数分析
前言 从这节进入jQuery的世界,首先从jQuery的入口函数开始了解jQuery()或$是如何运作的,这里我给出了一个最小的例子来分析. 回忆 在进入分析代码前我们回想下jQuery的使用方法有哪 ...
- Java程序实现导出Excel,支持IE低版本
来博客园两年多了,最近才开通了微博,因为懒所以也一直没有写东西,今天想整理一下自己前段时间遇到的一个导出的问题. 因为项目的需求,要做一部分导出功能.开始的时候用的公司的导出,但是很奇怪有部分模块导出 ...
- 关于项目既要使用ant脚本又要使用maven pom.xml文件的问题
背景:项目使用的是ant脚本打包,但又需要maven去执行sonar代码扫描.所以项目中既有build.xml又有pom.xml build.xml设置的打包后产物文件夹为target,maven运行 ...
- Codevs 2549 自然数和分解
2549 自然数和分解 时间限制: 1 s 空间限制: 32000 KB 题目等级 : 白银 Silver 传送门 题目描述 Description 把自然数N分解为若干个自然数之和,输出方案数. 输 ...
- 判断IE浏览器用IE条件表达式
<!--[if IE]> <script type="text/javascript"> alert("ie") </script ...
- sql知识
SQL 基本知识 SQL Server 是Microsoft 公司推出的关系型数据库管理系统.具有使用方便可伸缩性好与相关软件集成程度高等优点,可跨越从运行Microsoft Windows 98 的 ...