Page 1 of 1

what instead of semicolon in check output?

Posted: Thu Nov 15, 2012 12:57 pm
by ardin
Hi,

My check return something like:

<a href="#" onclick="javascript: var one; command one; command two; command three; function f_one(one); return true">link</a>

But nagios change semicolon with colon. What can I do? (idea with bracket falls).

Best regards!
Tom

Re: what instead of semicolon in check output?

Posted: Thu Nov 15, 2012 3:52 pm
by slansing
Are you using a custom made check or one you found and are trying to use, can you provide an example? If you could just elaborate a little bit, the information the check is returning is being changed from what you think it should be?

Re: what instead of semicolon in check output?

Posted: Thu Nov 15, 2012 4:17 pm
by agriffin
This is expected behavior but I'm not sure what the rationale for it is. I've asked a Nagios developer why it does that and I'll let you know when he gets back to me.

Re: what instead of semicolon in check output?

Posted: Thu Nov 15, 2012 7:29 pm
by ardin
slansing wrote:Are you using a custom made check or one you found and are trying to use, can you provide an example? If you could just elaborate a little bit, the information the check is returning is being changed from what you think it should be?
This is my check. I want use javascript in output. For example (from head) if my check return:

<a href="#" onclick="javascript: alert(1); alert(2); ">test</a>

Nagios will change semicolon in source code with colon like:

<a href="#" onclick="javascript: alert(1): alert(2): ">test</a>

After that, browser can't interpreting JS language.

Regards

Re: what instead of semicolon in check output?

Posted: Fri Nov 16, 2012 10:46 am
by agriffin
Here's what I learned: Apparently semicolons are taken as an indicator of perfdata, so they're not allowed in normal plugin output. I think this means you won't be able to embed javascript in your results.