How do I use semi-colons and ampersands in service check arguments ?
I have an HTTP check where I pass the URL and parts of the header as arguments in the service check. A semi-colon and a number of ampersands are used in these arguments. As long as I escape the semi-colon the check itself works fine.
However, when it fails I wish to echo back the actual command that was run in the output, so it's easier for an admin to troubleshoot the issue. When I run the check by hand the command displays on stdout just fine.
But when Opsview runs the check the output - which displays in the GUI under "Status Information" - is missing the ampersands and the semi-colon has been translated into a regular colon.
Can anyone help explain why this is and how I may fix it ?
Thanks very much.
I cannot provide a response because whatever I type and however I word it the response is the same:
"Your submission has triggered the spam filter and will not be accepted."
Perhaps this is a subtle hint for me to give up a write a different check :-)
Hi whiphubley -
We have introduced some spam filters on the forums after the forums were recently spammed by new account holders.
If you can email us the text that you were hoping to add to the forums, we can compare that against our filters and amend the filters as necessary.
Please email the text on this occasion to support@opsview.com
Best wishes,
Dennis Hicks
Opsview Technical Support



I think this is a 'how does the shell evaluate funny characters' question.
In Opsview, I tend to escape all "funny shell characters" with a single quote. EG, check_my_http ... --url 'http://server/show?host=h&text=show+me+the+$s'
This means that the plugin should receive the information of the whole string in an argument. This is nicer than using the \ as an escaping mechanism.
When you display your plugin args back, you can add single quotes back around the url portion, so that someone can take the output and run on the shell.
If this doesn't help, we'll need to see more information and examples.
Ton