Install SNMP (Simple Network Management Protocol) on Debian     In this tutorial I’m going to teach you how to install SNMP on Debian and configure it for local or remote use. Simple Network Management Protocol is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and even devices like UPS’s. Net-SNMP is a suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6. In my case I’m using snmp to monitor the status of my servers, both linux and windows. I use Cacti to graph all this information. (I will cover cacti installation on Debian in a future post).

For the method described below I’m using apt for installing snmp, so before you start this you should configure apt and add some http or ftp sources into your /etc/apt/sources.list or if you have your installation dvd/cd you can use that. Let’s get started:

We need to install snmpd package using the following command:
apt-get install snmpd

    That’s it snmpd is installed, now we move on to the config part. We will edit /etc/snmp/snmpd.conf. This is the main config file for snmpd so before doing any changes you should take a copy of this file in case anything goes wrong with this command:
cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig
next open file for edit with:
nano /etc/snmp/snmpd.conf

Now for local access only you should change
#com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private

To
#com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private

Notice “public” this will be our community. If you want to interrogate the snmp service from another server you should change:
#com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private

To
#com2sec paranoid default public
com2sec local localhost public
com2sec mynetwork 1.1.1.1 public
#com2sec readwrite default private

(replace “1.1.1.1” with the ip of the remote server)
you also need to add these line to /etc/snmp/snmpd.conf
group MyROGroup v1 mynetwork
group MyROGroup v2c mynetwork
group MyROGroup usm mynetwork

Next step in remote interrogating is to edit /etc/default/snmpd with
nano /etc/default/snmpd
and remove the 127.0.0.1 bit.

Next step, is optional, if you want to personalize a bit your snmpd you can edit this:
syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
syscontact Root (configure /etc/snmp/snmpd.local.conf)

to something like
syslocation Main Datacenter
syscontact webmaster@yourdomain.com

Now we need to restart the snmp service to activate the new settings.
/etc/init.d/snmpd restart

Your snmp server is now active and running.