Setup snmpd

Install snmpd: Instructions about how to Install and configure snmpd.

snmpd Instructions: Use these command prompt commands carefully as they can introduce drastic changes to your Linux operating system.

If you follow this Install Proceedure carefully, you should get a good Install of snmpd.
HTML Templates

Welcome to the Setup snmpd Page



***************** Install snmpd: *****************



If you are not familiar with SNMP, it is an extensive monitoring protocol.
To best make use of SNMP, you need an SNMP Console such as SNMPc.
SNMPc is rather spendy these days, but there are free SNMP consoles as
well, they just take more work to get running.

For these purposes, we do not need an SNMP console. Just use a utility
called SNMPWALK which will dump out the entire MIB in a semi-formatted fashion.
We will use the SNMPWALK command later.

RPI does not come with SNMP installed. To install it:
Enter to the Linux prompt each of the following three commands.

sudo apt-get update
sudo apt-get install snmpd
sudo apt-get install snmp


To get it running, you will need to modify the /etc/snmp/snmpd.conf file.
Type this at the Linux prompt to edit the snmpd.conf file.

sudo nano /etc/snmp/snmpd.conf

The nano editor will open the snmpd.conf file.
Look in the AGENT BEHAVIOR section of the snmpd.conf file. First, comment out this line by placing a # in front of the line.

#agentAddress udp:127.0.0.1:161

And uncomment the line #agentAddress udp:161,udp6:[::1]:161
Make it look like this:

agentAddress udp:161,udp6:[::1]:161

Make sure the following line is commented out. Make it look like this:

#agentAddress udp:161

This completes the configuration of AGENT BEHAVIOUR of the
snmpd.conf file.

Next scroll down to the ACCESS CONTROL section of the snmpd.conf file.

Uncomment the following line if it exists. If it does not exist, then type
it into the ACCESS CONTROL section.

rocommunity public localhost

In the ACCESS CONTROL section, you should see an entry something like
this:   rocommunity public 127.0.0.1

If a similar line exists, rocommunity public (ip address) change the ip address
to your network. Mine is 192.168.X.X so the line I created is as follows:

rocommunity public 192.168.0.0/24

That completes the setup in the snmpd.conf file.
Save the file and exit the nano editor.

Next, restart the snmpd service.

sudo /usr/init.d/snmpd restart

You should be greeted with this prompt:

[ ok ] Restarting snmpd (via systemctl): snmpd.service.

Verify the service has started:

ps -A | grep snmpd

You should see something like this:

32477 ?        00:00:13  snmpd

If the service did not start, you can check \var\log\syslog
for error messages.

On the RPI, you can walk the MIB using this command:

snmpwalk -Os -c public -v 1 localhost

Unfortunately, no MIBs appear to be installed to properly interpret the OIDs
so you mainly get gibberish, but it is a good test to verify snmpd itself is working.

These instructions will fix the snmp client so that it extracts english
names for the OIDs:

https://wiki.debian.org/SNMP

Here is the system section of the RPI MIB:

ysDescr.0 = STRING: Linux nsdude 3.12.28+ #709 PREEMPT Mon Sep 8 15:28:00 BST 2014 armv6l
sysObjectID.0 = OID: netSnmpAgentOIDs.10
sysUpTimeInstance = Timeticks: (33662) 0:05:36.62
sysContact.0 = STRING: Me (me@example.org)
sysName.0 = STRING: nsdude
sysLocation.0 = STRING: Sitting on the Dock of the Bay
sysServices.0 = INTEGER: 72
sysORLastChange.0 = Timeticks: (6) 0:00:00.06
sysORID.1 = OID: snmpFrameworkMIBCompliance
sysORID.2 = OID: snmpMPDCompliance
sysORID.3 = OID: usmMIBCompliance
sysORID.4 = OID: snmpMIB
sysORID.5 = OID: tcpMIB
sysORID.6 = OID: ip
sysORID.7 = OID: udpMIB
sysORID.8 = OID: vacmBasicGroup
sysORDescr.1 = STRING: The SNMP Management Architecture MIB.
sysORDescr.2 = STRING: The MIB for Message Processing and Dispatching.
sysORDescr.3 = STRING: The management information definitions for the SNMP
      User-based Security Model. sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
sysORDescr.5 = STRING: The MIB module for managing TCP implementations
sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations
sysORDescr.7 = STRING: The MIB module for managing UDP implementations
sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
sysORUpTime.1 = Timeticks: (4) 0:00:00.04
sysORUpTime.2 = Timeticks: (5) 0:00:00.05
sysORUpTime.3 = Timeticks: (5) 0:00:00.05
sysORUpTime.4 = Timeticks: (6) 0:00:00.06
sysORUpTime.5 = Timeticks: (6) 0:00:00.06
sysORUpTime.6 = Timeticks: (6) 0:00:00.06
sysORUpTime.7 = Timeticks: (6) 0:00:00.06
sysORUpTime.8 = Timeticks: (6) 0:00:00.06

To see information about RPI disks, enter this command at the Linux prompt:

snmpwalk -Os -c public -v 1 nsdude UCD-SNMP-MIB::dskTablecd /

For Information about CPU usage (load average), issue this command at the Linux prompt:
snmpwalk -Os -c public -v 1 nsdude UCD-SNMP-MIB::laTable