Re: [Nagios-users] snmptraphandling.py

2007-11-29 Thread Giles Coochey
> On 29 Nov 2007, at 08:53, Giles Coochey wrote:
> 
> > 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:
> >
> 
> nagios.cmd is a pipe, not an ordinary file and the contents cannot be
> overwritten as such - whatever gets written into the pipe will be
> read out of the pipe by the controlling binary in the same order.
> 
> If you cat the pipe then the contents will be lost to nagios, as when
> items are read from the pipe they are automatically removed from it.
> 
> Pipes have the first letter as a 'p' on 'ls -l'.
> 

Thanks Duncan, so it's a FIFO. So now I need to find out why I'm losing
events along the way :-(

-
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@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


Re: [Nagios-users] snmptraphandling.py

2007-11-29 Thread Duncan Ferguson

On 29 Nov 2007, at 08:53, Giles Coochey wrote:

> 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:
>

nagios.cmd is a pipe, not an ordinary file and the contents cannot be  
overwritten as such - whatever gets written into the pipe will be  
read out of the pipe by the controlling binary in the same order.

If you cat the pipe then the contents will be lost to nagios, as when  
items are read from the pipe they are automatically removed from it.

Pipes have the first letter as a 'p' on 'ls -l'.

   Duncs

-- 
Duncan Ferguson
Senior Developer, Altinity Limited

http://www.altinity.com
Tel: +44 (0)870 787 9243
US:  +1 866 879 9184
Fax: +44 (0)845 280 1725
Skype: duncan_j_ferguson
MSN: [EMAIL PROTECTED]

The contents of this email and any files transmitted with it are  
confidential and intended solely for the use of the individuals to  
whom it is addressed.
If you are not the intended recipient or have received this e-mail in  
error please notify the sender and delete this e-mail immediately.
Any unauthorised copying, disclosure or distribution of the material  
in this e-mail is strictly prohibited.

Altinity Limited | 404 Seven Sisters Road | London | N4 2LX | United  
Kingdom
Registered in England and Wales under company number 4743767


-
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@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


[Nagios-users] snmptraphandling.py

2007-11-29 Thread Giles Coochey
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@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