Page 1 of 1
Escaping " issue
Posted: Wed Oct 23, 2013 2:13 pm
by BanditBBS
Ok, so I can run this from command line:
Code: Select all
./check_snmp -H 10.6.59.90 -o SNMPv2-SMI::enterprises.5528.100.4.2.10.1.7.303280526 -C xxxxxx -P 2c -l "Spot Leak" -s "\"No Leak\""
And I get this back:
But when I put that in $ARG1$ using check_snmp command, it screws up the -s part. The string actually contains double quotes. How can I put that in XI so it performs the command properly?
Re: Escaping " issue
Posted: Wed Oct 23, 2013 2:22 pm
by sreinhardt
First question, although I figured you checked this already, you're not testing this with the test command button right?
Otherwise some options I might try:
Code: Select all
./check_snmp -H 10.6.59.90 -o SNMPv2-SMI::enterprises.5528.100.4.2.10.1.7.303280526 -C xxxxxx -P 2c -l "Spot Leak" -s \"\"No Leak\"\"
Code: Select all
./check_snmp -H 10.6.59.90 -o SNMPv2-SMI::enterprises.5528.100.4.2.10.1.7.303280526 -C xxxxxx -P 2c -l "Spot Leak" -s "\\"No Leak\\""
Code: Select all
./check_snmp -H 10.6.59.90 -o SNMPv2-SMI::enterprises.5528.100.4.2.10.1.7.303280526 -C xxxxxx -P 2c -l "Spot Leak" -s \\"\\"No Leak\\"\\"
Re: Escaping " issue
Posted: Wed Oct 23, 2013 2:28 pm
by BanditBBS
I was using the test command. it works fine, disregard this entire thread
I knew test command feature had the issue it had to run as apache not as nagios, but didn't realize there was an issue with escaping.
Re: Escaping " issue
Posted: Wed Oct 23, 2013 3:09 pm
by abrist
Yep. user restriction, escaping restrictions, you name it. The test check command is really only good for those simple 'vanilla' checks. I will send this thread down the green mile . . .