snmpd timeout

For our monitoring system (nagios) we use snmp to check the status of several services. On RHEL4 hosts the snmp query timed out. By using snmpwalk you can see the query times out every time it reaches ‘hrStorageUsed.12’, see below. By increasing the timeout value of snmpwalk the command completes with some delay.

$ snmpwalk -v 3 -u username -A password -l authnopriv hostname
-cut-
HOST-RESOURCES-MIB::hrStorageUsed.12 = INTEGER: 0
Timeout: No Response from hostname

After investigation it appears to be the SELinux setting for snmpd which causes the delay. By disabling SELinux for snmpd the timeout don’t occur anymore.

You can disable SELinux for snmpd by issuing the following command:

setsebool snmpd_disable_trans=1

To activate this change restart snmpd (service snmpd restart). To preserve this change after a reboot disable snmpd_disable_trans in ‘/etc/selinux/targeted/booleans’.