In this guide I’ll be explaining how to install the SNMP service on CentOS.
The SNMP service is available in the standard CentOS repository.
1. Install net-snmp with yum:
yum install net-snmp
2. Create a simple SNMP configuration:
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org vim /etc/snmp/snmpd.conf
Add the following to /etc/snmp/snmpd.conf ; Replace 126.96.36.199 with the IP address of the server that you want to allow SNMP lookups from:
rocommunity public 188.8.131.52
3. Start the SNMP service, and set it to auto-start on reboot:
/etc/init.d/snmpd start chkconfig snmpd on
If you have a firewall configured, ensure that you have UDP port 161 open to your SNMP lookup server.
On your SNMP lookup server, you can do the following to perform a quick SNMP test to ensure that it’s working. Replace 184.108.40.206 with the server’s address that you just configured SNMP on:
snmpwalk -v 2c -c public 220.127.116.11