Default argument values for nagios check commands
Jochen Bern
Jochen.Bern at LINworks.de
Thu Nov 4 18:19:17 CET 2010
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
------------------------------------------------------------------------------
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
More information about the Developers
mailing list