Page 1 of 1

commands definition

Posted: Thu Dec 19, 2013 1:55 pm
by vinothsethuram
Can we have two commandline inside command definition?

define command {
command_name RESET

command_line ....
command_line......
}

Re: commands definition

Posted: Thu Dec 19, 2013 5:25 pm
by slansing
I've not tested this, and it is not mentioned in the Nagios Object Definitions. I'm not sure what purpose it would serve, why would you be wanting to do this in practice?

Re: commands definition

Posted: Fri Dec 20, 2013 7:52 am
by vinothsethuram
I want to execute two http request one followed by another.

Re: commands definition

Posted: Fri Dec 20, 2013 10:09 am
by tmcdonald
This cannot be done the way you are thinking. I have not tested it, but I believe whatever is the last command_line entry will be used.

If you want to make multiple checks and base the results off of that, you can use the webinject check which will simulate a series of actions on a website. Or you can write a wrapper script that Nagios calls which in turn calls check_http twice and does some logic based on the results.