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
Illegal $ in service description
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Illegal $ in service description
For each $ what you actually need is
so something like this would be correct if your command was what you were looking for.
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
\$$
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
}
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
}
Re: Illegal $ in service description
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
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
Re: Illegal $ in service description
Try escaping the dollar like the example below and see if that works for you.
service_description MySQL Table Check - sys.x$"$"host_summary
service_description MySQL Table Check - sys.x$"$"host_summary
Be sure to check out our Knowledgebase for helpful articles and solutions!