Page 1 of 1

Characters

Posted: Wed Mar 11, 2015 2:06 pm
by emartine
When I run this command over the nagios server command line it runs fine.

/usr/local/nagios/libexec/check_nrpe -H printerservername -c CheckCounter -a '\Print Queue(printqueue)\Jobs' MaxWarn=4 MaxCrit=6
OK all counters within bounds.|'\Print Queue(printqueue)\Jobs'=0;4;6


Doing this in the Web interface as a test where

$USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckCounter -a $ARG1$ MaxWarn=$ARG2$ MaxCrit=$ARG3$

I get:

COMMAND: /usr/local/nagios/libexec/check_nrpe -H printerservername -c CheckCounter -a '\\Print Queue\(printqueue\)\\Jobs' MaxWarn=4 MaxCrit=6
OUTPUT: CRIT: Counter not found: \\Print Queue\(printqueue\)\\Jobs: Unable to connect to the specified computer or the computer is offline. (800007D0)


Why are the extra \ added? Is this something that should have had a fix?

What would be the correct way to implement the first argument? --> '\Print Queue(printqueue)\Jobs'

Re: Characters

Posted: Wed Mar 11, 2015 2:12 pm
by tmcdonald
The Test Check Command button is notorious for escaping characters. The true test is to save the check and let it run naturally.

Re: Characters

Posted: Wed Mar 11, 2015 3:08 pm
by emartine
Feature request?

Re: Characters

Posted: Wed Mar 11, 2015 3:12 pm
by tmcdonald
It's a limitation of PHP somewhat and permissions (apache user vs nagios). We're well-aware of the issue and have discussed various mitigations in the past. If anything, a message box mentioning the escaping issues could be added, but for the time-being it's probably not going to change functionally.

Re: Characters

Posted: Wed Mar 11, 2015 3:16 pm
by jdalrymple
emartine - I'd more call it a bug and suggest that you report it at our bug tracker:

http://tracker.nagios.com

That said tmcdonald is right - the Test Check feature is a serious convenience when it works, but unfortunately I wouldn't ever trust it's output - even if it was proper. To run a command properly as the nagios user from the nagios user's environment would put way too much potential for destructive and malicious code to be executed. There is no doubt some repairs that could be made - that escaping is truly unnecessary. Don't ever count on the output from that convenience feature over the command line output though.

Re: Characters

Posted: Thu Mar 12, 2015 1:40 am
by Box293
jdalrymple wrote:emartine - I'd more call it a bug and suggest that you report it at our bug tracker:

http://tracker.nagios.com
Add your comments to this bug I created about the Test Check Command button a while ago:

http://tracker.nagios.com/view.php?id=679

Re: Characters

Posted: Wed Apr 08, 2015 10:43 am
by emartine
Thanks tmcdonald and jdalrymple

I definitely run them on the command line but some of my colleagues of the Windows only world who use the interface:

1) Aren't command line gurus and prefer GUI over the command line. In their words "this is what we paid for" with XI.

2) Because they aren't unix savvy I don't give them access to the server itself. This will happen when hell freezes over unless I want to spend days restoring and reconfiguring for fun.

3) They swear up and down that this is something that is very easy to fix and shouldn't have been a problem.


Box293,

Thanks. I will post.

Re: Characters

Posted: Wed Apr 08, 2015 11:02 am
by cmerchant
Thanks for the feedback emartine, can I close this thread for you?

Also, when you post to our bug tracker, please reference this thread/URL. Thanks.

Re: Characters

Posted: Wed Apr 08, 2015 11:05 am
by emartine
Yes. Thank you.