check_command in Nagios 2 no longer allows "Raw" Command Line??

Jon Gefaell jgefaell at netblue.com
Sat Feb 19 03:11:59 CET 2005


I can't thank you enough Andreas for your rapid response. I wasn't aware that I could pass all the arguments that easily. Your offhand example was close to perfect. I had to add the bang (!) after _raw and I use an absolute path to the binaries so I had to change the sed line just a tad. This technique made for a very quick conversion of my http, smtp and other check commands using the previous method.

Wonderful, Thanks Millions!

-JG



-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net on behalf of Andreas Ericsson
Sent: Thu 2/17/2005 12:28 AM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] check_command in Nagios 2 no longer allows "Raw" Command Line??
 
Jon Gefaell wrote:
> I'm working to try to port my existing nagios system(s) to nagios V.2.
> 
> I'm well along and iteratively addressing problems a nagios -v
> nagios.cfg complains about.
> 
> I've found a very painful difference, option 3.) "Raw" Command Line is
> no longer available!
> 
> So, I've got a thousand (or so) http checks which all use this method.
> Different parameters are required for each check command. Using this
> option has allowed me to create simple definitions for these commands.
> 
> Doing it the 'new'(?) way would require me to come up with a unique and
> descriptive label for each (of over 1,000) service, then chain those to
> the checkcommands.cfg with a unique stanza for each one!
> 
> That's .... Well I don't want to contemplate it. Not only is the
> existing conversion tremenedously difficut, but adding services is
> daunting as well. Is there something I'm missing?
> 

Probably. Are you aware of the fact that you can pass an arbitrary 
amount of parameters to a single check_command simply by omitting the 
separating !.

A "raw" command line would then look as such;
check_http_raw!--ssl --url=/some-url --port=8080

With a command definition of;
define command {
	command_name check_http_raw
	command_line check_http -H $HOSTADDRESS$ $ARG1$
}


To quickly change it, I would suggest using something along these lines;
sed -i 's/\(check_command[\t 
]*\)"check_http\([^"]*\)"/\1check_http_raw\2/ services.cfg
Mind the linebreaks, and make sure you make a backup. I haven't tested 
the above line.

> Thanks so much!
> 

You're welcome.

> -JG
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050218/244f9314/attachment.html>


More information about the Users mailing list