Re: [Nagios-users] Problem scheduling downtime externally

2008-06-25 Thread Marc Powell
On Jun 25, 2008, at 12:32 PM, Tony Rice (trice) wrote: > Perl script looks like this: > > open (FILE, ">$cmd_file"); > print "[$epoch_now] > SCHEDULE_HOST_DOWNTIME;$host;$epoch_start;$epoch_stop;0;0;$duration; > $use > rid;$comment\n"; > close (FILE); > > Nothing in the log indicating that this

Re: [Nagios-users] Problem scheduling downtime externally

2008-06-25 Thread Mathieu Gagné
You can't open nagios.cmd in append mode, otherwise it will cause a seek. You should use the function nagios_cmd declared in Nagios::Cmd: http://search.cpan.org/src/TOBEYA/Nagios-Cmd-0.05/lib/Nagios/Cmd.pm It's working fine for me. -- Mathieu

Re: [Nagios-users] Problem scheduling downtime externally

2008-06-25 Thread Tony Rice (trice)
t > Subject: RE: [Nagios-users] Problem scheduling downtime externally > > Maybe i'm not familiar enough with perl (I'm not, really), > but it appears to me that you are not writing anything to the > file since your 'print' statement is missing the file ha

Re: [Nagios-users] Problem scheduling downtime externally

2008-06-25 Thread Aaron M. Segura
ng that this command is making it anywhere. > Nothing in the log relevant either. > > -Tony > > > -Original Message- > > From: Aaron M. Segura [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, June 25, 2008 11:25 AM > > To: Tony Rice (trice) > > Cc: na

Re: [Nagios-users] Problem scheduling downtime externally

2008-06-25 Thread Tony Rice (trice)
relevant either. -Tony > -Original Message- > From: Aaron M. Segura [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 25, 2008 11:25 AM > To: Tony Rice (trice) > Cc: nagios-users@lists.sourceforge.net > Subject: Re: [Nagios-users] Problem scheduling downtime externally &g

Re: [Nagios-users] Problem scheduling downtime externally

2008-06-25 Thread Aaron M. Segura
Please be more specific. How, exactly, are you trying to write to the pipe? Please include some examples. Do you look in the nagios log after that to see if it picked up any commands? Are there any relevant log entries that might help? On Wed, 2008-06-25 at 11:09 -0400, Tony Rice (trice) wrote

Re: [Nagios-users] Problem scheduling downtime externally

2008-06-25 Thread Richard Quintin
I had a similar problem and just switched to using the cmd.cgi to get it done. Attached is a simple daemon I wrote until I can get around to writing a proper one. You can take a look at it to get an example of how to use cmd.cgi. If you decide you want to use the script itself, you'll need to ma

[Nagios-users] Problem scheduling downtime externally

2008-06-25 Thread Tony Rice (trice)
I'm trying to interface a database of upcoming downtimes to Nagios via the SCHEDULE_AND_PROPAGATE_TRIGGERED_HOST_DOWNTIME external command. However, writing to the nagios.cmd file just sits there and never returns. I'm wondering if it's a problem with the way the named pipe is setup. My nagios.cm