Enabling SNMP on a Raspberry Pi

snmpv2c rpi

For SNMPv3 installation, see post SNMPv3 on Raspberry.

The Simple Network Management Protocol or SNMP is used for monitoring the state, hardware, software of a device. SNMP is so simple to enable, yet provides tons of information about the device.

To enable SNMP on a Raspberry Pi or any Linux in general, the SNMP services need to be installed first.

To install SNMP

sudo apt install -y snmpd snmp

The SNMP configuration need to be modify and to do this the SNMP instance need to be stopped first.

sudo systemctl stop snmpd 

Edit the file /etc/snmp/snmpd.conf and change the following

# These three lines are the default
agentAddress  udp: 
 rocommunity public  default    -V systemonly 
 rocommunity6 public  default   -V systemonly

# I changed to these lines
#agentAddress  udp: 
agentAddress  udp: # this is the wlan0 interface's ip address
 rocommunity SuPerSecr3t  default    -V systemonly 
 #rocommunity6 public  default   -V systemonly

At this time, I don’t use IPv6, so I commented it out. I only enabled SNMP on the wlan0 interface on this Raspberry Pi.

To test the SNMP, snmpwalk needs to be run

snmpwalk -v 2c -c SuPerSecr3t

For SNMPv3 check out the next week post.


Notify of
1 Comment
Newest Most Voted
Inline Feedbacks
View all comments
2 months ago

Thank you!

Would love your thoughts, please comment.x
WordPress Appliance - Powered by TurnKey Linux