安装和配置mrtg
安装MRTG,使用yum默认安装即可:

#yum install mrtg

添加设备

#cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg [email protected]

生成页面文件

#indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg

添加计划任务每分钟获取一次数据

#crontab -e

*/1 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok


重启计划任务

#service crond restart

添加服务

define service {

host_name 64.2

  use generic-service

        service_description   check-bandwidth-45-nj

   check_command   check_local_mrtgtraf!/var/www/mrtg/172.17.64.2_10145.log!AVG!5000000,5

000000!5500000,5500000!5         ;


}