checking service once a day

Jim Avery jim at jimavery.me.uk
Fri Aug 12 10:25:14 CEST 2011


On 12 August 2011 08:36, Silver Salonen <silver at serverock.ee> wrote:
> Hello.
>
> I want to check a service only once a day. So I tried this configuration:
>
> define timeperiod {
>     timeperiod_name once-a-day
>     alias       On mornings
>     monday      08:00-08:30
>     tuesday     08:00-08:30
>     wednesday   08:00-08:30
>     thursday    08:00-08:30
>     friday      08:00-08:30
>     saturday    08:00-08:30
>     sunday      08:00-08:30
> }
>
> define service {
>     use generic-service
>     check_period        once-a-day
>     normal_check_interval  1440        ; 24 hours
>     ...
> }
>
> Now when I check the service's next schedule time, Nagios is still
> showing that the next check is scheduled to 24h after the previous check
> and at 22:53 (pm). Restarting Nagios does not change that. Any tips for
> what's wrong in the configuration?


If Nagios wants to schedule a check at a certain time, but it's not in
the timeperiod then it won't run it.

If you don't mind what time of day your check is run, then use the
standard 24x7 timeperiod.

If you want a check to run at a specific time of day, you need to run
it from cron so it submits the check result to Nagios as a passive
check.

http://nagios.sourceforge.net/docs/nagioscore/3/en/passivechecks.html

Alternatively, if you don't mind your check being run a couple of
times each day, I would think you could leave your config as it is,
but set the normal_check_interval to 12 (minutes) or so to give it a
good chance of being scheduled within your 30-minute window.
Personally I would use cron, but it can be a bit fiddly to set up the
first time you try it.

hth,

Jim

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
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