diff --git a/contrib/config/gen_simple_dummy_config b/contrib/config/gen_simple_dummy_config new file mode 100755 index 000000000..d3d09d064 --- /dev/null +++ b/contrib/config/gen_simple_dummy_config @@ -0,0 +1,51 @@ +#!/bin/bash + +CONFFILE="many.conf" +NUMBERHOSTSVC=100 +NUMBERHOST=10 + +rm -f $CONFFILE + +cat >> $CONFFILE << EOF +/* Icinga 2 Generated Test Config */ +include +include + +local object IcingaApplication "icinga" { + macros = { + plugindir = "/usr/lib/nagios/plugins" + } +} + +library "compat" +local object CompatComponent "compat" { } +local object CompatLog "compat-log" { } + +/* +library "livestatus" +local object LivestatusComponent "livestatus" {} +*/ + +object CheckCommand "check_dummy" inherits "plugin-check-command" { + command = "\$plugindir$/check_dummy 1 \"icinga2 test\"", +} + +template Service "dummy-service-tmpl" { + check_command = "check_dummy", + check_interval = 1m, +} + +EOF + +# host template with services +echo 'template Host "dummy-host-tmpl" {' >> $CONFFILE +for i in $(seq 1 $NUMBERHOSTSVC) + do echo ' services["icinga2_service'$i'"] = { templates = [ "dummy-service-tmpl" ] },' >> $CONFFILE +done +echo ' hostcheck = "icinga2_service1",' >> $CONFFILE +echo '}' >> $CONFFILE + +# hosts +for i in $(seq 1 $NUMBERHOST) + do echo 'object Host "icinga2_host'$i'" inherits "dummy-host-tmpl" { }' >> $CONFFILE +done