Saturday, July 14, 2012

Making MTRG Agent on Fedora Linux System

MRTG is one of few tools to monitor your network traffic or your computer activities. MRTG is a X-Y graphic as function of time vs baud rate or speed in Byte per second. In this tutorial, suppose you had MRTG Server. I just want to set up MRTG Agent only on my computer based on distro Fedora 9.

Follow these steps :

1. Edit MRTG Agent configuration file and then restart the application.
# mcedit /etc/snmp/snmpd.conf
# /etc/rc.d/init.d/snmpd restart

2. Test your snmpd have run or not. These testing can be done from local (MRTG Agent) or remote machine (MRTG Server).
# snmpget -v 1 -c public
# snmpwalk -v 1 -c public system
# snmpwalk -v 1 -c public IP-MIB::ipAdEntIfIndex
Another testing :
# nmap
# iptables --list

3. Create configuration file on MRTG Server
# cfgmaker public@ > psjumat2.cfg
# cfgmaker --global "workdir: /opt/lampp/htdocs/mrtg" -ifref=ip --output /etc/mrtg/psjumat2.cfg --global 'options[_]: growright,bits' public@

4. Create HTML file.
# indexmaker --output=/opt/lampp/htdocs/mrtg/psjumat2.html /etc/mrtg/psjumat2.cfg
Actually, you can change psjumat2.html become index.html

5. Create mechanism to get data from MTRG Agent with automatically.
# mrtg -c /etc/mrtg/psjumat2.cfg 
# env LANG=C /usr/bin/mrtg /etc/mrtg/psjumat2.cfg 

6. To make your SNMPD automatically run every Start-up of your computer, please add a command line to /etc/rc.local :
# echo "/usr/sbin/snmpd -c /etc/snmp/snmpd.conf" >> /etc/rc.local

7. Create mechanism to get data from MRTG Agent periodically, such as every 5 minutes. To do this, you must add new line at the end of /etc/cron.d/mrtg file like this :
*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/psjumat2.cfg

No comments:

Post a Comment