How to install and configure SNMP Ubuntu 20.04 LTS

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

  1. Edit snmpd.conf with text editor of your choice, we will be using nano: sudo nano /etc/snmp/snmpd.conf
  2. 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:
  3. 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
  4. 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

Leave a Reply

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