we have a customer with many SNMPTRAPS (about 2 per sec).
Processing stuck every week. That means snmptt was blocked and /var/spool/snmp/ filled up.
I found that snmptraphandling.py never returned and thus blocked snmptt.
In snmptraphandling.py
Opening the FIFO with
output = open('/usr/local/nagios/var/rw/nagios.cmd', 'w')
COULD BLOCK!
I think this happens when Nagioxi does it's weekly stuff, and doesn'nt read the FIFO.
I also could reproduce if I did ApplyConfiguration via GUI.
My solution:
if os.path.exists('/usr/local/nagios/var/rw/nagios.cmd') and stat.S_ISFIFO(os.stat('/usr/local/nagios/var/rw/nagios.cmd').st_mode):
output = os.open('/usr/local/nagios/var/rw/nagios.cmd', os.O_WRONLY | os.O_NONBLOCK)
if service == 'PROCESS_HOST_CHECK_RESULT':
results = "[" + mytime + "] " + "PROCESS_HOST_CHECK_RESULT;" \
+ host + ";" + return_code + ";" + mondata_res + "\n"
else:
results = "[" + mytime + "] " + "PROCESS_SERVICE_CHECK_RESULT;" \
+ host + ";" + service + ";" \
+ return_code + ";" + mondata_res + "\n"
os.write(output,results)
Could someone confirm? And check my solution?
Regards,
Thomas