Here’s how to enable SNMP on a Raspberry Pi so your monitoring system can poll it.
1. Install snmpd
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install snmpd -y
sudo apt-get install snmp -y
2. Edit snmpd.conf
To get it running, edit the configuration file:
sudo nano /etc/snmp/snmpd.conf
First, comment out this line so the agent doesn’t listen only on localhost:
#agentAddress udp:127.0.0.1:161
Below the line #agentAddress udp:161,udp6:[::1]:161, add:
agentAddress udp:161
Then, below the line rocommunity public localhost, add a read-only community for your network (replace the subnet with your own):
rocommunity public 190.0.10.0/24
3. Restart the Service
sudo service snmpd restart
Related: enabling SNMP on VMware ESXi 6.5.
