Derwynd's Weblog

Derwynd's Weblog


$ yum install net-snmp-utils net-snmp net-snmp-libs


$ vi /etc/snmp/snmpd.conf
com2sec local     localhost           public
com2sec mynetwork <ip>/class          public

group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
group MyROGroup v1         mynetwork
group MyROGroup v2c        mynetwork
group MyROGroup usm        mynetwork

view all    included  .1                               80

access MyROGroup “”      any       noauth    exact  all    none   none
access MyRWGroup “”      any       noauth    exact  all    all    none

syslocation Linux (Hostname), hostname.
syscontact name <emailid>

$ service snmpd start
$ chkconfig –add snmpd

Test via
$ snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
IP-MIB::ipAdEntIfIndex. = INTEGER: 3
IP-MIB::ipAdEntIfIndex. = INTEGER: 1
IP-MIB::ipAdEntIfIndex. = INTEGER: 2
IP-MIB::ipAdEntIfIndex. = INTEGER: 2

$ yum install mrtg
$ mkdir -p /var/www/mrtg

create mrtg configuration file:
$ cfgmaker –global ‘WorkDir: /var/www/mrtg’ –output /etc/mrtg/mymrtg.cfg public@localhost

Create default index page for your MRTG configuration:
$ indexmaker –output=/var/www/mrtg/index.html /etc/mrtg/mymrtg.cfg

Run mrtg command from command line with your configuration file:
Run this 3 times ignoring errors

$ env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg

Add to crontab

*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg



Allow from <your ip>

/etc/init.d/httpd restart

January 14, 2009 - Posted by | Uncategorized

Sorry, the comment form is closed at this time.

%d bloggers like this: