Archive for the ‘Snmp’ Category

Install and configure snmp for Ubuntu server

Thursday, March 20th, 2008
install-and-configure-snmp-for-ubuntu-server

1. Enter sudo in interactive mode.
$ sudo -i

2. Install snmp & snmpd.
# apt-get install snmp snmpd

3. Rename snmpd.conf to old before creating new.
# cd /etc/snmp
# mv snmpd.conf snmpd.conf.bak

4. Create a new empty snmpd.conf with following information.
###########################################
# SECTION: Access Control Setup
#
# This section defines who is allowed to talk to your running
# snmp agent.
# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid]
rocommunity public 127.0.0.1
rocommunity public xx.xx.xx.xx

Change the line that says xx.xx.xx.xx to the server/network you want this server to allow communication from. network is written like this, 192.168.0.0/24 and so forth.

5. Edit the /etc/default/snmpd file and edit the SNMPDOPTS row to show as below.
SNMPDOPTS=’-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid’

6. restart snmpd.
# /etc/init.d/snmpd restart

Now you should have snmpd up and running on your server, with very basic functionality, you can do polls to the server but not much more. There are far more options to the snmpd.conf file and you can configure most of the via the software called ‘snmpconf’, it’s menu driven for those who prefer that approach.