Failed to open service: MSSQLMSSQLSERVER_2K12$

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
n8860104460
Posts: 32
Joined: Wed Jan 11, 2017 3:36 pm

Failed to open service: MSSQLMSSQLSERVER_2K12$

Post by n8860104460 »

Hi Team,

while configuring MSSQL$MSSQLSERVER_2K12 Serive in Nagios i am getting error "Failed to open service: MSSQLMSSQLSERVER_2K12$"

Noteable Points :

1.Command which is i am using to check service state > ./check_nrpe -H usa****** -t 30 -c CheckServiceState -a ShowAll "MSSQL"$"MSSQLSERVER_2K12"
2.while checking status form CLI (Collector server) getting service status as OK.
3.While checking status form GUI ( if check test Command ) getting output as OK.
4.But when i save that configuration and wait for latest check getting error "Failed to open service: MSSQLMSSQLSERVER_2K12$"

After few search on Exchange found that this issue is due to special character and to skip this i have already used below paramater and still i am getting ok state on Point 2 and 3 but after save the command on Point 4 Output on GUI getting same error "Failed to open service: MSSQLMSSQLSERVER_2K12$"

Tried Paramaters.

"MSSQL"$"MSSQLSERVER_2K12"
'MSSQL"$"MSSQLSERVER_2K12'
MSSQL"$"MSSQLSERVER_2K12
MSSQL\$MSSQLSERVER_2K12
MSSQL\\\$$MSSQLSERVER_2K12
MSSQL$MSSQLSERVER_2K12
MSSQL\$\MSSQLSERVER_2K12"

Output from CLI from TWO Different Commands

./check_nt -H usa**** -v SERVICESTATE -d SHOWALL -l MSSQL"$"MSSQLSERVER_2K12 -p 12489
MSSQL$MSSQLSERVER_2K12: Started

./check_nrpe -H usa****** -t 30 -c CheckServiceState -a ShowAll MSSQL"$"MSSQLSERVER_2K12
OK: MSSQL$MSSQLSERVER_2K12: running|

./check_nrpe -H usa****** -t 30 -c CheckServiceState -a ShowAll 'MSSQL$MSSQLSERVER_2K12'
OK: MSSQL$MSSQLSERVER_2K12: running|


Please Advise.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Failed to open service: MSSQLMSSQLSERVER_2K12$

Post by tgriep »

Try using the following for the service name in the command definition in XI.

Code: Select all

"MSSQL$"$"MSSQLSERVER_2K12"
I have found that escaping the $ with another $ seems to work consistently in the commands.
Be sure to check out our Knowledgebase for helpful articles and solutions!
n8860104460
Posts: 32
Joined: Wed Jan 11, 2017 3:36 pm

Re: Failed to open service: MSSQLMSSQLSERVER_2K12$

Post by n8860104460 »

I tried this parameters also but again getting same error.

Now Please see the attached error then you might be understand what actually i am trying to say.

Please follow attachment using steps.

Steps 1. CLI Output working fine with different parameters.
Steps 2. GUI Configuration working fine.
Steps 3. Output is in Error.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Failed to open service: MSSQLMSSQLSERVER_2K12$

Post by tgriep »

Try changing $ARG1$ to the following example, including the double quotes and the extra $ and see if the check functions in the GUI for you.

Code: Select all

"MSSQL$"$"MSSQLSERVER_2K12"
Be sure to check out our Knowledgebase for helpful articles and solutions!
n8860104460
Posts: 32
Joined: Wed Jan 11, 2017 3:36 pm

Re: Failed to open service: MSSQLMSSQLSERVER_2K12$

Post by n8860104460 »

Thank you for your guidance now output is coming as OK, but not able to understand one thing

while testing form Configuration panel I am getting error, and when i save same settings however output is in OK state.

Please see attached screen shot for more info.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Failed to open service: MSSQLMSSQLSERVER_2K12$

Post by tgriep »

When the Test Check button is used, it looks at the command and added extra escaping to the command if it finds special characters and sometimes it adds too much making the command fail.
Take a look in the screen shot and you will see that it added some back slashes which doubly escaped the $ causing an incorrect service name.
Be sure to check out our Knowledgebase for helpful articles and solutions!
n8860104460
Posts: 32
Joined: Wed Jan 11, 2017 3:36 pm

Re: Failed to open service: MSSQLMSSQLSERVER_2K12$

Post by n8860104460 »

Thank you so Much for your response and helping me to resolve the issue :)
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Failed to open service: MSSQLMSSQLSERVER_2K12$

Post by tgriep »

Your very welcome. I'll close and mark the post as solved. If you have any new questions in the future, feel free to open a new post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked