Check_wmi_plus

Can anyone help me setup ‘–extrawmicarg --option = “client ntlmv2 auth” = Yes’ parameter in Icinga2 command.conf .

I tested in CLI :
/usr/lib64/nagios/plugins/check_wmi_plus.pl -H host -u username -p password --extrawmicarg --option=‘client ntlmv2 auth’=Yes -m checkcpu

and it works,

But can not meke to work from conf file.

Regards,
Robi

Hi,

How about something like:

apply Service "CPU Utilization" {
   import "generic-service"
   vars.check_mode = "checkcpu"
   vars.wmi_warn = "95"
   vars.wmi_crit = "99"
   vars.wmi_timeout = "60"
   vars.wmi_extrawmiarg = "client ntlmv2 auth"
   check_command = "check_wmi"
   assign where host.vars.os == "Windows" 
   ignore where host.vars.disable_wmi
}

You need to turn on debug in order to see the actual command that icinga runs in debug.log and make further adjustments from there on.

/George

1 Like

Hello,

I turn on debug. It is a problem with single quotes. In debug mode every argument is in single quotes but this

–extrawmicarg --option=“client ntlmv2 auth”=Yes

must not be in single quotes .

This is in debug.log:

‘/usr/lib64/nagios/plugins/check_wmi_plus.pl’ ‘-H’ ‘hostname’ ‘-u’ ‘username’ ‘-p’ ‘password’ ‘–extrawmicarg’ ‘–option=“client ntlmv2 auth”=Yes’ ‘-m’ ‘checkcpu’

should be like this to work:

‘/usr/lib64/nagios/plugins/check_wmi_plus.pl’ ‘-H’ ‘hostname’ ‘-u’ ‘username’ ‘-p’ ‘password’ --extrawmicarg --option=“client ntlmv2 auth”=Yes ‘-m’ ‘checkcpu’

Robi

Hi,

Have you tried without the extrawmiarg? I might have read somewhere that NTLM auth v2 is the default nowadays but its worth a try .

/George

Hi,

no it not work without that parameter.

I found a solution. Maybe it’s not the best, but it works.

object CheckCommand “check_wmi” {
import “plugin-check-command”
command = PluginDir + “/check_wmi_plus.pl -H $host.name$ -A “/etc/icinga2/wmi.auth” --extrawmicarg --option=“client ntlmv2 auth”=Yes -m $check_mode$ -a $wmi_arg1$ -o $wmi_arg2$ -3 $arg3$ -w $wmi_warn$ -c $wmi_crit$”

}

Thx