mirror of https://github.com/Icinga/icinga2.git
contrib: add simple dummy config generator
This commit is contained in:
parent
9249af1c66
commit
989c979ea7
|
@ -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 <itl/itl.conf>
|
||||
include <itl/standalone.conf>
|
||||
|
||||
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
|
Loading…
Reference in New Issue