MRTG Configuration for LINUX Redhat

Configuring MRTG
The next step is to now configure MRTG for monitoring a network device. The below script can be run against
each server to create a cfg file for MRTG to use.
Create the user mrtg and the group mrtg then create the cfg directory to hold the configuration scripts and web
#mkdir /home/mrtg/cfg
#mkdir /home/mrtg/html

PATH=$PATH:/usr/local/mrtg-2.9.14/bin; export PATH
cfgmaker --global “WorkDir: /home/mrtg/html/” \
--global “Options[ _ ]: growright, bits” \
--output “/home/mrtg/cfg/-mrtg.cfg”
MRTG will create a cfg file for each server and place it into the /home/mrtg/cfg.
If the cfg file creatation fails, there can be two possible causes.
· Firewall is blocking connection
· Incompatible snmp on server
Testing cfg scripts
To test that statical information can be collected from a server, run mrtg with the cfg script.
#/usr/local/mrtg-2.9.14/bin/mrtg /home/mrtg/cfg/.cfg
Please note that the first couple of times errors regarding creating/moving are displayed this is normal and will
disappear. If they don’t then you have a configuration problem.
If the mrtg run successfully then an html file will be created displaying probably a blank chart until some stats
have been collected. Point a web browser at http:///mrtg/.html, if no html page
exists make sure that the cfg file points to the right location for the output.
Automating MRTG
Once all the cfg files have been created it’s best to automate the whole process via cron. Create a script like
below to call from cron and collect the stats.
/usr/local/mrtg-2.9.14/bin/mrtg /home/mrtg/cfg/.cfg
/usr/local/mrtg-2.9.14/bin/mrtg /home/mrtg/cfg/.cfg
/usr/local/mrtg-2.9.14/bin/mrtg /home/mrtg/cfg/.cfg
Now add to cron something like below:
5,10,15,20,25,30,35,40,45,50,55 /home/mrtg/cfg/

Forex Trading