what instead of semicolon in check output?

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
ardin
Posts: 2
Joined: Thu Nov 15, 2012 12:38 pm

what instead of semicolon in check output?

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: what instead of semicolon in check output?

Post 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?
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: what instead of semicolon in check output?

Post 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.
ardin
Posts: 2
Joined: Thu Nov 15, 2012 12:38 pm

Re: what instead of semicolon in check output?

Post 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
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: what instead of semicolon in check output?

Post 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.
Locked