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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mcconvta
Posts: 6
Joined: Tue May 27, 2014 11:56 am

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

Post 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)"
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post 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!
Former Nagios employee
mcconvta
Posts: 6
Joined: Tue May 27, 2014 11:56 am

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

Post by mcconvta »

Thanks you very much escaping the $ with the backslash worked the best.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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.
Former Nagios Employee
Locked