Default argument values for nagios check commands

Bostjan Skufca bostjan at a2o.si
Fri Nov 5 01:23:16 CET 2010


Tricky, interesting idea.

Now, how about doing it for real? This solution isn't really CPU friendly
(process spawning, as you have said). Is the idea of default argument values
OK? Or are there any design decisions involved that I am not aware of (yet)?

Again, many thanks for suggestion!
b.



On 4 November 2010 18:19, Jochen Bern <Jochen.Bern at linworks.de> wrote:

> On 11/04/2010 03:50 PM, Bostjan Skufca wrote:
> > I was wondering if it is possible (or would be easy to implement) default
> > values for nagios check commands.
>
> Well, if you don't mind the extra subshells, it's already "implemented":
>
>
> # tail -22 commands-misc.cfg
> define command{
>        command_name    check_defaults
>        command_line    echo "OK - value A is `echo $ARG1$ 2000 | awk '{
> print $$1 }'`, value B is `echo $ARG2$ 5000 | awk '{ print $$1 }'`"
>        }
> define service {
>        use                     generic-service
>        host_name               Nagios
>        service_description     Defaults - 0
>        check_command           check_defaults
>        }
> define service {
>        use                     generic-service
>        host_name               Nagios
>        service_description     Defaults - 1
>        check_command           check_defaults!foo
>        }
> define service {
>        use                     generic-service
>        host_name               Nagios
>        service_description     Defaults - 2
>        check_command           check_defaults!foo!bar
>        }
>
>
>
> # grep value ../../var/spool/status.dat
>        plugin_output=OK - value A is 2000, value B is 5000
>        plugin_output=OK - value A is foo, value B is 5000
>        plugin_output=OK - value A is foo, value B is bar
>
>
> Kind regards,
>                                                                J. Bern
> --
> Jochen Bern, Systemingenieur --- LINworks GmbH <http://www.LINworks.de/>
> Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
> PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
> Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
> Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20101105/8914c116/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list