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'
Characters
Re: Characters
The Test Check Command button is notorious for escaping characters. The true test is to save the check and let it run naturally.
Former Nagios employee
Re: Characters
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.
Former Nagios employee
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Characters
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.
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.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Characters
Add your comments to this bug I created about the Test Check Command button a while ago:jdalrymple wrote:emartine - I'd more call it a bug and suggest that you report it at our bug tracker:
http://tracker.nagios.com
http://tracker.nagios.com/view.php?id=679
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Characters
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.
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
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.
Also, when you post to our bug tracker, please reference this thread/URL. Thanks.