This guide explains how to install SNMP on CentOS.
Install the libraries:
yum install net-snmp
By default the service won’t be started. You can check it and then start it:
service snmpd status service snmpd start
The baseline smtpd.conf has too much information. You probably only want to read the public community and not the entire manual so let’s backup the config file and do a one liner:
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.backup vi /etc/snmp/snmpd.conf
Add just this line:
Restart the service:
service snmpd restart
Checking the Service
The snmpwalk utility can be used to see if the SNMP service is operational.
Often systems are checked from remote locations, which is also a good way to see if the firewall access is correct.
Here is an example test:
snmpwalk -c secret_password -v1 www.hostname.com
161 so make sure this is open on your firewall.
If you’re using WHM/cPanel, add the remote IP address of your testing server like below:
csf -a 184.108.40.206
Automatic Restart after Server Reboot
SNMP has a habit of not starting up after a server is shutdown. Avoid that by doing the command below:
chkconfig snmpd on
The output of
Created symlink from /etc/systemd/system/multi-user.target.wants/snmpd.service to /usr/lib/systemd/system/snmpd.service.
Troubleshooting SNMP can be a complete nightmare. The configuration files are huge and when you’re dealing with something like SNMP version 3 the options enormous. The default SNMP configuration file supplied with some systems is totally overwhelming.
But if you understand firewall theory and troubleshooting firewall issues, and if your using
snmpwalk to troubleshoot, you’ll get far. Otherwise refer to the first two references listed below:
This article was updated to remove the reference to
net-snmp-utils as it’s not needed for a baseline install.