Thursday, January 30, 2014

Setting up SNMP monitoring on Network interface with bsnmpd

Setting up SNMP monitoring on Network interface with bsnmpd

bsnmpd file is already installed so lets go ahead with utilities
run the following to install bsnmp-ucd:

        # cd /usr/ports/net-mgmt/bsnmp-ucd
        # make all install clean
Run the following to instal bsnmptools
        # cd /usr/ports/net-mgmt/bsnmptools
        # make all install clean
CONFIGURING BSNMP
edit /etc/snmpd.config to add the line:
        begemotSnmpdModulePath."ucd" = "/usr/local/lib/snmp_ucd.so"
edit the rest of that file - change the read variable to set your snmp community string

FINISHING TOUCHES AND FINAL COMMENTS
At this point you need to add
bsnmpd_enable="YES"

to the file /etc/rc.conf and start bsnmp by issuing
# /etc/rc.d/bsnmp start

Ok now run the testing from workstation to see if bsnmpd is working fine on server
to use snmpwalk / snmpget you must install package snmp in linux workstation

snmpwalk -v2c -c public 192.168.2.5

i you are getting getting no response , check the snmp service is running by netstat -a command and see snmp port is listed

Now its time to install MRTG and see if we can get the graph genarated

cd /usr/port/net-mgmt/mrtg
make install clean

Then create the configuration file for the NICs by using cfgmaker
cfgmaker --ifref=eth public@localhost > /usr/local/etc/mrtg/network.cfg

then modify the network.cfg file and run mrtg
mrtg network.cfg --logging /var/log/mrtg.log, run this command atleast 4,5 times to clean the rateup errors

Check the mrtg.log file for any erros and add a crontab entry to update the mrtg @ 5 minutes
crontab -e
*/5  *    *   *   *   /usr/local/bin/mrtg /usr/local/etc/mrtg/network.cfg --logging /var/log/mrtg.log > /dev/null

Now create the index file in the www home folder

indexmaker /usr/local/etc/mrtg/network.cfg > /home/www/mrtg/index.html

No comments:

Post a Comment