Thursday, January 28, 2010

Snmpd does not responding.

Today I found that when I use snmpwalk get information on some hosts but they didn't responding the result. It just show the error log 'No response from remote host "xxx.xxx.xxx.xxx"'
First - I checked the iptables ( it's already has the rule )
ACCEPT all -- xxx.xxx.xxx.xxx anywhere
Second - I try to dump the package by tcpdump to known that have the package received.
17:55:43.657982 IP xxx.xxx.xxx.xxx.51061 > yyy.yyy.yyy.yyy.snmp: C=MBpublic GetBulk(29) N=0 M=25 interfaces.ifTable.ifEntry.ifDescr
17:55:48.659170 IP xxx.xxx.xxx.xxx.51061 > yyy.yyy.yyy.yyy.snmp: C=MBpublic GetBulk(29) N=0 M=25 interfaces.ifTable.ifEntry.ifDescr


I found there are packages reach to the server but there is any response back to the remote

Third - I checked the process of snmpd by command 'ps -ef |grep snmpd'
root 768 26634 0 17:59 pts/1 00:00:00 grep snmpd
root 32365 1 0 17:54 ? 00:00:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -p /var/run/snmpd -a


Lastly : I decided to check the status of SELinux by command 'sestatus'
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing


So I change it so Permissive mode by command 'setenforce permissive' and try snmpwalk again, now It worked!!!!


Another reason that I found for snmpd doesn't responding is 'IPTABLES', if you add rule by use destination port and host by use protocol TCP on port 161 ( snmp ), it will not work because snmpd use UDP on port 161 for query the information.

== TatsHuYa ==