where to get help with ext. cmd CHANGE_NORMAL_SVC_CHECK_INTERVAL ?

John P. Rouillard rouilj at cs.umb.edu
Fri Mar 17 05:51:22 CET 2006


In message <20060317030214.GA10825 at mini.alaya.net>,
prosolutions writes:

>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
> [...]
>i see that this differs from what you claim to have succesfully run (see
> below)
>> >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)

Hmm, I would expect a timeline something like the following:

 id  time   state
 1    0     poll fails in state soft failure try number 1 (aka soft 1)
 2    15s   soft alert 2
 3    30s   soft alert 3
 4    45s   hard alert  (scheduled with 90 seconds because change of
                        check interval hasn't occurred yet)
 5    45s+  event handler called generates CHANGE_NORMAL_SVC_CHECK_INTERVAL
 6    135s  still hard (but now it schedules using the 15 second timeperiod)
 7    150s  hard
 8    165s  hard
 9         stays with 15 second interval.

If you wanted to have the interval between 4 and 6 be something other
than 90 seconds you have to generate a SCHEDULE_FORCED_SVC_CHECK for
the date "now + 15 seconds" at line 5 in addition to the change in
check interval.

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

Printf is POSIX standard, but both my command and the printf produce
the same output. Try both and see. If you don't understand why they
produce the same output, read the man pages and get a book on shell
programming.

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

No. I am just using shell substitution in the quoted string. Functionally
they are equivalent. RTFM for bash, echo, printf, date etc..

>> 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;te
>st.html;15
>
>but alas object.cache shows check_interval to still be 90s

Hmm, maybe a bug in 2.0b3?

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

Right. The new schedule won't take effect until the currently
scheduled poll is run at the original scheduling interval AFAICT.  If
you want the new interval to take affect immediately you need to force
it with a SCHEDULE_FORCED_SVC_CHECK command.

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

Good luck. I'd be interested in seeing what finally works. Also you
should check the nagios 2.0 release notes between 2.0b3 and 2.0rc1 and
see if there is a reference to this problem.

				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.


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