Exploding check commands batman ...

Andreas Ericsson ae at op5.se
Fri Jul 1 14:59:34 CEST 2005


Paul L. Allen wrote:
> Gavin Carr writes:
> 
>> Is this the way other people are doing it, or am I missing something 
>> obvious? Is this handled any differently in version 2.0? 
> 
> 
> There are several ways of doing it, but they're all rather clunky (IMHO).
> I'd like to see something along the lines of:
> $USER1$/check_http ... $CONDARG4${-p $ARG4$}
> along with the ability to have null arguments as in:
>   check_http!a!b!c!!e
> so that if the fourth argument is omitted then the "-p $ARG4$" is
> dropped and you get the default http port whereas if you want a different
> port then check_http!a!b!c!3192!e.


I'm working on overloading the plugins a bit to support behaviour like 
this. It will require the arguments in the check_command definition to 
be enclosed in quotes (due to how POSIX getopt() works), but will 
otherwise work nicely.


> That still means a lot of extra stuff in your service checks.  So maybe
> a better approach would be to allow argument over-riding.  Your template
> would then have check_http!a!b!c!d!e where you specify all options
> giving them their default values but in the specific service checks you
> could have "command_arg4 3192".
> I expect somebody can think of reasons why neither of the above could be
> implemented and somebody else (or maybe the same person) can think of
> a far better way of doing it.  I'm not attached to either of those
> approaches, they are just first thoughts - if somebody has a better way
> of doing it then that's great.  I'm not holding my breath though - if it
> were a popular request and easy to implement then it would have gone into
> Nagios ages ago.

I believe it's best left out of Nagios. String mangling is rather 
expensive and error-prone. Checking if(str[0] == 0) from the command 
executed is a fairly simple process.

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


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&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





More information about the Users mailing list