SNMPd in Ubuntu/Debian

Install the SNMP daemon.

aptitude install snmpd

To check which version of SNMP daemon that was installed, run the following

aptitude show snmpd

Make a backup of the original SNMP daemon configuration file.

cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf_ORIGINAL

Modify the SNMP daemon configuration file

vim /etc/snmp/snmpd.conf

The above command should also create the same file, if the configuration file does not exist. Append the following lines. Adjust the values to the SNMP community string that you use. This assumes SNMP version 2

rocommunity public
syslocation "Your Location"

Modify the /etc/default/snmpd file. Duplicate the the following line then uncomment it (the original line). You always want to make a copy of the original line.

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/'

Append the following to the duplicate line. Basically, point to the SNMP configuration file.

-c /etc/snmp/snmpd.conf'

It should look like the following:

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/ -c /etc/snmp/snmpd.conf'

Two ways to restart the snmpd service

service restart snmpd


/etc/init.d/snmpd restart

While you poll the machine, run this on the server to check the status

tcpdump -i eth0 "src or dst [ip address of SNMP polling server]"

Comments are closed.