commands definition

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

commands definition

Post by vinothsethuram »

Can we have two commandline inside command definition?

define command {
command_name RESET

command_line ....
command_line......
}
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: commands definition

Post 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?
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Re: commands definition

Post by vinothsethuram »

I want to execute two http request one followed by another.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: commands definition

Post 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.
Former Nagios employee
Locked