Warning: Parameter 3 to mb_videobot() expected to be a reference, value given in /home/www/virtual/susethailand.com/htdocs/libraries/joomla/event/dispatcher.php on line 136
MRTG
การติดตั้ง MRTG 2.15.2 (Multi Router Traffic Grapher) บน Linux Router
Download : public/index.php?dir=sles/x86_64/
# rpm -ivh mrtg-2.15.2-x86_64.rpm (คุณต้องดาวห์โหลดเอง บน sles10sp1 มี version เก่า)
# /etc/init.d/snmpd restart
(คุณต้องแน่ใจแล้วว่าได้ทำการติดตั้ง SNMP และทำการคอนฟิกแล้ว)
# mkdir /srv/www/htdocs/mrtg
# cd /usr/bin/
# cfgmaker --global "workdir: /srv/www/htdocs/mrtg" -ifref=ip
--output /srv/www/htdocs/mrtg/mrtg.cfg
--global 'options[_]: bits' public@localhost
### สร้าง index.html ไฟล์ ###
# indexmaker --output=/srv/www/htdocs/mrtg/index.html
/srv/www/htdocs/mrtg/mrtg.cfg
### สร้าง Graphs! ####
# env LANG=C /usr/bin/mrtg /srv/www/htdocs/mrtg/mrtg.cfg
--logging /var/log/mrtg.log
### สร้าง Graphs ทุกๆ 5 นาที ###
# crontab -e
*/5 * * * * env LANG=C /usr/bin/mrtg /srv/www/htdocs/mrtg/mrtg.cfg
--logging /var/log/mrtg.log
ตัวอย่างการใช้ MRTG + SNMP Monitoring Memory, CPU, TCP connectionsทำการเพิ่ม Script นี้ลงในไฟล์ mrtg.cfg ครับ
# cpu dual-core
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Target[cpu]: .1.3.6.1.4.1.2021.10.1.5.1&.1.3.6.1.4.1.2021.10.1.5.2:public@localhost
RouterUptime[cpu]: public@localhost
MaxBytes[cpu]: 100
Unscaled[cpu]: dwmy
Title[cpu]: CPU load in%
PageTop[cpu]: <H1>Idle CPU and Load average</H1>
ShortLegend[cpu]: %
YLegend[cpu]: CPU Utilization
Legend1[cpu]: Idle CPU
Legend2[cpu]: Load average
LegendI[cpu]: Idle
LegendO[cpu]: Load
Options[cpu]: gauge, nopercent, noinfo
# memory
LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt
Target[mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.6.0:public@localhost
PageTop[mem]:<H1>Memory Usage in%</H1>
Options[mem]: gauge, absolute, noinfo
Title[mem]: Memory Analysis
MaxBytes[mem]: 1000000
Unscaled[mem]: dwmy
kilo[mem]: 1024
KMG[mem]: k,M,G,T,P,X
YLegend[mem]: Free Memory
ShortLegend[mem]: bytes
LegendI[mem]: Free Memory:
LegendO[mem]:
Legend1[mem]: Free memory, not including swap, in bytes
# tcp connections
LoadMIBs: /usr/share/snmp/mibs/TCP-MIB.txt
Target[tcp]: .1.3.6.1.2.1.6.9.0&.1.3.6.1.2.1.6.9.0:public@localhost
RouterUptime[tcp]: public@localhost
MaxBytes[tcp]: 1000000
Unscaled[tcp]: ywmd
Title[tcp]: Open TCP connections
PageTop[tcp]: <H1>Open TCP connections </H1>
ShortLegend[tcp]: connections
YLegend[tcp]: # conns
LegendI[tcp]: Connections:
LegendO[tcp]:
Legend1[tcp]: Open TCP connections
Options[tcp]: nopercent, gauge, noinfo
เสร็จแล้วครับ จากนั้นลองเข้าดู http://IP_Address/mrtg/














