Monday, July 29, 2013

Install and Configure SNMP on Ubuntu

Installation of SNMP service on Ubuntu  is little different in comparison to red-hat base systems. There are simple steps to install and configure but first important thing is which package is equivalent to which package in Debian Repository, there are two packages named snmp and snmpd. snmp is the client tools and snmpd is server.
so lets start the installation

sudo apt-get install snmpd snmp

Only by this snmp will be installed on the system, now its time to configure it.

Now Rename the Original SNMPD configuration file

sudo mv /etc/snmp/snmpd.conf  /etc/snmp/

then create new configuration file

sudo vim.tiny /etc/snmp/snmpd.conf

and copy this content to that file

rocommunity  public
syslocation  "India"

Make snmpd use the newly created file and make it listen to all interfaces:

Edit /etc/default/snmpd

Change from:
# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/'

# snmpd options (use syslog, close stdin/out/err).
#SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/'
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/ -c /etc/snmp/snmpd.conf'

and restart snmpd

sudo /etc/init.d/snmpd restart

Do a snmpwalk from another host against your newly configured host.

snmpwalk -v2c -c public

Yes it works!!

No comments:

Post a Comment