2013-08-12 13:33:51 +02:00
|
|
|
/**
|
|
|
|
* Icinga 2 configuration file
|
|
|
|
* - this is where you define settings for the Icinga application including
|
|
|
|
* which hosts/services to check.
|
|
|
|
*
|
|
|
|
* The docs/icinga2-config.txt file in the source tarball has a detailed
|
|
|
|
* description of what configuration options are available.
|
|
|
|
*/
|
|
|
|
|
|
|
|
include <itl/itl.conf>
|
|
|
|
include <itl/standalone.conf>
|
|
|
|
|
2013-09-26 00:12:48 +02:00
|
|
|
set IcingaMacros = {
|
|
|
|
plugindir = "/usr/lib/nagios/plugins",
|
|
|
|
iconimagedir = "/icinga2/images/icons",
|
|
|
|
icinga2src = "/home/michi/coding/icinga/icinga2",
|
2013-08-12 13:33:51 +02:00
|
|
|
}
|
|
|
|
|
2013-09-26 00:12:48 +02:00
|
|
|
set Icinga2Prefix = "/home/michi/i2"
|
|
|
|
set PerfdataPrefix = "/data/icinga2"
|
|
|
|
|
2013-08-12 13:33:51 +02:00
|
|
|
/**
|
|
|
|
* Enable Syslogger
|
|
|
|
*/
|
|
|
|
/*
|
2013-08-29 14:50:27 +02:00
|
|
|
object SyslogLogger "icinga2-syslog" {
|
2013-08-12 13:33:51 +02:00
|
|
|
severity = "information"
|
|
|
|
}
|
|
|
|
|
2013-08-29 14:50:27 +02:00
|
|
|
object FileLogger "my-debug-file" {
|
2013-08-12 13:33:51 +02:00
|
|
|
severity = "debug",
|
2013-09-26 00:12:48 +02:00
|
|
|
path = (Icinga2Prefix + "/var/log/icinga2/icinga2-debug.log")
|
2013-08-12 13:33:51 +02:00
|
|
|
}
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* The compat component periodically updates the status.dat and objects.cache
|
|
|
|
* files. These are used by the Icinga 1.x CGIs to display the state of
|
|
|
|
* hosts and services.
|
|
|
|
*/
|
|
|
|
library "compat"
|
2013-09-26 00:12:48 +02:00
|
|
|
object StatusDataWriter "status" { }
|
|
|
|
object ExternalCommandListener "command" { }
|
|
|
|
object CompatLogger "compat-log" { }
|
2013-08-12 13:33:51 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* INGRAPH
|
|
|
|
*/
|
2013-08-29 14:50:27 +02:00
|
|
|
object PerfdataWriter "pnp" {
|
2013-09-26 00:12:48 +02:00
|
|
|
perfdata_path = (PerfdataPrefix + "/perfdata/service-perfdata"),
|
2013-08-12 13:33:51 +02:00
|
|
|
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,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* LIVESTATUS
|
|
|
|
*/
|
|
|
|
library "livestatus"
|
|
|
|
|
2013-09-26 00:12:48 +02:00
|
|
|
object LivestatusListener "livestatus-tcp" {
|
2013-08-12 13:33:51 +02:00
|
|
|
socket_type = "tcp",
|
2013-09-26 00:12:48 +02:00
|
|
|
bind_host = "127.0.0.1",
|
|
|
|
bind_port = "6558"
|
2013-08-12 13:33:51 +02:00
|
|
|
}
|
|
|
|
|
2013-09-26 00:12:48 +02:00
|
|
|
object LivestatusListener "livestatus-unix" {
|
2013-08-12 13:33:51 +02:00
|
|
|
socket_type = "unix",
|
2013-09-30 09:42:27 +02:00
|
|
|
socket_path = (Icinga2Prefix + "/var/run/icinga2/cmd/livestatus")
|
2013-08-12 13:33:51 +02:00
|
|
|
}
|
2013-09-28 12:54:26 +02:00
|
|
|
|
2013-08-12 13:33:51 +02:00
|
|
|
/**
|
|
|
|
* IDO
|
|
|
|
*/
|
2013-09-26 00:12:48 +02:00
|
|
|
library "db_ido_mysql"
|
2013-08-12 13:33:51 +02:00
|
|
|
|
2013-09-26 00:12:48 +02:00
|
|
|
object IdoMysqlConnection "ido-mysql" {
|
2013-08-12 13:33:51 +02:00
|
|
|
host = "127.0.0.1",
|
|
|
|
port = "3306",
|
|
|
|
user = "icinga",
|
|
|
|
password = "icinga",
|
|
|
|
database = "icinga",
|
|
|
|
table_prefix = "icinga_",
|
|
|
|
instance_name = "icinga2",
|
|
|
|
instance_description = "icinga2 dev instance"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* And finally we define some host that should be checked.
|
|
|
|
*/
|
|
|
|
set bumsti = 60
|
|
|
|
|
|
|
|
template Service "notification-tmpl" {
|
|
|
|
notifications["mail-michi"] = {
|
|
|
|
templates = [ "mail-notification" ],
|
|
|
|
users = [ "michi" ],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
template Service "flapper" inherits "ping4" {
|
|
|
|
|
|
|
|
notifications["mail-michi"] = {
|
|
|
|
templates = [ "mail-notification" ],
|
|
|
|
users = [ "michi" ],
|
|
|
|
},
|
|
|
|
check_command = "flapme",
|
|
|
|
|
|
|
|
enable_flapping = 1,
|
|
|
|
flapping_threshold = 20,
|
|
|
|
check_interval = 15s,
|
|
|
|
custom = {
|
|
|
|
"foo1" = "bar1",
|
|
|
|
"foo5" = "bar5"
|
|
|
|
},
|
2013-09-26 00:12:48 +02:00
|
|
|
groups = [ "sg-thruk" ],
|
2013-08-12 13:33:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
object Host "dummy01" {
|
2013-09-26 00:12:48 +02:00
|
|
|
groups = [ "hg-thruk" ],
|
2013-08-12 13:33:51 +02:00
|
|
|
services["flapme"] = {
|
|
|
|
templates = [ "flapper" ],
|
|
|
|
check_command = "flapme",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
object Host "localhost" {
|
2013-09-26 00:12:48 +02:00
|
|
|
host_dependencies = [ "dummy01" ],
|
|
|
|
|
2013-08-12 13:33:51 +02:00
|
|
|
services["flapme"] = {
|
|
|
|
templates = [ "flapper" ],
|
|
|
|
notifications["mail-michi"] = {
|
|
|
|
templates = [ "mail-notification" ],
|
|
|
|
users = [ "michi" ],
|
2013-09-28 12:54:26 +02:00
|
|
|
user_groups = [ "all-michis" ],
|
2013-08-12 13:33:51 +02:00
|
|
|
notification_period = "24x7",
|
|
|
|
notification_state_filter = (StateFilterUnknown | StateFilterOK | StateFilterWarning | StateFilterCritical),
|
|
|
|
notification_type_filter = (NotificationRecovery | NotificationDowntimeStart | NotificationDowntimeEnd),
|
|
|
|
},
|
|
|
|
check_command = "flapme",
|
|
|
|
|
|
|
|
enable_flapping = 1,
|
|
|
|
flapping_threshold = 20,
|
|
|
|
check_interval = 15s,
|
|
|
|
|
|
|
|
custom += {
|
|
|
|
"foo1" = "bar1",
|
|
|
|
"foo2" = "bar2",
|
|
|
|
"notes" = "flapping test $SERVICEATTEMPT$ / $MAXSERVICEATTEMPT$",
|
|
|
|
"notes_url" = "https://www.icinga.org/$HOSTNAME$/$SERVICEDESC$/$TIMET$",
|
|
|
|
"action_url" = "https://dev.icinga.org/$HOSTADDRESS$/$SERVICESTATE$",
|
|
|
|
"icon_image" = "$iconimagedir$/icinga2.png",
|
|
|
|
"icon_image_alt" = "custom attr macro expand test"
|
|
|
|
},
|
2013-09-26 00:12:48 +02:00
|
|
|
groups = [ "sg-thruk" ],
|
2013-08-12 13:33:51 +02:00
|
|
|
},
|
|
|
|
services["ping4"] = {
|
|
|
|
templates = [ "ping4", "notification-tmpl" ],
|
|
|
|
},
|
|
|
|
services["ping6"] = {
|
|
|
|
templates = [ "ping6", "notification-tmpl" ],
|
|
|
|
},
|
|
|
|
services["ssh"] = {
|
|
|
|
templates = [ "ssh", "notification-tmpl" ],
|
|
|
|
},
|
|
|
|
services["load"] = {
|
|
|
|
templates = [ "load", "notification-tmpl" ],
|
|
|
|
},
|
|
|
|
services["users"] = {
|
|
|
|
templates = [ "users", "notification-tmpl" ],
|
2013-09-26 00:12:48 +02:00
|
|
|
groups = [ "sg-thruk" ],
|
|
|
|
service_dependencies = [
|
|
|
|
{ host = "dummy01", service = "flapme" },
|
2013-08-12 13:33:51 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
macros = {
|
|
|
|
address = "127.0.0.1",
|
|
|
|
address6 = "::1",
|
|
|
|
},
|
|
|
|
|
|
|
|
custom += {
|
|
|
|
"fooh1" = "barh1",
|
|
|
|
"fooh2" = "barh2",
|
|
|
|
"notes" = "host test $SERVICEATTEMPT$ / $MAXSERVICEATTEMPT$", /* this should work with hostcheck set */
|
|
|
|
"notes_url" = "https://www.icinga.org/$HOSTNAME$/$SERVICEDESC$/$TIMET$",
|
|
|
|
"action_url" = "https://dev.icinga.org/$HOSTADDRESS$/$SERVICESTATE$",
|
|
|
|
"icon_image" = "$iconimagedir$/icinga2.png",
|
|
|
|
"icon_image_alt" = "custom attr macro expand test",
|
|
|
|
"2d_coords" = "42,1337"
|
|
|
|
},
|
|
|
|
|
2013-09-26 00:12:48 +02:00
|
|
|
check = "flapme",
|
2013-08-12 13:33:51 +02:00
|
|
|
|
2013-09-26 00:12:48 +02:00
|
|
|
groups = [ "hg-thruk" ],
|
2013-08-12 13:33:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
object HostGroup "hg-thruk" {
|
|
|
|
display_name = "hg thruk livestatus",
|
|
|
|
custom = {
|
|
|
|
action_url = "http://www.icinga.org/about/icinga2",
|
|
|
|
notes_url = "http://docs.icinga.org/latest/en",
|
|
|
|
notes = "This is the icinga2 livestatus test"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
object ServiceGroup "sg-thruk" {
|
|
|
|
display_name = "sg thruk livestatus",
|
|
|
|
custom = {
|
|
|
|
action_url = "http://www.icinga.org/about/icinga2",
|
|
|
|
notes_url = "http://docs.icinga.org/latest/en",
|
|
|
|
notes = "This is the icinga2 livestatus test"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
object CheckCommand "flapme" inherits "plugin-check-command" {
|
2013-09-26 00:12:48 +02:00
|
|
|
command = "$icinga2src$/contrib/flap.sh",
|
2013-08-12 13:33:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
object EventCommand "eventme" inherits "plugin-event-command" {
|
|
|
|
command = "echo \"event fired\"",
|
|
|
|
}
|
|
|
|
|
|
|
|
object NotificationCommand "notifyme" inherits "plugin-notification-command" {
|
|
|
|
command = "echo \"hello\"",
|
|
|
|
}
|
|
|
|
|
|
|
|
object NotificationCommand "mail" inherits "plugin-notification-command" {
|
|
|
|
command = "echo `date +%s` >> /tmp/i2.notify"
|
|
|
|
}
|
|
|
|
|
|
|
|
object User "michi-clone" {
|
|
|
|
groups = [ "all-michis" ],
|
|
|
|
}
|
|
|
|
|
|
|
|
object User "michi" {
|
|
|
|
groups = [ "all-michis" ],
|
|
|
|
notification_state_filter = (StateFilterUnknown | StateFilterOK | StateFilterWarning | StateFilterCritical),
|
|
|
|
|
|
|
|
enable_notifications = 1,
|
|
|
|
notification_period = "24x7",
|
|
|
|
|
|
|
|
macros = {
|
|
|
|
"name" = "bumsti",
|
|
|
|
"pager" = "keks@kekse.de",
|
|
|
|
"email" = "michael.friedrich@icinga.org",
|
|
|
|
},
|
|
|
|
|
|
|
|
custom = {
|
|
|
|
"cv_key01" = "cv_val01",
|
|
|
|
"cv_key03" = "cv_val03",
|
|
|
|
"cv_key07" = "cv_val07",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
object UserGroup "all-michis" {
|
|
|
|
display_name = "all my michis",
|
|
|
|
}
|
|
|
|
|
|
|
|
template Notification "mail-notification" {
|
|
|
|
|
|
|
|
notification_command = "mail",
|
|
|
|
}
|
|
|
|
|
|
|
|
object TimePeriod "8x5" inherits "legacy-timeperiod" {
|
|
|
|
display_name = "icinga 2 8x5",
|
|
|
|
ranges = {
|
|
|
|
"monday" = "09:00-17:00",
|
|
|
|
"tuesday" = "09:00-17:00",
|
|
|
|
"wednesday" = "09:00-17:00",
|
|
|
|
"thursday" = "09:00-17:00",
|
|
|
|
"friday" = "09:00-17:00",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
object TimePeriod "24x7" inherits "legacy-timeperiod" {
|
|
|
|
display_name = "icinga 2 24x7",
|
|
|
|
ranges = {
|
|
|
|
"monday" = "00:00-24:00",
|
|
|
|
"tuesday" = "00:00-24:00",
|
|
|
|
"wednesday" = "00:00-24:00",
|
|
|
|
"thursday" = "00:00-24:00",
|
|
|
|
"friday" = "00:00-24:00",
|
|
|
|
"saturday" = "00:00-24:00",
|
|
|
|
"sunday" = "00:00-24:00",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
object TimePeriod "none" inherits "legacy-timeperiod" {
|
|
|
|
display_name = "icinga 2 none",
|
|
|
|
ranges = {
|
|
|
|
}
|
|
|
|
}
|