Illegal $ in service description

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Illegal $ in service description

Postby cbbs70a » Wed Sep 13, 2017 12:22 pm

All;
I am using Nagios 4.3.4 and came across a problem where I have an illegal dollar sign in my service_description like so:

define service {
use databases-table-check-passive
host_name ubuntu.voipbiz.org
service_description MySQL Table Check - sys.x$host_summary
contact_groups voipbiz.org-admins
servicegroups databases
event_handler mysql_repair_table!$SERVICESTATE$SERVICESTATETYPE$SERVICEATTEMPT$!DBTABLE
}

I thought that I could simply escape the dollar sign by prepending a \$ or a \\$ to the original $ but that doesn't appear to be the case. What am I missing?
Thanks;
Frank
cbbs70a
 
Posts: 10
Joined: Sat May 17, 2014 10:26 am

Re: Illegal $ in service description

Postby scottwilkerson » Wed Sep 13, 2017 1:41 pm

For each $ what you actually need is
Code: Select all
\$$


so something like this would be correct if your command was what you were looking for.
Code: Select all
define service {
use databases-table-check-passive
host_name ubuntu.voipbiz.org
service_description MySQL Table Check - sys.x\$$host_summary
contact_groups voipbiz.org-admins
servicegroups databases
event_handler mysql_repair_table!\$$SERVICESTATE\$$SERVICESTATETYPE\$$SERVICEATTEMPT\$$!DBTABLE
}


However if you are actually trying to pass these macros you were already missing the ending $ on several macros, so I am guessing you need something close to this
Code: Select all
define service {
use databases-table-check-passive
host_name ubuntu.voipbiz.org
service_description MySQL Table Check - sys.x\$$host_summary
contact_groups voipbiz.org-admins
servicegroups databases
event_handler mysql_repair_table!\$$SERVICESTATE\$$\$$SERVICESTATETYPE\$$\$$SERVICEATTEMPT\$$!DBTABLE
}
User avatar
scottwilkerson
CTO
 
Posts: 7620
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Illegal $ in service description

Postby cbbs70a » Fri Sep 15, 2017 10:55 am

Thanks for the quick response. Now, the line that you posted for the service_description was what I thought also, but that didn't solve it.

service_description MySQL Table Check - sys.x\$$host_summary


and the event_handler line worked fine. I'm pretty much stomped on this one.
Thanks Again;
Frank
cbbs70a
 
Posts: 10
Joined: Sat May 17, 2014 10:26 am

Re: Illegal $ in service description

Postby tgriep » Fri Sep 15, 2017 2:17 pm

Try escaping the dollar like the example below and see if that works for you.
service_description MySQL Table Check - sys.x$"$"host_summary
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 6019
Joined: Thu Oct 30, 2014 9:02 am


Return to Nagios Core

Who is online

Users browsing this forum: Google [Bot] and 6 guests