Commands Syntax Help

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
technick
Posts: 49
Joined: Tue Feb 04, 2014 10:30 am
Location: Denver, CO

Commands Syntax Help

Post 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.
----------------------
Nagios Jedi in training.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Commands Syntax Help

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
technick
Posts: 49
Joined: Tue Feb 04, 2014 10:30 am
Location: Denver, CO

Re: Commands Syntax Help

Post 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 =)
----------------------
Nagios Jedi in training.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Commands Syntax Help

Post by sreinhardt »

Glad to hear its working, good old test check command.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked