Selasa, 16 Juni 2009

6 Steps Configuring MRTG

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 :
GCC
The GNU C compiler
Perl
Most of MRTG scripts using Perl language. Check your Linux by type perl-v.
gd
It's a basic graph drawing library, it can create .PNG image
libpng
To produce PNG file you need to install this tool.
zlib
It's needed to compress your PNG files.
MRTG
Of 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 1
Make new directory
mkdir -p /var/www/html/jakarta/

Step 2
Creating .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.2

Step 3
Make indexmaker which display the status of an array mrtg interface status pages.
indexmaker --output=/var/www/html/jakarta/index.html /etc/mrtg/jakarta.cfg

Step 4
Copy your PNG files
cp -av /var/www/mrtg/*.png /var/www/html/jakarta/

Step 5
Run your MRTG
env LANG=C /usr/bin/mrtg /etc/mrtg/jakarta.cfg

Step 6
Make 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.log


FINISH !
you can watch you graphic now.

3 komentar: