2019年6月15日

CentOS 6.10 安裝 MRTG 監控 snmp 步驟紀錄

# yum install mrtg net-snmp net-snmp-utils

# vi /etc/snmp/snmpd.conf
   rocommunity mrtg

# service snmpd restart

# ip link (找出網卡編號) # vi /etc/mrtg/mrtg.cfg
   Target[eth0]: 2:public@127.0.0.1
   MaxBytes[eth0]: 1250000
   Title[eth0]: Traffic Analysis
   PageTop[eth0]: <H1>127.0.0.1 eth0</H1>

# cfgmaker -global "WorkDir: /var/www/mrtg" -output /etc/mrtg/mrtg.cfg mrtg@163.17.249.8

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

# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

# crontab -e
  */5 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg  > /dev/null 2>&1

# vi /etc/httpd/conf.d/mrtg.conf
   Allow from all

# service httpd restart

沒有留言:

張貼留言