Dollar sign in service

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Dollar sign in service

Post by BanditBBS »

Ok, trying to figure this out for XI: http://support.nagios.com/knowledgebase ... wdesc=true

What is the proper escaping I need to do if I want this in ARG2?

Code: Select all

-a ShowAll MSSQL$FENEVISION SQLAgent$FENEVISION ReportServer$FENEVISION
No matter how I try and escape that dollar sign I keep getting errors in XI after the check is run :(
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Dollar sign in service

Post by abrist »

Try:

Code: Select all

-a ShowAll MSSQL\$FENEVISION SQLAgent\$FENEVISION ReportServer\$FENEVISION
Or:

Code: Select all

-a ShowAll MSSQL\$$FENEVISION SQLAgent\$$FENEVISION ReportServer\$$FENEVISION
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Dollar sign in service

Post by BanditBBS »

I tried both of those and also \\$$
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Dollar sign in service

Post by abrist »

What type of errors are you getting?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Dollar sign in service

Post by BanditBBS »

Ok, so I forgot this is one of my nested checks...so check this information out:

Service definition:

Code: Select all

define service {
        host_name                       simw-nh-pkbsql09
        service_description             FENEVISION - SQL Services
        use                             simw_nh_generic-service-5
        check_command                   check_nrpe_nested!CheckServiceState!-a ShowAll 'MSSQL\$FENEVISION' 'SQLAgent\$FENEVISION' 'ReportServer\$FENEVISION'!!!!!!172.30.0.44
        check_period                    xi_timeperiod_24x7
        notification_interval           0
        notification_period             xi_timeperiod_24x7
        register                        1
        }

Works fine from command line:

Code: Select all

/usr/local/nagios/libexec/check_by_ssh -H 172.30.0.44 -q -t 180  -C "/usr/local/nagios/libexec/check_nrpe -H 172.30.0.151 -t 180 -c CheckServiceState -a ShowAll 'MSSQL\$FENEVISION' 'SQLAgent\$FENEVISION' 'ReportServer\$FENEVISION'"
OK: MSSQL$FENEVISION: started, SQLAgent$FENEVISION: started, ReportServer$FENEVISION: started
Check this error in nagios though, adds extra $ to the end...

Code: Select all

CRITICAL: MSSQL$FENEVISION: started, SQLAgent$FENEVISION: started, ReportServer$FENEVISION$: not found (critical)
Here is the command:

Code: Select all

command_name                                 check_nrpe_nested
command_line                                 $USER1$/check_by_ssh -H $ARG8$ -q -t 180 $ARG7$ -C "$USER1$/check_nrpe -H $HOSTADDRESS$ -t 180 -c $ARG1$ $ARG2$"
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Dollar sign in service

Post by jkinning »

I ran across the wiki today for a different issue and on that site it says:

Code: Select all

For Nagios 3, add two backslashes and a second dollar (\$) symbol, like this: 
check_command check_command
check_nt!SERVICESTATE!-d SHOWALL -l MSSQL\\$$INSTANCE
http://support.nagios.com/wiki/index.php/Nagios_XI:FAQs
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Dollar sign in service

Post by lmiltchev »

Try the following - go to Home->Service Detail->FENEVISION - SQL Services->Configure->Re-configure this service->and test using only one of the services in the "Monitor the service with this command" field, for example "MSSQL$FENEVISION". Don't escape the "$", try wrapping the service name in single or double quotes. Click on "Update" and schedule a forced immediate check.
Did this work? If it did, try using all three services ('MSSQL$FENEVISION' 'SQLAgent$FENEVISION' 'ReportServer$FENEVISION')
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Dollar sign in service

Post by BanditBBS »

Ludmil,

The only option that came close to working was the one I had posted earlier. When knocking it down to just one of the servicenames it added the extra $ to the end of it...not sure whats going on...but because this is just one check on one server, I'm going to cheat and call a bash script that had the check hard coded in it :)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Dollar sign in service

Post by lmiltchev »

Whatever works. :) Sometimes dealing with escaping issues could be frustrating. Can we lock this one?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Dollar sign in service

Post by BanditBBS »

lmiltchev wrote:Whatever works. :) Sometimes dealing with escaping issues could be frustrating. Can we lock this one?
Yes sir
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked