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.
WMI error following v5 upgrade
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: WMI error following v5 upgrade
fusfeld wrote:m checkforoldfiles
Can you check your command under CCM > Commands to see if the WMI command has the mode set as m or -mfusfeld wrote:-m MODE
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: WMI error following v5 upgrade
Here is the command definition:
$USER1$/check_wmi_plus.pl -H $ARG5$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$
$USER1$/check_wmi_plus.pl -H $ARG5$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: WMI error following v5 upgrade
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.
Re: WMI error following v5 upgrade
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"
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"
Re: WMI error following v5 upgrade
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!
Re: WMI error following v5 upgrade
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
}
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
}
Re: WMI error following v5 upgrade
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?Here is the command definition:
$USER1$/check_wmi_plus.pl -H $ARG5$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: WMI error following v5 upgrade
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.
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.
Re: WMI error following v5 upgrade
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.
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!