From 8d4d063d1f7bd1d4d0534a353d88f5c212cf572b Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 26 Sep 2013 00:12:48 +0200 Subject: [PATCH] Update my test config. --- contrib/config/mf/icinga2.conf | 66 +++++++++++++++++----------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/contrib/config/mf/icinga2.conf b/contrib/config/mf/icinga2.conf index 98aa46708..384bac466 100644 --- a/contrib/config/mf/icinga2.conf +++ b/contrib/config/mf/icinga2.conf @@ -10,16 +10,15 @@ include include -/** - * Global configuration settings - */ -object IcingaApplication "icinga" { - macros = { - plugindir = "/usr/lib/nagios/plugins", - iconimagedir = "/icinga2/images/icons" - } +set IcingaMacros = { + plugindir = "/usr/lib/nagios/plugins", + iconimagedir = "/icinga2/images/icons", + icinga2src = "/home/michi/coding/icinga/icinga2", } +set Icinga2Prefix = "/home/michi/i2" +set PerfdataPrefix = "/data/icinga2" + /** * Enable Syslogger */ @@ -30,7 +29,7 @@ object SyslogLogger "icinga2-syslog" { object FileLogger "my-debug-file" { severity = "debug", - path = "/home/michi/i2/var/log/icinga2/icinga2-debug.log" + path = (Icinga2Prefix + "/var/log/icinga2/icinga2-debug.log") } */ /** @@ -39,14 +38,15 @@ object FileLogger "my-debug-file" { * hosts and services. */ library "compat" -object CompatComponent "compat" { } -object CompatLog "compat-log" { } +object StatusDataWriter "status" { } +object ExternalCommandListener "command" { } +object CompatLogger "compat-log" { } /** * INGRAPH */ object PerfdataWriter "pnp" { - perfdata_path = "/data/icinga2/perfdata/service-perfdata", + perfdata_path = (PerfdataPrefix + "/perfdata/service-perfdata"), format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$", rotation_interval = 15s, } @@ -54,25 +54,26 @@ object PerfdataWriter "pnp" { /** * LIVESTATUS */ +/* library "livestatus" -object LivestatusComponent "livestatus-tcp" { +object LivestatusListener "livestatus-tcp" { socket_type = "tcp", - host = "10.0.10.18", - port = "6558" + bind_host = "127.0.0.1", + bind_port = "6558" } -object LivestatusComponent "livestatus-unix" { +object LivestatusListener "livestatus-unix" { socket_type = "unix", - socket_path = "/home/michi/i2/var/run/icinga2/livestatus" + socket_path = (Icinga2Prefix + "/var/run/icinga2/livestatus") } - +*/ /** * IDO */ -library "ido_mysql" +library "db_ido_mysql" -object MysqlDbConnection "ido-mysql" { +object IdoMysqlConnection "ido-mysql" { host = "127.0.0.1", port = "3306", user = "icinga", @@ -111,11 +112,11 @@ template Service "flapper" inherits "ping4" { "foo1" = "bar1", "foo5" = "bar5" }, - servicegroups = [ "sg-thruk" ], + groups = [ "sg-thruk" ], } object Host "dummy01" { - hostgroups = [ "hg-thruk" ], + groups = [ "hg-thruk" ], services["flapme"] = { templates = [ "flapper" ], check_command = "flapme", @@ -123,6 +124,8 @@ object Host "dummy01" { } object Host "localhost" { + host_dependencies = [ "dummy01" ], + services["flapme"] = { templates = [ "flapper" ], notifications["mail-michi"] = { @@ -148,7 +151,7 @@ object Host "localhost" { "icon_image" = "$iconimagedir$/icinga2.png", "icon_image_alt" = "custom attr macro expand test" }, - servicegroups = [ "sg-thruk" ], + groups = [ "sg-thruk" ], }, services["ping4"] = { templates = [ "ping4", "notification-tmpl" ], @@ -164,9 +167,9 @@ object Host "localhost" { }, services["users"] = { templates = [ "users", "notification-tmpl" ], - servicegroups = [ "sg-thruk" ], - servicedependencies = [ - { host = "dummy01", service = "flapme" }, + groups = [ "sg-thruk" ], + service_dependencies = [ + { host = "dummy01", service = "flapme" }, ], }, @@ -175,7 +178,6 @@ object Host "localhost" { address6 = "::1", }, - hostdependencies = [ "dummy01" ], custom += { "fooh1" = "barh1", "fooh2" = "barh2", @@ -187,12 +189,9 @@ object Host "localhost" { "2d_coords" = "42,1337" }, - //hostcheck = "ping4", - hostcheck = "flapme", + check = "flapme", - hostgroups = [ "hg-thruk" ], - - check_interval = (bumsti * 5) + groups = [ "hg-thruk" ], } object HostGroup "hg-thruk" { @@ -214,7 +213,7 @@ object ServiceGroup "sg-thruk" { } object CheckCommand "flapme" inherits "plugin-check-command" { - command = "/home/michi/coding/icinga/icinga2/contrib/flap.sh", + command = "$icinga2src$/contrib/flap.sh", } object EventCommand "eventme" inherits "plugin-event-command" { @@ -226,7 +225,6 @@ object NotificationCommand "notifyme" inherits "plugin-notification-command" { } object NotificationCommand "mail" inherits "plugin-notification-command" { - command = "echo `date +%s` >> /tmp/i2.notify" }