External Command, scheduled downtime

Lewis Getschel lgetschel at denver.westerngeco.slb.com
Fri Feb 11 22:07:03 CET 2005


OK, I may be off here, but I'll give it a try...
I'm using 1.2, not the 2.0, but this sounds familiar...

Question, how do you know that your command is getting into the 
nagios.cmd file?
I ask because I did monitoring with   tail -f var/rw/nagios.cmd
and found that whenever I did that, I would SEE the command, but it 
would NEVER get processed.
It was only after 'forgetting' to do the tail command that I figured 
that I was actually interfering with it!
(I didn't realize it wasn't a 'file', but a named pipe until Andreas 
pointed it out.

I have the following lines in an event handler I'm using (so nagios 
acknowledges this file system service
is reaching a warning/critical level. This happens after another script 
mails out a message to the correct users)
This builds up the proper format for the nagios.cmd "named pipe" to use:
---- cut here ----
 # Now put the acknowledgment into Nagios so it doesn't continue to show 
warning/critical state
   echocmd="/bin/echo"
   CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
   # get the current date/time in seconds since UNIX epoch
   datetime=`date +%s`
   # create the command lines to add to the command file
   # the 4th parameter is 0=non-persistant, 1=persistant
   cmdline1="[$datetime] 
ADD_SVC_COMMENT;$4;$5;1;Nagios_script;ACKNOWLEDGEMENT: FS $freediskspace 
free disk,mail sent to $numberofmailsent users"
   cmdline2="[$datetime] ACKNOWLEDGE_SVC_PROBLEM;$4;$5;0;FS 
$freediskspace free disk, mail sent to $numberofmailsent users"
   `$echocmd $cmdline1 >> $CommandFile`
   `$echocmd $cmdline2 >> $CommandFile`
---- cut here ----

I'm not sure this helps, but I thought it might.
Lewis

alex at reseau.nl wrote:

>I've been investigating Nagios for a while now.
>
>I had the last stable, beta1 and now beta2 installed.
>
>I have problems scheduling Service and Host downtime using external
>commands. I haven't used it before and started with it in beta1.
>
>I have seen that multiple people have had this issue, though they
>never got a reaction. I hope I will because I don't have much time
>left for this investigation and using external commands to schedule
>downtime is critical in our system.
>
>When I use the Addon nagdtsched i get a message in the Event log:
>
>[2005-02-11 11:08:10] EXTERNAL COMMAND:
>SCHEDULE_SVC_DOWNTIME;linux1;PING;1108137600;1108195200;1;57600;nagios;Regularly
>Scheduled Dowtime
>
>but nothing shows up in the 'Downtime' page. If I schedule downtime
>via the webinterface then everythign goes ok.
>
>I tried echo-ing to var/rw/nagios.cmd myself and that worked like
>above. And both external commands for host and service downtime don't
>work. I first tried all of this in beta1, but hoping beta2 might have
>it fixed i installed that over 1, but that didn't help either.
>
>What I am using this for is to create performance data during business
>hours. But I want those hours defined in nagios, not in the data
>processing. I found out that I can use a macro that shows the
>downtime level, so i can easily use that calculating performance
>myself.
>It would help if there was a variant to the service&host notification
>hour settings. But this works just as well.
>
>Regards,
>Alex Haan
>
>----------------------------------------------------------------
>This message was sent using IMP, the Internet Messaging Program.
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>http://ads.osdn.com/?ad_ide95&alloc_id396&opclick
>_______________________________________________
>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
>
>  
>

-- 
Lewis Getschel             | Today is done...
WesternGeco                |     Today was fun...
1625 Broadway              |         Tomorrow is another one.
Denver, CO 80202           |
Direct Phone - 303-389-4407|        -- Dr. Seuss --



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
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