where to get help with ext. cmd CHANGE_NORMAL_SVC_CHECK_INTERVAL ?

prosolutions at gmx.net prosolutions at gmx.net
Fri Mar 17 04:06:31 CET 2006


> > [mangled broken shell script removed]
> 

oops yes part of it got chopped.  and yes it wasn't elegant - i threw it
together to get it to run.  it does run - it handles the cases
correctly, etc.


> What I saw as a shell script isn't a valid shell script. At
> the very least it looks like a case statement got chopped
> off at the top. Also you have a lot of redundant code there.
> 
> Also there is no standard for the arguments to event handler
> scripts, including the command definition would have been
> useful.
>   
> >I see after max_check_attempts that state to go
> >CRITICAL HARD for the service and then it runs the
> >event_handler which runs the external command:
> >
> >[1142543941] EXTERNAL COMMAND: CHANGE_NORMAL_SVC_CHECK_INTERVAL;test_host;test.html;15


no.  sorry i wasn't clear on this.  that is what i see in the log file.
the command that is run is that which is in the script, namely:

printf "[%lu] CHANGE_NORMAL_SVC_CHECK_INTERVAL;$4;$5;15\n" $now > $commandfile

this is taken directly from the canonical definition of this command
listed at
http://www.nagios.org/developerinfo/externalcommands/commandinfo.php?command_id=110,
which is:

#!/bin/sh
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] CHANGE_NORMAL_SVC_CHECK_INTERVAL;host1;service1;15\n" $now > $commandfile

i see that this differs from what you claim to have succesfully run (see
below)

> 
> the inclusion of "EXTERNAL COMMAND:" is a syntax error. If


no, that is what the log file showed after the command ran, not what i
sent

> 
> >this should set the check_interval to 15 seconds instead
> >of the default 90 seconds.  However, watching the log I see
> >that the checks on the service revert to 90 s.
> 
> What are you seeing in the log that makes you think it's
> getting reset? If I use:


i am watching the log and timing it and watching how frequently the
service checks get run.  they run at retry_check_interval up until
max_check_attempts gets reached, then, even though the event handler
runs the script to execute the CHANGE_NORMAL_SVC_CHECK_INTERVAL command,
setting the interval to 15 seconds (same as retry_check_interval), it
does not set (i.e. it reverts back to check_interval (90s)

> 
>  echo "[`date +%s`] CHANGE_NORMAL_SVC_CHECK_INTERVAL;tigris;DiskBackupMountCheck;3"


okay this looks substantially differnt than the cannonical example
above.  first off instead of [%lu] following the echo/print, you have
[`date +%s`]   also, i don't see 

\n `date +%s` > $commandfile

at the end of your script.  is the date command supposed to go before
and after the command?


> 
> to change the check interval to three minutes, and direct it
> to the command pipe, I see it take effect and stay in
> effect. Looking at the Event Log in the web interface shows:
> 
> [03-16-2006 22:54:25] EXTERNAL COMMAND: CHANGE_NORMAL_SVC_CHECK_INTERVAL;tigris;DiskBackupMountCheck;3


yep i see an entry just like this:

[1142543941] EXTERNAL COMMAND: CHANGE_NORMAL_SVC_CHECK_INTERVAL;test_host;test.html;15

but alas object.cache shows check_interval to still be 90s

> 
> No other CHANGE_NORMAL_SVC_CHECK_INTERVAL commands occur. 

i agree there are no others

> 
> When you change the check interval, it doesn't force a
> reschedule of the service with the new interval. 

i'm not sure what you mean here.  you mean, even though check_interval
gets changed, that it must somehow be rescheduled before actually taking
effect?

> 
> Also I am using nagios 2.0rc1, so YMMV.
> 


nagios 2.0b3 here. 


thanks much for your help.  i will mess around with the command a bit
and if i can get it to work.



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
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