Understanding check_wmi_plus.pl checkservice results

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
onegative
Posts: 175
Joined: Tue Feb 17, 2015 12:06 pm

Understanding check_wmi_plus.pl checkservice results

Post by onegative »

G 'Day Customer Support,

I am trying to understand certain aspects of the check_wmi_plus.pl script and cannot seem to figure out exactly what the returned values are indicating.

Command:
/usr/local/nagios/libexec/check_wmi_plus.pl -H xx.xx.xxx.123 -A /opt/nagios/libexec/nagiosxi_mask -m checkservice -a 'SepMasterService'

Results:
OK - Found 1 Services(s), 0 OK and 1 with problems (0 excluded). 'SepMasterService' (SepMasterService) is Running.|'Total Service Count'=1; 'Service Count OK State'=0; 'Service Count Problem State'=1; 'Excluded Service Count'=0;

I have confirmed the Service is indeed running...and I see the script lists the service as "Found & Running" but I do not understand why:

'Service Count OK State'=0

'Service Count Problem State'=1

Please help me understand what it is trying to tell me...the documentation for these specific results are not detailed and do not describe what they are actually indicating.

Thanks,
Danny

If the service is running why is the OK State equal 0 and Problem State equal 1?
Last edited by onegative on Mon Aug 14, 2017 1:04 pm, edited 1 time in total.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Understanding check_wmi_plus.pl checkservice results

Post by mcapra »

Here's the usage instructions for the checkservice sub-mode:

Code: Select all

checkservice  
   ARG1  A regular expression that matches against the short or long service name that can be seen in the properties of the
      service in Windows. The matching services are included in the resulting list. Use . alone to include all services.
      Use Auto to check that all automatically started services are OK.
   ARG2  A regular expression that matches against the short or long service name that can be seen in the properties of the
      service in Windows. The matching services are excluded in the resulting list.
      This exclusion list is optional and applied after the inclusion list.
   ARG3  Optionally used to specify what type of services to display under which conditions. If not specified, all services are shown in all conditions. This is a comma delimited list of specifications in the following format: WHEN=WHAT, where WHEN is one of ok,warning,critical,unknown and WHAT is one of all,ok,bad,none. Examples: "ok=none,warning=bad,critical=bad" or "warning=all,critical=none". So to show only the "bad" services when a warning is given use "warning=bad".
   ARG4  Used to specify which type of services to display based on the StartMode. Only services with a StartMode matching this regular expression will be included. Examples: To include only manually started services use "-4 manual". To include all automatic and manual services use "-4 auto|man"
      This list is optional and applied before the exclusion list.
   WARN/CRIT  can be used as described below.
      Valid Warning/Critical Fields are: _NumBad (Default), _NumGood, _NumExcluded, _Total

   Note:  
      A "Good" service is one that is Started, its State is Running and its Status is OK. Anything else is considered "Bad". If you don't want certain services included in this count then you will need to exclude them with -o ARG2

   PRO Users can use --includedata and --excludedata for this mode.
I'd like to direct your attention to ARG4 specifically. I think if the service's "Start Mode" is not "Automatic", checkservice will flag it as in a "problem" state by default. Are you able to check what the "Start Mode" is for the service you're monitoring to confirm/deny?

I believe the fix is mentioned in that same help section:

Code: Select all

To include only manually started services use "-4 manual". To include all automatic and manual services use "-4 auto|man"
You may also need to leverage some combination of _NumBad, _NumGood, _NumExcluded, _Total in your execution, depending on the desired outcome.
Former Nagios employee
https://www.mcapra.com/
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Understanding check_wmi_plus.pl checkservice results

Post by tgriep »

In addition to what @mcapra says, I think there was a bug in the earlier version of the plugin that could be the cause of the error when the plugin checks to see if the service is set to autorun, go to the link below and see if you need to upgrade the plugin.
http://www.edcint.co.nz/checkwmiplus/
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked