Page 1 of 2
Wrong Service is showing up
Posted: Tue Jan 22, 2019 1:42 pm
by ZebMatthias
Hello ,
I'm currently using the Trial version of Nagios for testing but i'm facing a problem when checking a service.
Version of Nagios : 5.5.8
Service we are looking for : MicrosoftDynamicsNavServer$NAS and MicrosoftDynamicsNavServer$POSDB = Service name
the wizard we are using : wmi
code : check_xi_service_wmiplus!'user'!'password'!checkservice!'MicrosoftDynamicsNavServer$NAS'!!!!
result : OK - Found 1 Services(s), 1 OK and 0 with problems (0 excluded). 'TCP/IP NetBIOS Helper' (lmhosts) is Running.
We don't receive any error but we get another service as result ( see above )
printscreens in attachment of the settings and result.
nagios result.PNG
nagios settings.PNG
Thx for the help,
greetings,
Matthias
Re: Wrong Service is showing up
Posted: Tue Jan 22, 2019 5:32 pm
by npolovenko
Hello,
@ZebMatthias. $ is a reserved application character in Nagios. Let's try running the command with arguments from the ssh terminal:
/usr/local/nagios/libexec/check_wmi_plus.pl -H $HOSTADDRESS$ -u 'user' -p 'password' -m checkservice 'MicrosoftDynamicsNavServer$NAS'
Please replace $HOSTADDRESS$ with the hostaddress, also replace user and password with the actual credentials and run the command.
Re: Wrong Service is showing up
Posted: Wed Jan 23, 2019 4:55 am
by ZebMatthias
Hello ,
Like you see in attachment in my previos mail -> hostadress is filled and user and password
See attachment
Nagios command.PNG
greetings,
Matthias Deruyver
Re: Wrong Service is showing up
Posted: Wed Jan 23, 2019 3:51 pm
by lmiltchev
What is the version of the check_wmi_plus.pl plugin that you are currently using?
Code: Select all
grep '$VERSION=' /usr/local/nagios/libexec/check_wmi_plus.pl
Log into the Windows server, start a CMD prompt as administrator, run the following command and show the output:
Code: Select all
wmic service get name, displayname | findstr "MicrosoftDynamicsNavServer"
Re: Wrong Service is showing up
Posted: Thu Jan 24, 2019 4:22 am
by ZebMatthias
Version of the wmy plugin : 1.64
The result of the connection with windows server :
print wmic cmd.PNG
Re: Wrong Service is showing up
Posted: Thu Jan 24, 2019 11:16 am
by lmiltchev
It is very strange that a wrong service is showing up. The service display name is exactly what you are using in your check. Most probably, the check fails because of the dollar sign in the name. Try escaping it by using
'MicrosoftDynamicsNavServer\$NAS' or
'MicrosoftDynamicsNavServer\$$NAS'. You can try using double quotes, instead of single quotes as well -
"MicrosoftDynamicsNavServer\$NAS" or
"MicrosoftDynamicsNavServer\$$NAS".
Do you get the correct service if you use the actual name instead of the display name?
Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H $HOSTADDRESS$ -u 'user' -p 'password' -m checkservice 'Microsoft Dynamics NAV Server [NAS]'
or
Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H $HOSTADDRESS$ -u 'user' -p 'password' -m checkservice "Microsoft Dynamics NAV Server \[NAS\]"
Re: Wrong Service is showing up
Posted: Thu Jan 24, 2019 1:49 pm
by ZebMatthias
I have tried every combo possible : 'MicrosoftDynamicsNavServer\$NAS' , 'MicrosoftDynamicsNavServer\$$NAS' , "MicrosoftDynamicsNavServer\$NAS" and "MicrosoftDynamicsNavServer\$$NAS". also with the display name "Microsoft Dynamics NAV Server \[NAS\]" and 'Microsoft Dynamics NAV Server [NAS]' . but still showing the wrong service : 'TCP/IP NetBIOS Helper'
see attachments
nagios nas 1.PNG
nagios nas 2.PNG
nagios nas 3.PNG
Re: Wrong Service is showing up
Posted: Thu Jan 24, 2019 1:51 pm
by ZebMatthias
nagios nas 4.PNG
nagios nas 5.PNG
nagios nas 6.PNG
Re: Wrong Service is showing up
Posted: Fri Jan 25, 2019 9:47 am
by tgriep
When a name has a $ in it, is sometimes has to be escaped differently then the standard escaping. Try using this for the option.
Code: Select all
"MicrosoftDynamicsNavServer$"$"NAS"
Re: Wrong Service is showing up
Posted: Sat Jan 26, 2019 5:41 am
by ZebMatthias
i have uses another command to show all services and there i see all the servcies running even the Microsnosftnav - see screenshot.
print nagios 1.PNG
When checking for antoher service, without $ in the name - i still only get netbios helper as result .
print nagios 2.PNG