Page 1 of 1

Problems with passing $ to plugins

Posted: Tue Jun 03, 2014 3:31 am
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

Re: Problems with passing $ to plugins

Posted: Tue Jun 03, 2014 12:59 pm
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.

Re: Problems with passing $ to plugins

Posted: Tue Jun 10, 2014 8:27 pm
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.

Re: Problems with passing $ to plugins

Posted: Wed Jun 11, 2014 9:04 am
by tmcdonald
Closing thread.