NetSNMPd Client Configuration

From Observium

Jump to: navigation, search

First install Net-SNMP :

root@ubuntu:~# apt-get install snmpd 
root@redhat:~# yum install net-snmp

Ubuntu: make sure the SNMPDOPTS line in /etc/default/snmpd looks like this

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -p /var/run/snmpd.pid'

Redhat: make sure the OPTIONS line in /etc/sysconfig/snmpd looks like this

OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid"

This also disables logging and as such gets rid of annoying "features" like

snmpd[4990]: Connection from UDP: 1.2.3.4

Replace the default /etc/snmp/snmpd.conf file with something like this, changing the community, location and contact fields

com2sec readonly  default         <COMMUNITY>
group MyROGroup v1         readonly
group MyROGroup v2c        readonly
group MyROGroup usm        readonly
view all    included  .1                               80
access MyROGroup ""      any       noauth    exact  all    none   none
syslocation <LOCATION>
syscontact <CONTACT>
#This line allows Observium to detect the host OS if the distro script is installed
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro 

Get the observium 'distro' script to identify your distribution via SNMP

wget http://www.observium.org/svn/observer/trunk/scripts/distro
mv distro /usr/bin/distro
chmod 755 /usr/bin/distro

You should then be able to restart snmpd

root@server:~# /etc/init.d/snmpd restart 

And then add the device to your Observium installation!

On devices with a large routing table

You may encounter sloppy SNMP responsiveness and high host load with too many routes installed in combination with netsnmp. Also see this Debian bugreport of a few years back. The last post seems to fix this issue, so if you are running full table, add these lines to snmpd.conf as well:

view all    included  .1                               80
view all    excluded  .1.3.6.1.2.1.4.21
view all    excluded  .1.3.6.1.2.1.4.24
view system included  .iso.org.dod.internet.mgmt.mib-2.system