NSClient++ Help (#1) - CheckTaskScheduler? (#217) - Message List

Hi

I try to define a command (by nrpe) which reports critical state to nagios if at least one of the tasks has a state > 0.

-c CheckTaskSched -a "+filter-exit-code=>1 ShowAll MaxWarn=0 MaxCrit=0"

If all tasks have state 0, then nagios reports state OK with text "OK: All scheduled tasks are ok".

If one task has state 1, then nagios reports state OK (green!) with text "xyz.job last run: 2008-08-06 11:00:00 (1)". So nagios doesn't send emails because state is OK.

In my opinion, for the second case, nagios should report "Critical (red!)".

Do I miss something in my command configuration?

Best regards patrick

  • Message #614

    this is a bit confusing...

    the syntax is <key>=<value> in your case you have said: "+filter-exit-code=>1" which translates into: +filter-exit-code = >1 (thus not > 0 as you want).

    Secondly the arguments should not all be escaped so this ought to do what you want:

    -c CheckTaskSched -a '+filter-exit-code=>0' ShowAll MaxWarn=0 MaxCrit=0

    MickeM

    • Message #618

      I tried that...

      -c CheckTaskSched -a '+filter-exit-code=>0' ShowAll MaxWarn=0 MaxCrit=0

      Your command gives this output:

      1.job last run: 2008-08-07 11:00:00 (0), 2.job last run: 2008-08-07 13:45:00 (0), 3.job last run: 2008-08-07 07:00:00 (0), 4.job last run: 2008-08-07 13:00:00 (0), 5.job last run: 2008-08-07 13:45:00 (0), 6.job last run: 2008-08-07 13:49:15 (0), 7.job last run: 2008-08-07 03:00:00 (0), 8.job last run: 2008-08-02 01:00:00 (0), 9.job last run: 2008-08-07 13:38:00 (0), 10.job last run: 2008-08-07 12:45:00 (0), : 10 > critical|=10;0;0;

      Nagios reports this as "critical". But as you can see, all tasks have exit code "0".

      After doing some more testing, i found a command that works:

      -a '+filter-exit-code=>1' ShowAll MaxWarn=1 MaxCrit=1

      If all tasks have exit code "0" then nagios reports "ok" with message ":0|=0;1;1;". If one task has exit code greater than "0", nagios reports "critical" with the task name in the message ("x.job last run: 2008-08-07 14:06:10 (1), : 1 > critical").

      • Message #619

        sounds like a bug, I shall investigate, and be prepared to "change" if I find it is a bug and fix it :)

        I shall report back here when I have looked into the issue, and I shall update the documentation as well...

        MickeM

        • Message #1159

          Has there been any updates on this Check?

          My current conf is as follows. Have I got it wrong?

          define service{

          use generic-service host_name windersserver service_description Task Scheduler check_command check_nt!-c CheckTaskSched -a '+filter-exit-code=>1' ShowAll MaxWarn=1 MaxCrit=1 }

Subscriptions