We should firstly install the necessary packages:
yum install mrtg net-snmp net-snmp-utils
and create a configuration for your SNMP enabled device with:
cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg public@router
(where 'public' is your community string.)
We can manually invoke MRTG with:
/usr/bin/indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
But we will probably want to setup a cron job to run periodically for us!
So we create the following:
/etc/cron.d/mrtg
and add something like:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
Also ensure the cron daemon is running / will start on boot:
sudo chkconfig crond on
sudo service crond start
No comments:
Post a Comment