Kyle, <br><br>Yes, I have been following the thread you linked and saw some of the suggestions made. However, all of them seem "hackish" to me. Using NFS is not a good solution for me, because it reduces the portability of my scripts. For example, if a server that runs processes which disrupt monitored services cannot use NFS, I am out of luck. Also, simply exporting the 
nagios.cmd file over NFS requires me to use NFS to secure things instead of using the same authentication system nagios uses. I already have my API working, and am able to submit commands to nagios in a safe manner, but I cannot verify that those command were processed or what the result is. Consider the following block of code:
<br><br>$nag = new Nagios('username', 'password', '<a href="http://nagios.domain.com">nagios.domain.com</a>');<br>$host = $nag->findHostByIP('<a href="http://192.168.1.1">192.168.1.1</a>');
<br>$result = $nag->scheduleHostDowntime($host->name, date(U), date(U)+3600, true, 0, 3600, $nag->getUsername(), 'Auto-scheduled downtime for X');<br>if($result->code == 0) {<br>  do_task_that_causes_downtime();
<br>} else {<br>  log_errors($result->message);<br>}<br><br>This is what I envision being able to do. One of the main problems is that nagios may take a while to process the command, so if the command is sent and recieved by nagios, but hasn't yet been processed when the disruptive task begins, alerts will be still be generated. 
<br><br>While typing this I received Marc's reply and it seems I will need to modify commands.c to log when a command was processed then add a facility in my client interface to poll nagios about the status of a command in the pipe. This way my client can sit and wait until the command is processed before beginning the disruptive task. 
<br><br>I believe I have a better understanding of what I need to do now. Thanks for all the advice and I look forward to any additional feedback.<br><br>-Scott<br><br>SCHEDULE_HOST_DOWNTIME;<host_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment>
<br><div><span class="gmail_quote">On 1/23/08, <b class="gmail_sendername"><a href="mailto:kyle.odonnell@gmail.com">kyle.odonnell@gmail.com</a></b> <<a href="mailto:kyle.odonnell@gmail.com">kyle.odonnell@gmail.com</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Scott,<br><br>I'm in the process of doing something similar.  I've come up with
<br>something that may help you.<br><br>Read my thread entitle "nagios.cmd over nfs"<br><br><a href="http://www.nagiosexchange.org/nagios-users.34.0.html?&tx_maillisttofaq_pi1[mode]=1&tx_maillisttofaq_pi1[showUid]=8571">
http://www.nagiosexchange.org/nagios-users.34.0.html?&tx_maillisttofaq_pi1[mode]=1&tx_maillisttofaq_pi1[showUid]=8571</a><br><br><br>If nfs isn't an option, Thomas mentioned the use of netcat and or a<br>Perl daemon which would offer more control.
<br><br>Good luck!<br>On 1/23/08, Scott Sanders <<a href="mailto:lists@jssjr.com">lists@jssjr.com</a>> wrote:<br>> In my case, a backup job might take down a MySQL database for anywhere from<br>> 1 minute to 1 hour, depending on the size of the database. Because the time
<br>> needed to perform the backup is flexible and the time when the backup might<br>> occur is not always known, I cannot simply set the affected services to only<br>> notify in a timeperiod that excludes certain hours of the days. This is just
<br>> an example of why I need to allow scripts and applications not on the nagios<br>> host(s) to be able to use the external command pipe.<br>><br>> Currently I have a very simple API over https that uses the same auth
<br>> mechanism as the Nagios frontend, and PHP classes that I can use in my<br>> client side scripts to manipulate this API. I am able to query Nagios about<br>> object data and status data, as well as submit commands to the
<br>> nagios.cmdpipe. In order for the external command functionality to<br>> work the way I<br>> intend, I need to obtain a response from nagios so my server can respond<br>> back to the client with the results of processing the external command. I am
<br>> really hoping there is an easy way to do this, as replacing the<br>> nagios.cmdfile with something besides a FIFO pipe requires<br>> modification to the nagios<br>> source and is something I was trying to avoid.
<br>><br>> Thanks for the response. I hope this makes sense.<br>><br>> -Scott<br>><br>> On 1/23/08, Andreas Ericsson <<a href="mailto:ae@op5.se">ae@op5.se</a>> wrote:<br>> ><br>> > Scott Sanders wrote:
<br>> > > Hi,<br>> > ><br>> > > I am working on implementing some functionality that will allow me to<br>> > safely<br>> > > expose nagios.cmd to external hosts. In my environment there are
<br>> > maintenance<br>> > > tasks that run periodically which disrupt certain services, causing<br>> > nagios<br>> > > to start generating alerts. Needless to say, I am tired of having my<br>
> > cell<br>> > > phone go crazy when this happens.<br>> ><br>> > In that case, why not ask "How do I keep my cellphone from waking me up?"?<br>> > Instead, you've thought up a solution to your problem, which generates
<br>> > other problems, and now you want help solving those other problems.<br>> ><br>> > Assuming you know when these disruptive tasks are run, you should simply<br>> > create a notification_period that doesn't include the sensitive hours
<br>> > and use that notification_period for the services being disrupted.<br>> ><br>> > There are other solutions too, but this one is normally the recommended,<br>> > so I suggest you try that out first.
<br>> ><br>> > --<br>> > Andreas Ericsson                   <a href="mailto:andreas.ericsson@op5.se">andreas.ericsson@op5.se</a><br>> > OP5 AB                             <a href="http://www.op5.se">
www.op5.se</a><br>> > Tel: +46 8-230225                  Fax: +46 8-230231<br>> ><br>><br></blockquote></div><br>