Page 1 of 1

WMI Error - A valid MODE and/or SUBMODE must be specified

Posted: Thu Jul 06, 2017 5:09 pm
by taandrews
Just setup a new WMI monitor and I am receiving A valid MODE and/or SUBMODE must be specified. I would like to know what are the supported special characters of a password for WMI? Also the command that XI is using is as follows:

$USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$

The corresponding ARGs are

$ARG1$ 'domain/username'
$ARG2$ 'N
$ARG3$ password
$ARG4$
$ARG5$ checkcpu
$ARG6$ -w '50' -c '99'

I think there is an issue with the special character in my password or the matching of the ARGS.

Re: WMI Error - A valid MODE and/or SUBMODE must be specifie

Posted: Fri Jul 07, 2017 10:40 am
by scottwilkerson
The following can become a problem

Code: Select all

!`~$&|'"<>
Additionally, others can be problematic with the command specified as it is, you may want to consider the following

Code: Select all

$USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p '$ARG2$' -m $ARG3$ $ARG4$
Which wraps the password in single quotes.

Additional info
https://support.nagios.com/kb/article.php?id=580

Re: WMI Error - A valid MODE and/or SUBMODE must be specifie

Posted: Fri Jul 07, 2017 2:29 pm
by taandrews
Still not working.

Re: WMI Error - A valid MODE and/or SUBMODE must be specifie

Posted: Fri Jul 07, 2017 2:58 pm
by mcapra
One thing worth mentioning is your $ARGn$ values don't seem to line up with the Nagios command definition.
taandrews wrote: $USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$

The corresponding ARGs are

$ARG1$ 'domain/username'
$ARG2$ 'N
$ARG3$ password
$ARG4$
$ARG5$ checkcpu
$ARG6$ -w '50' -c '99'
With the check_wmi_plus plugin, -m denotes the submode. In the context of the Nagios command definition you've displayed above, you are passing "password" as the value of the submode via $ARG3$. Essentially, this is being run:

Code: Select all

$USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u 'domain/username' -p 'N -m password
You should instead be passing the password via $ARG2$ and the submode via $ARG3. $ARG4$ would then be additional parameters you pass to the specific submode, stuff like the warning/critical thresholds, path to a specific disk you want to check (if using checkdrivesize for the submode), etc.

Re: WMI Error - A valid MODE and/or SUBMODE must be specifie

Posted: Fri Jul 07, 2017 3:24 pm
by tgriep
What mcapra said is correct, the arguments do not line up with the command.
Try changing them to this.

Code: Select all

$ARG1$ 'domain/username'
$ARG2$ password
$ARG3$ checkcpu
$ARG4$ -w '50' -c '99
'

There is not a $ARG5$ and $ARG6$ so they are not needed.

Re: WMI Error - A valid MODE and/or SUBMODE must be specifie

Posted: Mon Jul 10, 2017 4:05 pm
by taandrews
Resolved. There was an unsupported special character in my password. I didn't realize the Nagios has stripped the special character and some other characters along with it.

Re: WMI Error - A valid MODE and/or SUBMODE must be specifie

Posted: Mon Jul 10, 2017 4:12 pm
by tgriep
Thanks for reporting back your results. I'll close and lock the post for you. If you have any new questions in the future, feel free to open a new post.