, ,

Howto Configure SNMP In Centos 6

 Assalamualaikum,

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 unix systems.

INSTALL
# yum install net-snmp-utils

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

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

Add below line:
rocommunity public
syslocation “Zoom Networks”
syscontact siraj@zoomonline.com.bd

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 127.0.0.1

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 192.168.10.1     <— Target IP

TROUBLESHOOT
Error – Timeout: No Response from 192.168.10.1
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

Continue reading Howto Configure SNMP In Centos 6