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 *nix systems.

INSTALL
# yum install net-snmp-utils

CONFIGURE
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”
syscontact nenekkuat@gmail.com

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.88.100     <— Target IP

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

Wassalam..

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