snmptraphandling.py

Giles Coochey gcoochey at sapphire.gi
Thu Nov 29 09:53:45 CET 2007


Is anyone using Francois Meehan's snmptraphandling.py script?

There's a part of the script where it opens the Nagios.cmd file. I'm not
a python coder, but it appears to me that it writes to the file with 'w'
which would overwrite any pending commands that Nagios has not yet
processed:

        #print mondata_res
        output = open('/opt/nagios/var/rw/nagios.cmd', 'w')
        results = "[" + mytime + "] " + "PROCESS_SERVICE_CHECK_RESULT;"
\
          + host + ";" + "TRAP-" + service_suffix + ";" \
          + return_code + ";" + mondata_res + "\n"
        output.write(results)

I'm thinking that this script should be opening the file with the 'a'
(Append) mode, so that unprocessed commands in nagios.cmd do not get
overwritten.

I do appear to be missing some traps within Nagios, I can see them as
far as snmptt, but it seems either sec.pl or snmptraphandling.py somehow
doesn't process them and the trap doesn't make it as far as Nagios.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list