Page 1 of 1

How do I escape $ sign in nsclient++ nrpe check commands

Posted: Tue Oct 20, 2015 11:54 am
by mcconvta
In Nagios XI - How do I escape the $ sign in nsclient++ nrpe check commands.

For example

check_drivesize drive=* "top-syntax=${status} : ${list}" "detail-syntax=%(drive_or_name) free - %(free_pct)"

Re: How do I escape $ sign in nsclient++ nrpe check commands

Posted: Tue Oct 20, 2015 4:11 pm
by tmcdonald
Try any of the following:
  • check_drivesize drive=* 'top-syntax=${status} : ${list}' "detail-syntax=%(drive_or_name) free - %(free_pct)" (single quotes instead of double)
  • check_drivesize drive=* "top-syntax=$${status} : $${list}" "detail-syntax=%(drive_or_name) free - %(free_pct)" (escape a dollar sign with itself)
  • check_drivesize drive=* "top-syntax=\${status} : \${list}" "detail-syntax=%(drive_or_name) free - %(free_pct)" (escape a dollar sign with a backslash)
One should definitely work, otherwise let us know!

Re: How do I escape $ sign in nsclient++ nrpe check commands

Posted: Fri Oct 23, 2015 4:43 am
by mcconvta
Thanks you very much escaping the $ with the backslash worked the best.

Re: How do I escape $ sign in nsclient++ nrpe check commands

Posted: Fri Oct 23, 2015 10:12 am
by rkennedy
Glad to see this worked out for you. I'll be locking this thread now, but feel free to open another thread if you need assistance.