2013-07-06 20:53:07 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
CONFFILE="many.conf"
|
|
|
|
NUMBERHOSTSVC=100
|
|
|
|
NUMBERHOST=10
|
|
|
|
|
|
|
|
rm -f $CONFFILE
|
|
|
|
|
|
|
|
cat >> $CONFFILE << EOF
|
|
|
|
/* Icinga 2 Generated Test Config */
|
|
|
|
include <itl/itl.conf>
|
|
|
|
include <itl/standalone.conf>
|
|
|
|
|
2013-08-29 14:50:27 +02:00
|
|
|
object IcingaApplication "icinga" {
|
2013-07-06 20:53:07 +02:00
|
|
|
macros = {
|
|
|
|
plugindir = "/usr/lib/nagios/plugins"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
library "compat"
|
2013-08-29 14:50:27 +02:00
|
|
|
object CompatComponent "compat" { }
|
|
|
|
object CompatLog "compat-log" { }
|
2013-07-06 20:53:07 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
library "livestatus"
|
2013-08-29 14:50:27 +02:00
|
|
|
object LivestatusComponent "livestatus" {}
|
2013-07-06 20:53:07 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
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
|