Enabling the SNMP Agent on Raspberry Pi

In a previous article I described how to install Observium on a Raspberry Pi. Observium is an auto-discovering network monitoring platform that supports a wide range of devices, platforms and operating systems, including Cisco, Windows, Linux, HP, Juniper, Dell, FreeBSD, Brocade, NetScaler, NetApp and many more. To collect information from the various devices on the network, this tool relies on SNMP (Simple Network Management Protocol). In this article I will describe how to configure a Raspberry Pi so that it can provide all its system information via this protocol.

  • Installing the SNMP daemon:

sudo apt update
sudo apt install snmpd

  • Edit the config file in the nano text editor with the following command:

sudo nano /etc/snmp/snmpd.conf

Add the following line:

rocommunity public

if you wish, you can set a different community string by replacing public with one of your choice.

Continue editing the same file by commenting out the line containing agentAddress udp:127.0.0.1:161, adding the hash symbol ( # ) at the beginning of the line. After the change, it should look like this: 

#agentAddress udp:127.0.0.1:161

Now uncomment the following line by removing the hash symbol ( # )
#agentAddress udp:161,udp6:[::1]:161
after the change, it should look like this:

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

Now save and close the file by pressing Ctrl+X, then Y (or S), and finally the ENTER key.

  • Restarting the snmpd service

Now all that’s left is to restart the SNMP service with the following command:

sudo systemctl restart snmpd

sudo systemctl enable snmpd

Enjoy!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top