Problems with passing $ to plugins

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
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Problems with passing $ to plugins

Post by Fred Kroeger »

Since my upgrade to Core-4 it appears that I can no longer pass a "$" character in the community string to the check_snmp_uptinme.pl script
I used to be able to do this by using \\$$ before my upgrade to NagiosXI 2014 R1.0

If I run it from the command line it works OK
./check_snmp_uptime.pl -H 10.1.1.1 -C pas\$word

I have updated the $ARG1$ variable now to pas$word as the Nagios service command appears to actually add a backslash now when I run the Test Check Command
COMMAND:check_snmp_uptime.pl -H 10.1.1.1 -C pas\$word
OUTPUT:

I have now tried all sorts of combinations of \ , \\ , $ and $$ to no avail.

regards... Fred
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problems with passing $ to plugins

Post by scottwilkerson »

The $ is for sure special and does require special escaping in the CCM, see:
http://support.nagios.com/wiki/index.ph ... ck_Command

I do want to point out one other thing. The "Test Command" button in the CCM works great for most items as a quick and dirty test to see if the command is formatted correctly, but it is not possible for us to make it work with special side cases like having $ in the$ARGn$ fields, even though Nagios Core may execute them correctly.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Problems with passing $ to plugins

Post by Fred Kroeger »

Thanks Scott
Thanks for the tip about the Test Command. Now I understand why my results weren't consistent.
I gave up in the end and took the easy option - I got the Network Team to remove the $ from their community string.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Problems with passing $ to plugins

Post by tmcdonald »

Closing thread.
Former Nagios employee
Locked