<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 12.08.2011 12:37, Silver Salonen wrote:
    <blockquote cite="mid:4E44F476.1050601@serverock.ee" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      On 12.08.2011 11:25, Jim Avery wrote:
      <blockquote
cite="mid:CAB2RnUtg9-tMMkJSgdw0U-W7p3HiK39i-tz07hT6KfJifNcxQw@mail.gmail.com"
        type="cite">
        <pre wrap="">On 12 August 2011 08:36, Silver Salonen <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:silver@serverock.ee"><silver@serverock.ee></a> wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">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?
</pre>
        </blockquote>
        <pre wrap="">
If Nagios wants to schedule a check at a certain time, but it's not in
the timeperiod then it won't run it.</pre>
      </blockquote>
      <br>
      That's interesting. Documentation says:<br>
      <br>
      <span class="Apple-style-span" style="color: rgb(0, 0, 0);
        font-family: verdana, arial, serif; font-size: 11px; font-style:
        normal; font-variant: normal; font-weight: normal;
        letter-spacing: normal; line-height: normal; orphans: 2;
        text-align: -webkit-auto; text-indent: 0px; text-transform:
        none; white-space: normal; widows: 2; word-spacing: 0px;
        -webkit-text-decorations-in-effect: none;
        -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
        background-color: rgb(255, 255, 255); ">Specifying a timeperiod
        in the<span class="Apple-converted-space"> </span><i>check_period</i><span
          class="Apple-converted-space"> </span>directive allows you to
        restrict the time that Nagios perform regularly scheduled,
        active checks of the host or service. When Nagios attempts to
        reschedule a host or service check, it will make sure that the
        next check falls within a valid time range within the defined
        timeperiod. If it doesn't, Nagios will adjust the next check
        time to coincide with the next "valid" time in the specified
        timeperiod.</span><br>
      <br>
      So I guess documentation is wrong then?<br>
      <br>
      <blockquote
cite="mid:CAB2RnUtg9-tMMkJSgdw0U-W7p3HiK39i-tz07hT6KfJifNcxQw@mail.gmail.com"
        type="cite">
        <pre wrap="">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.

<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://nagios.sourceforge.net/docs/nagioscore/3/en/passivechecks.html">http://nagios.sourceforge.net/docs/nagioscore/3/en/passivechecks.html</a>

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.
</pre>
      </blockquote>
      <br>
      OK, I guess I'd have to go with the passive checks through crontab
      then (because I do mind what time the checks are run).<br>
      <br>
    </blockquote>
    Ah yes, previously I just restarted Nagios every day (from crontab)
    so that the checks would be re-scheduled, but in the new
    installation Nagios does not re-schedule the checks on startup. Is
    there an option for that? I don't seem to find it...<br>
    <br>
    --<br>
    Silver<br>
  </body>
</html>