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
gkoutsog
(George K)
June 17, 2019, 1:15pm
2
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
gkoutsog
(George K)
June 18, 2019, 8:58am
4
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
Tomas
(Tomas Lanik)
November 9, 2020, 6:27pm
6
Hi
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 + “/check_wmi_plus.pl” ]
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:
wmi_plus_checkdrivesize
wmi_plus_checkmem
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:
./check_wmi_plus.pl -H $HOST -u $USER -p $PASS -m checkcpu --extrawmicarg --option=“client ntlmv2 auth”=Yes
enjoy