<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>RE: [Nagios-users] check_command in Nagios 2 no longer allows "Raw" Command Line??</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>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.<BR>
<BR>
Wonderful, Thanks Millions!<BR>
<BR>
-JG<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: nagios-users-admin@lists.sourceforge.net on behalf of Andreas Ericsson<BR>
Sent: Thu 2/17/2005 12:28 AM<BR>
To: nagios-users@lists.sourceforge.net<BR>
Subject: Re: [Nagios-users] check_command in Nagios 2 no longer allows "Raw" Command Line??<BR>
<BR>
Jon Gefaell wrote:<BR>
> I'm working to try to port my existing nagios system(s) to nagios V.2.<BR>
><BR>
> I'm well along and iteratively addressing problems a nagios -v<BR>
> nagios.cfg complains about.<BR>
><BR>
> I've found a very painful difference, option 3.) "Raw" Command Line is<BR>
> no longer available!<BR>
><BR>
> So, I've got a thousand (or so) http checks which all use this method.<BR>
> Different parameters are required for each check command. Using this<BR>
> option has allowed me to create simple definitions for these commands.<BR>
><BR>
> Doing it the 'new'(?) way would require me to come up with a unique and<BR>
> descriptive label for each (of over 1,000) service, then chain those to<BR>
> the checkcommands.cfg with a unique stanza for each one!<BR>
><BR>
> That's .... Well I don't want to contemplate it. Not only is the<BR>
> existing conversion tremenedously difficut, but adding services is<BR>
> daunting as well. Is there something I'm missing?<BR>
><BR>
<BR>
Probably. Are you aware of the fact that you can pass an arbitrary<BR>
amount of parameters to a single check_command simply by omitting the<BR>
separating !.<BR>
<BR>
A "raw" command line would then look as such;<BR>
check_http_raw!--ssl --url=/some-url --port=8080<BR>
<BR>
With a command definition of;<BR>
define command {<BR>
        command_name check_http_raw<BR>
        command_line check_http -H $HOSTADDRESS$ $ARG1$<BR>
}<BR>
<BR>
<BR>
To quickly change it, I would suggest using something along these lines;<BR>
sed -i 's/\(check_command[\t<BR>
]*\)"check_http\([^"]*\)"/\1check_http_raw\2/ services.cfg<BR>
Mind the linebreaks, and make sure you make a backup. I haven't tested<BR>
the above line.<BR>
<BR>
> Thanks so much!<BR>
><BR>
<BR>
You're welcome.<BR>
<BR>
> -JG<BR>
><BR>
><BR>
> -------------------------------------------------------<BR>
> SF email is sponsored by - The IT Product Guide<BR>
> Read honest & candid reviews on hundreds of IT Products from real users.<BR>
> Discover which products truly live up to the hype. Start reading now.<BR>
> <A HREF="http://ads.osdn.com/?ad_ide95&alloc_id">http://ads.osdn.com/?ad_ide95&alloc_id</A>396&op=click<BR>
> _______________________________________________<BR>
> Nagios-users mailing list<BR>
> Nagios-users@lists.sourceforge.net<BR>
> <A HREF="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</A><BR>
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<BR>
> ::: Messages without supporting info will risk being sent to /dev/null<BR>
><BR>
<BR>
--<BR>
Andreas Ericsson                   andreas.ericsson@op5.se<BR>
OP5 AB                             www.op5.se<BR>
Lead Developer<BR>
<BR>
<BR>
-------------------------------------------------------<BR>
SF email is sponsored by - The IT Product Guide<BR>
Read honest & candid reviews on hundreds of IT Products from real users.<BR>
Discover which products truly live up to the hype. Start reading now.<BR>
<A HREF="http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click">http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click</A><BR>
_______________________________________________<BR>
Nagios-users mailing list<BR>
Nagios-users@lists.sourceforge.net<BR>
<A HREF="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</A><BR>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<BR>
::: Messages without supporting info will risk being sent to /dev/null<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>