Before you monitor a Ubuntu machine using SNMP, you’ll need to install and configure SNMP
The SNMP packages are available on default Ubuntu 20.04 repositories.
First, you first need to update your package cache
apt-get update
Once the update is done, install SNMP on Ubuntu 20.04.
apt-get install snmp snmpd libsnmp-dev
Configure SNMP
- Edit snmpd.conf with text editor of your choice, we will be using nano: sudo nano /etc/snmp/snmpd.conf
- Configure agentAddress: agentAddress udp:161,udp6:[::1]:161
-This will set the server to listen on all IPv4 and IPv6 addresses (
-For higher security bind to your IP address. Ex: agentAddress udp:192.168.1.5:161 - Configure rocommunity: rocommunity public
-Change “public” to your community name together with the whitelist IP Address (in my sample, i allow my nagios server ip 10.3.2.30) - Restart the SNMPD service: systemctl restart snmp
My snmpd.conf configuration as below:-


Test SNMP from Nagios Server
To test the SNMP, snmpwalk command will be used to test.
snmpwalk -v2c -c [community name] [destination ip]
snmpwalk -v2c -c elken 192.168.100.219