MRTG is the most popular Network Monitoring Tools. Simple Traffic Graph to monitoring Network throughput, CPU used,memory used, etc.
Before you configure MRTG, you have to prepare these kind of tools :
GCCThe GNU C compiler
PerlMost of MRTG scripts using Perl language. Check your Linux by type perl-v.
gdIt's a basic graph drawing library, it can create .PNG image
libpngTo produce PNG file you need to install this tool.
zlibIt's needed to compress your PNG files.
MRTGOf course you need this one :) last version is MRTG 2.16.2 version
I try this step using Centos Linux. Assume all above tools are installed on your linux.Example i want to make on Jakarta site, ip address is 192.168.4.2
Step 1Make new directory
mkdir -p /var/www/html/jakarta/Step 2Creating .cfg file contain mrtg configuration. I use public snmp community
cfgmaker --global 'workDir: /var/www/html/jakarta' --global "Options[_]: growright ,bits" --ifref=descr --output /etc/mrtg/jakarta.cfg public@192.168.4.2Step 3Make indexmaker which display the status of an array mrtg interface status pages.
indexmaker --output=/var/www/html/jakarta/index.html /etc/mrtg/jakarta.cfgStep 4Copy your PNG files
cp -av /var/www/mrtg/*.png /var/www/html/jakarta/Step 5Run your MRTG
env LANG=C /usr/bin/mrtg /etc/mrtg/jakarta.cfg
Step 6Make crontab.
You can edit your cronjob using crontab -e, and add this one.
*/5 * * * * /usr/bin/mrtg /etc/mrtg/jakarta.cfg - logging /var/log/mrtg.logFINISH !you can watch you graphic now.