Monday, August 18, 2014

Install and configure SNMP on Ubuntu Linux Server


This guide describe how-to install and configure SNMP on Ubuntu for Monitoring tools like Zenoss, Cacti, Nagios, Op5 etc
1.Installation
root@server:~# sudo apt-get install snmpd
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libmpich1.0gf libdc1394-22 genisoimage linux-headers-2.6.27-7 libgfortran2
  dvd+rw-tools linux-headers-2.6.27-7-generic libcarp-clan-perl libxml-xql-perl libparse-yapp-perl
  rdate python-xml localechooser-data gcc-4.2-base libimage-size-perl libdebconfclient0 libvisual-0.4-0
  libmyth-python perlmagick libvisual-0.4-plugins libavdevice52

Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libperl5.10 libsensors3 libsnmp-base libsnmp15
Suggested packages:
  lm-sensors
The following NEW packages will be installed:
  libperl5.10 libsensors3 libsnmp-base libsnmp15 snmpd
0 upgraded, 5 newly installed, 0 to remove and 3 not upgraded.
Need to get 2463kB of archives.
After this operation, 7987kB of additional disk space will be used.
Do you want to continue [Y/n]?
answer y
2. Configuration
Move existing /etc/snmp/snmpd.conf configuration file to /etc/snmp/snmpd.conf.copy
mv /etc/snmp/snmpd.conf  /etc/snmp/snmpd.conf.copy
Create a new /etc/snmp/snmpd.conf file:
rocommunity  public
syslocation  "Branch Office"
syscontact  systems@domain.com
Make snmpd use the newly created file and make it listen to all interfaces:
Edit /etc/default/snmpd file for giving reference to snmpd.conf file
user@server# sudo nano /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.pid 127.0.0.1'
To:
# snmpd options (use syslog, close stdin/out/err).
#SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
3 Restart snmpd service
To Restart the SNMP service
user@server# sudo /etc/init.d/snmpd restart

No comments:

Post a Comment