Page 1 of 1

Commands Syntax Help

Posted: Fri Mar 07, 2014 10:12 am
by technick
I'm having some issues implementing a check_graphite plugin.

I have defined this in my commands file.

Code: Select all

define command {
       command_name                             check_graphite
       command_line                             $USER1$/check_graphite -u $ARG1$ -w $ARG2$ -c $ARG3$ -f $ARG3$
}
I'm trying to execute this against a url like this

Code: Select all

http://metrics.lan.infinitedatastream.net/render/?target=sumSeries(app.tusko.tusko_custom_parser.jmpt_loader.*)&from=-28hours&format=json
When I run the test check command, this is the output.

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_graphite -u \"http://metrics.lan.infinitedatastream.net/render/\?target=sumSeries\(app.tusko.tusko_custom_parser.jmpt_loader.\*\) -w 1500:6000 -c 1000:8000 -f last
OUTPUT: 
I've tried escaping the & where it stops processing the URL, no luck. I've tried single / double quotes around the $ARG1% in the command.cfg and when defining the service check.

Running this manually against the command line works fine.

Code: Select all

[root@nagman libexec]# /usr/local/nagios/libexec/check_graphite -u "http://metrics.lan.infinitedatastream.net/render/?target=sumSeries(app.tusko.tusko_custom_parser.jmpt_loader.*)&from=-28hours&format=json" -w 1500:6000 -c 1000:8000 -f last
check_graphite WARNING: last 6156.0 outside threshold (1500.0,6000.0) for URL: http://metrics.lan.infinitedatastream.net/render/?target=sumSeries(app.tusko.tusko_custom_parser.jmpt_loader.*)&from=-28hours&format=json
What am I doing wrong?

Thanks in advance =)

EDIT: Had to update the post and properly classify some lines as CODE because of literal http interpretations on the forum software.

Re: Commands Syntax Help

Posted: Fri Mar 07, 2014 11:22 am
by abrist
My first suggestion would be to ignore the "test check command" feature with this command as the escaping added by the web ui may not be helping the problem. If you configure the check and just allow nagios to run the check as it normally would, do you get any output? If so, what?

Re: Commands Syntax Help

Posted: Fri Mar 07, 2014 2:34 pm
by technick
abrist wrote:My first suggestion would be to ignore the "test check command" feature with this command as the escaping added by the web ui may not be helping the problem. If you configure the check and just allow nagios to run the check as it normally would, do you get any output? If so, what?
You Sir, are a freaking genius!

So the test check command fubars it but it still works overall.

Many thanks =)

Re: Commands Syntax Help

Posted: Fri Mar 07, 2014 2:37 pm
by sreinhardt
Glad to hear its working, good old test check command.