WMI error following v5 upgrade

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
fusfeld
Posts: 15
Joined: Wed Jun 18, 2014 11:55 am

WMI error following v5 upgrade

Post by fusfeld »

Hello - one of our checks has started throwing an error since the v5 upgrade, no issues with this previously. The output from running a test command (which also contains the error) is:

COMMAND: /usr/local/nagios/libexec/check_wmi_plus.pl -H afweb1.acsysprod.com -u <domain/user> -p <password> m checkforoldfiles -a d: -3 /Acsysweb/AchievementFirst/FileWebApp/StudentAnswerImages/database/ -4 %.mdb -w 60min -c 120min
OUTPUT: A valid MODE and/or SUBMODE must be specified
Typical Usage: -H HOSTNAME -u DOMAIN/USER -p PASSWORD -m MODE [-s SUBMODE] [-b BYTEFACTOR] [-w WARN] [-c CRIT] [-a ARG1 ] [-o ARG2] [-3 ARG3] [-4 ARG4] [-A AUTHFILE] [-t TIMEOUT] [-y DELAY] [--namespace WMINAMESPACE] [--extrawmicarg EXTRAWMICARG] [--nodatamode] [--nodataexit NODATAEXIT] [--nodatastring NODATASTRING] [-d] [-z] [--inifile=INIFILE] [--inidir=INIDIR] [--inihelp] [--nokeepstate] [--keepexpiry KEXPIRY] [--keepid KID] [--joinexpiry JEXPIRY] [-v OSVERSION] [--help] [--itexthelp] [--forcewmiccommand] [-icollectusage] [--ishowusage] [--logswitch] [--logkeep] [--logsuffix SUFFIX] [--logshow] [--variablesdisabled] [--forceiniopen] [--forcetruncateoutput LEN]
Help as a Manpage: --help
Help as Text: --itexthelp

I did some searching and saw this error in other instances on these forums but didnt think any solutions were applicable. Any help is appreciated.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: WMI error following v5 upgrade

Post by Box293 »

fusfeld wrote:m checkforoldfiles
fusfeld wrote:-m MODE
Can you check your command under CCM > Commands to see if the WMI command has the mode set as m or -m
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
fusfeld
Posts: 15
Joined: Wed Jun 18, 2014 11:55 am

Re: WMI error following v5 upgrade

Post by fusfeld »

Here is the command definition:

$USER1$/check_wmi_plus.pl -H $ARG5$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: WMI error following v5 upgrade

Post by Box293 »

Instead of using the "Test Check Command" button, what output do you from the Service in the XI GUI?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
fusfeld
Posts: 15
Joined: Wed Jun 18, 2014 11:55 am

Re: WMI error following v5 upgrade

Post by fusfeld »

Are you referring to the service status detail?


I see this:

A valid MODE and/or SUBMODE must be specified
Typical Usage: -H HOSTNAME -u DOMAIN/USER -p PASSWORD -m MODE [-s SUBMODE] [-b BYTEFACTOR] [-w WARN] [-c CRIT] [-a ARG1 ] [-o ARG2] [-3 ARG3] [-4 ARG4] [-A AUTHFILE] [-t TIMEOUT] [-y DELAY] [--namespace WMINAMESPACE] [--extrawmicarg EXTRAWMICARG] [--nodatamode] [--nodataexit NODATAEXIT] [--nodatastring NODATASTRING] [-d] [-z] [--inifile=INIFILE] [--inidir=INIDIR] [--inihelp] [--nokeepstate] [--keepexpiry KEXPIRY] [--keepid KID] [--joinexpiry JEXPIRY] [-v OSVERSION] [--help] [--itexthelp] [--forcewmiccommand] [-icollectusage] [--ishowusage] [--logswitch] [--logkeep] [--logsuffix SUFFIX] [--logshow] [--variablesdisabled] [--forceiniopen] [--forcetruncateoutput LEN]
Help as a Manpage: --help
Help as Text: --itexthelp

And the service state is "unknown"
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: WMI error following v5 upgrade

Post by lmiltchev »

Go to the CCM->Services, find your service, click on the "View Text Config" actions button (the diskette icon) next to it, and post the config.
Be sure to check out our Knowledgebase for helpful articles and solutions!
fusfeld
Posts: 15
Joined: Wed Jun 18, 2014 11:55 am

Re: WMI error following v5 upgrade

Post by fusfeld »

define service {
host_name AFWeb1
service_description Check Scantest MDB folder
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_wmiplus_1!<domain/user>!<password>!checkforoldfiles!-a d: -3 /Acsysweb/AchievementFirst/FileWebApp/StudentAnswerImages/database/ -4 %.mdb -w 60min -c 120min!afweb1.acsysprod.com!!!
initial_state o
max_check_attempts 5
check_interval 5
retry_interval 1
active_checks_enabled 1
passive_checks_enabled 1
check_period xi_timeperiod_24x7
event_handler notify-service-by-email
event_handler_enabled 1
flap_detection_enabled 0
notification_interval 60
first_notification_delay 0
notification_period xi_timeperiod_24x7
notification_options w,c,u,r,f,s,
notifications_enabled 1
contacts davef,frankr,mikel
_xiwizard windowsserver
register 1
}
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: WMI error following v5 upgrade

Post by lmiltchev »

Here is the command definition:

$USER1$/check_wmi_plus.pl -H $ARG5$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$
Can you verify that this is the command definition of "check_xi_service_wmiplus_1" command? Does you check fail if you run it from the command line?
Be sure to check out our Knowledgebase for helpful articles and solutions!
fusfeld
Posts: 15
Joined: Wed Jun 18, 2014 11:55 am

Re: WMI error following v5 upgrade

Post by fusfeld »

Here's the definition for that command:

define command {
command_name check_xi_service_wmiplus_1
command_line $USER1$/check_wmi_plus.pl -H $ARG5$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$
}

Yep it fails from the command line as well, same error.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: WMI error following v5 upgrade

Post by tgriep »

I went through the modes that the check_wmi plugin and the "checkforoldfiles" mode isn't listed for that plugin and that is the error you are receiving.

Here are a couple of mode checks you could use in your environment. Take a look at them and if you have any questions, let us know.

Code: Select all

checkfileage
   ARG1  full path to the file. Use '/' (forward slash) instead of '\\' (backslash).
   ARG2  set this to one of the time multipliers (wk, yr, hr, sec, mth, min, day)
      This becomes the display unit and the unit used in the performance data. Default is hr.
      -z can not be used for this mode.
   WARN/CRIT  can be used as described below.
      The only valid Warning/Critical Field is _FileAge, so you don't even need to specify it!

      The warning/critical values should be specified in seconds. However you can use the time multipliers
      (wk, yr, hr, sec, mth, min, day) to make it easier to use

      eg instead of putting -w 3600 you can use -w 1hr

      eg instead of putting -w 5400 you can use -w 1.5hr

      Typically you would specify something like -w 24: -c 48:

 checkfolderfileage (-m checkfolderfileage)
   Check a Folder for files of a certain age.
   You most likely want to use --includedata and or --excludedata to list only the files that match the age you are interested in and then use -w and -c to
   warn against the number of files you end up finding.
   For example, find files in c:/temp with an age of between 0 and 10000 seconds.
   Warn if you find more than 3 of these.
   Use the parameters -a c: -o /temp/ -inc _FileAge=@0:10000 -w 3.
   Alternatively, you could just warn against the _FileAge directly eg -a c: -o /temp/ -w _FileAge=1000
   ARG1  The drive letter of the folder  eg C:
   ARG2  The path of the folder on the specified drive eg /temp/. Folders must end in /
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked