Enabling SNMP

SNMP (Simple Network Management Protocol) is a widely adopted protocol for managing and monitoring network devices and their functions. SNMP isn’t installed or enabled by default.

SNMP packages are available from the default package repositories and can be installed as root:

yum install net-snmp net-snmp-utils

Use the built in net-snmp-create-v3-user command to create an account to use for monitoring.

/usr/bin/net-snmp-create-v3-user

Enter a SNMPv3 user name to create:

smesnmp

Enter authentication pass-phrase:

mysecretpassword

Enter encryption pass-phrase: [press return to reuse the authentication pass-phrase]

mysecretpassword

The following will be displayed:

adding the following line to /var/lib/net-snmp/snmpd.conf:
  createUser smesnmp MD5 "mysecretpassword" DES mysecretpassword
adding the following line to /etc/snmp/snmpd.conf:
  rwuser smesnmp

Now you can start the snmpd service and make sure it runs by default:

systemctl enable --now snmpd

The last step will be to allow through the local appliance firewall. Using your favorite editor (vim, nano, etc) edit the file /etc/sysconfig/iptables

Add the following two lines right before “-A RH-Firewall-1-INPUT -j REJECT –reject-with icmp-host-prohibited”

-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 162 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 161 -j ACCEPT

After editing we can restart iptables to let those changes take effect

systemctl restart iptables

Now you’re all set, any system that uses SNMP can now query Access Anywhere, pull out metrics like cpu, memory, disk utilization as well as a range of other system metrics.