Illegal $ in service description

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
cbbs70a
Posts: 11
Joined: Sat May 17, 2014 10:26 am

Illegal $ in service description

Post by cbbs70a »

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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Illegal $ in service description

Post by scottwilkerson »

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
}
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
cbbs70a
Posts: 11
Joined: Sat May 17, 2014 10:26 am

Re: Illegal $ in service description

Post by cbbs70a »

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
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Illegal $ in service description

Post by tgriep »

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!
Locked