I'm attempting to store my WMI login information in $USERn$ variables so they can be easily changed globally. It doesn't seem to be working properly as (more likely I'm just not configuring properly) as the variables are not being replaced. I am using the Nagios XI VM during the full feature evaluation phase.
Nagios.cfg:
Code: Select all
...
resource_file=/usr/local/nagios/etc/resource.cfg
...
Code: Select all
# Path to the plugins
$USER3$=domain\\user
$USER4$=pass\&word
$USER1$=/usr/local/nagios/libexec
# Path to event handlers
#$USER2$=/usr/local/nagios/libexec/eventhandlers
# Port for NSClient++
$USER7$=12489
# Password for NSClient++
$USER8$=secret
Code: Select all
...
define command {
command_name check_wmi_cpu_usage
command_line $USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -m checkcpu -u $USER3$ -p $USER4$ -w $ARG1$ -c $ARG2$ $ARG3$
}
...
Code: Select all
COMMAND: /usr/local/nagios/libexec/check_wmi_plus.pl -H REMOVEDHOSTNAME -m checkcpu -u $USER3$ -p $USER4$ -w 50 -c 75
OUTPUT: UNKNOWN - The WMI query had problems. You might have your username/password wrong or the user's access level is too low. Wmic error text on the next line.
[librpc/rpc/dcerpc_util.c:1290:dcerpc_pipe_auth_recv()] Failed to bind to uuid 4d9f4ab8-7d1c-11cf-861e-0020af6e7c57 - NT_STATUS_NET_WRITE_FAULT
[librpc/rpc/dcerpc_connect.c:790:dcerpc_pipe_connect_b_recv()] failed NT status (c0000022) in dcerpc_pipe_connect_b_recv
[wmi/wmic.c:196:main()] ERROR: Login to remote object.
NTSTATUS: NT_STATUS_ACCESS_DENIED - Access denied
I've turned on debug logging and can tell it replaces them correctly as host checks, but doesn't say anything when marked as a service check. Not sure how to proceed.
What gives? Am I doing something wrong here? It there a different way I should be doing this? I tried setting the username and password as host variables in my "Generic Host" Host Template. This seemed to sort of work but was flakey and unreliable due to the slashes in the username (for the domain) and escape slashes for special characters in the password.
Any suggestions. We're definitely grateful for anything you could send our way!
Thank you for your time,
Smark