Howto Configure SNMP In Centos 6


This guide describe howto install and do a basic configure of SNMP on a RedHat Enterprise Linux or CentOS. Probably it will work on many other *nix systems.

# yum install net-snmp-utils

Do a backup of the snmpd config file.
# mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.confBAK

Create a new config file.
# vi /etc/snmp/snmpd.conf

Add below line:
rocommunity public
syslocation “Rumah Nenek Aku”

Start the snmpd service and start on boot
# /etc/init.d/snmpd start
# chkconfig snmpd on

Test 1 (Server-localhost)
# snmpwalk -v 1 -c public -O e

You should get below output:
SNMPv2-MIB::sysDescr.0 = STRING: Linux dull 2.6.18-92.1.17.el5 #1 SMP Tue Nov 4 13:45:01 EST 2008 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (16748) 0:02:47.48


Test 2 (client)
# snmpwalk -v 1 -c public -O e     <— Target IP

Error – Timeout: No Response from
Solution – Check Firewall, just disable firewall if you don’t need it. Run service iptables stop. Or you can use below rules to allow specific port (161 and 162 for snmp)

# iptables -I INPUT -p udp -m udp –dport 161 -j ACCEPT
# iptables -I INPUT -p udp -m udp –dport 162 -j ACCEPT
# service iptables restart


This entry was posted in Apache, Install, Linux, SQL and tagged , , , , . Bookmark the permalink.