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

I tested in CLI :
/usr/lib64/nagios/plugins/ -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.



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.


1 Like


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/’ ‘-H’ ‘hostname’ ‘-u’ ‘username’ ‘-p’ ‘password’ ‘–extrawmicarg’ ‘–option=“client ntlmv2 auth”=Yes’ ‘-m’ ‘checkcpu’

should be like this to work:

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



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



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 + “/ -H $$ -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$”




I have tried to configure NTLMv2 authentication using Icinga Director - sharing how it could be done:

1/ update check command wmi_plus.conf
template CheckCommand “wmi_plus_base” {
import “plugin-check-command”
command = [ PluginDir + “/” ]
arguments += {

“–extrawmicarg” = {
value = “$wmi_plus_checkcpu_extrawmicarg$”

2/ Kick start
Icinga Director -> Icinga Infrastructure -> Kickstart -> Run Import

3/ Add data field
Icinga Director -> Data fields -> Add
Field name: wmi_plus_checkcpu_extrawmicarg
Caption: wmi_plus_checkcpu_extrawmicarg
Data type: String

4/ update Commands
Icinga Director -> Commands
wmi_plus_checkcpu, Fields, add wmi_plus_checkcpu_extrawmicarg, Optional
same for:

5/ modify Services
Icinga Director -> Services -> Windows*

Windows CPU
Windows Disk
Windows Memory
wmi_plus_checkcpu_extrawmicarg: --option=client ntlmv2 auth=Yes
Note: NO quotes around client ntlmv2 auth string

instead of correct syntax when using in command line:
./ -H $HOST -u $USER -p $PASS -m checkcpu --extrawmicarg --option=“client ntlmv2 auth”=Yes