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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
taandrews
Posts: 93
Joined: Thu Mar 10, 2016 1:55 pm

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

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
taandrews
Posts: 93
Joined: Thu Mar 10, 2016 1:55 pm

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

Post by taandrews »

Still not working.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post 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.
Former Nagios employee
https://www.mcapra.com/
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
taandrews
Posts: 93
Joined: Thu Mar 10, 2016 1:55 pm

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

Post 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.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked