diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/apt.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/apt.conf deleted file mode 100644 index ca31f43..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/apt.conf +++ /dev/null @@ -1,7 +0,0 @@ -apply Service "apt" { - import "generic-service" - - check_command = "apt_custom" - - assign where host.name == NodeName -} diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/commands.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/commands.conf deleted file mode 100644 index f39cfcd..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/commands.conf +++ /dev/null @@ -1,42 +0,0 @@ -/* Command objects */ - -object NotificationCommand "mail-host-notification" { - import "plugin-notification-command" - - command = [ SysconfDir + "/icinga2/scripts/mail-host-notification.sh" ] - - env = { - NOTIFICATIONTYPE = "$notification.type$" - HOSTALIAS = "$host.display_name$" - HOSTADDRESS = "$address$" - HOSTSTATE = "$host.state$" - LONGDATETIME = "$icinga.long_date_time$" - HOSTOUTPUT = "$host.output$" - NOTIFICATIONAUTHORNAME = "$notification.author$" - NOTIFICATIONCOMMENT = "$notification.comment$" - HOSTDISPLAYNAME = "$host.display_name$" - USEREMAIL = "$user.email$" - } -} - -object NotificationCommand "mail-service-notification" { - import "plugin-notification-command" - - command = [ SysconfDir + "/icinga2/scripts/mail-service-notification.sh" ] - - env = { - NOTIFICATIONTYPE = "$notification.type$" - SERVICEDESC = "$service.name$" - HOSTALIAS = "$host.display_name$" - HOSTADDRESS = "$address$" - SERVICESTATE = "$service.state$" - LONGDATETIME = "$icinga.long_date_time$" - SERVICEOUTPUT = "$service.output$" - NOTIFICATIONAUTHORNAME = "$notification.author$" - NOTIFICATIONCOMMENT = "$notification.comment$" - HOSTDISPLAYNAME = "$host.display_name$" - SERVICEDISPLAYNAME = "$service.display_name$" - USEREMAIL = "$user.email$" - } -} - diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/custom_checks.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/custom_checks.conf deleted file mode 100644 index 818cc5f..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/custom_checks.conf +++ /dev/null @@ -1,11 +0,0 @@ -object CheckCommand "apt_custom" { - import "plugin-check-command" - - command = [ PluginDir + "/check_apt" ] - - arguments = { - "-t" = "$apt_timeout$" - } - - vars.apt_timeout = "30" -} diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/downtimes.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/downtimes.conf deleted file mode 100644 index 0bed647..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/downtimes.conf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * The example downtime apply rule. - */ - -apply ScheduledDowntime "backup-downtime" to Service { - author = "icingaadmin" - comment = "Scheduled downtime for backup" - - ranges = { - monday = service.vars.backup_downtime - tuesday = service.vars.backup_downtime - wednesday = service.vars.backup_downtime - thursday = service.vars.backup_downtime - friday = service.vars.backup_downtime - saturday = service.vars.backup_downtime - sunday = service.vars.backup_downtime - } - - assign where service.vars.backup_downtime != "" -} diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/groups.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/groups.conf deleted file mode 100644 index e6004a3..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/groups.conf +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Host group examples. - */ - -object HostGroup "linux-servers" { - display_name = "Linux Servers" - - assign where host.vars.os == "Linux" -} - -object HostGroup "windows-servers" { - display_name = "Windows Servers" - - assign where host.vars.os == "Windows" -} - -/** - * Service group examples. - */ - -object ServiceGroup "ping" { - display_name = "Ping Checks" - - assign where match("ping*", service.name) -} - -object ServiceGroup "http" { - display_name = "HTTP Checks" - - assign where match("http*", service.check_command) -} - -object ServiceGroup "disk" { - display_name = "Disk Checks" - - assign where match("disk*", service.check_command) -} diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/hosts.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/hosts.conf deleted file mode 100644 index 3a5baab..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/hosts.conf +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Host definitions with object attributes - * used for apply rules for Service, Notification, - * Dependency and ScheduledDowntime objects. - * - * Tip: Use `icinga2 object list --type Host` to - * list all host objects after running - * configuration validation (`icinga2 daemon -C`). - */ - -/* - * This is an example host based on your - * local host's FQDN. Specify the NodeName - * constant in `constants.conf` or use your - * own description, e.g. "db-host-1". - */ - -object Host NodeName { - /* Import the default host template defined in `templates.conf`. */ - import "generic-host" - - /* Specify the address attributes for checks e.g. `ssh` or `http`. */ - address = "127.0.0.1" - address6 = "::1" - - /* Set custom attribute `os` for hostgroup assignment in `groups.conf`. */ - vars.os = "Linux" - - /* Define http vhost attributes for service apply rules in `services.conf`. */ - vars.http_vhosts["http"] = { - http_uri = "/rai/login.php" - } - - /* Define disks and attributes for service apply rules in `services.conf`. */ - vars.disks["disk"] = { - /* No parameters. */ - } - - /* Define notification mail attributes for notification apply rules in `notifications.conf`. */ - vars.notification["mail"] = { - /* The UserGroup `icingaadmins` is defined in `users.conf`. */ - groups = [ "icingaadmins" ] - } -} - diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/notifications.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/notifications.conf deleted file mode 100644 index fd3af73..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/notifications.conf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * The example notification apply rules. - * - * Only applied if host/service objects have - * the custom attribute `notification` defined - * and containing `mail` as key. - * - * Check `hosts.conf` for an example. - */ - -apply Notification "mail-icingaadmin" to Host { - import "mail-host-notification" - - user_groups = host.vars.notification.mail.groups - - assign where host.vars.notification.mail -} - -apply Notification "mail-icingaadmin" to Service { - import "mail-service-notification" - - user_groups = host.vars.notification.mail.groups - - assign where host.vars.notification.mail -} diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/satellite.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/satellite.conf deleted file mode 100644 index 4a6b97a..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/satellite.conf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Host and Service templates for the Agent Setup. - */ - - -/** - * Provides settings for satellite hosts managed by 'icinga2 repository'. - * Define your global attributes here, for example custom - * attributes used for notifications, etc. - */ -template Host "satellite-host" { - vars.notification["mail"] = { - groups = [ "icingaadmins" ] - } -} - -/** - * Provides settings for satellite services managed by 'icinga2 repository'. - * Define your global satellite attributes here, for example custom - * attributes used for notifications, etc. - */ -template Service "satellite-service" { - vars.notification["mail"] = { - groups = [ "icingaadmins" ] - } -} - - -apply Dependency "satellite-host" to Host { - parent_host_name = host.zone - - assign where host.zone != "" && "satellite-host" in host.templates -} diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/services.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/services.conf deleted file mode 100644 index 4decbcf..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/services.conf +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Service apply rules. - * - * The CheckCommand objects `ping4`, `ping6`, etc - * are provided by the plugin check command templates. - * Check the documentation for details. - * - * Tip: Use `icinga2 object list --type Service` to - * list all service objects after running - * configuration validation (`icinga2 daemon -C`). - */ - -/* - * This is an example host based on your - * local host's FQDN. Specify the NodeName - * constant in `constants.conf` or use your - * own description, e.g. "db-host-1". - */ - -/* - * These are generic `ping4` and `ping6` - * checks applied to all hosts having the - * `address` resp. `address6` attribute - * defined. - */ -apply Service "ping4" { - import "generic-service" - - check_command = "ping4" - - assign where host.address -} - -apply Service "ping6" { - import "generic-service" - - check_command = "ping6" - - assign where host.address6 -} - -/* - * Apply the `ssh` service to all hosts - * with the `address` attribute defined and - * the custom attribute `os` set to `Linux`. - */ -apply Service "ssh" { - import "generic-service" - - check_command = "ssh" - - assign where (host.address || host.address6) && host.vars.os == "Linux" - ignore where host.name == "localhost" /* for upgrade safety */ -} - - - -apply Service for (http_vhost => config in host.vars.http_vhosts) { - import "generic-service" - - check_command = "http" - - vars += config -} - -apply Service for (disk => config in host.vars.disks) { - import "generic-service" - - check_command = "disk" - - vars += config -} - -apply Service "icinga" { - import "generic-service" - - check_command = "icinga" - - assign where host.name == NodeName -} - -apply Service "load" { - import "generic-service" - - check_command = "load" - - /* Used by the ScheduledDowntime apply rule in `downtimes.conf`. */ - vars.backup_downtime = "02:00-03:00" - - assign where host.name == NodeName -} - -apply Service "procs" { - import "generic-service" - - check_command = "procs" - - assign where host.name == NodeName -} - -apply Service "swap" { - import "generic-service" - - check_command = "swap" - - assign where host.name == NodeName -} - -apply Service "users" { - import "generic-service" - - check_command = "users" - - assign where host.name == NodeName -} - - - diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/templates.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/templates.conf deleted file mode 100644 index 1b9fc3e..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/templates.conf +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Generic template examples. - */ - - -/** - * Provides default settings for hosts. By convention - * all hosts should import this template. - * - * The CheckCommand object `hostalive` is provided by - * the plugin check command templates. - * Check the documentation for details. - */ -template Host "generic-host" { - max_check_attempts = 3 - check_interval = 5m - retry_interval = 1m - - check_command = "hostalive" -} - -/** - * Provides default settings for services. By convention - * all services should import this template. - */ -template Service "generic-service" { - max_check_attempts = 5 - check_interval = 5m - retry_interval = 1m -} - -/** - * Provides default settings for users. By convention - * all users should inherit from this template. - */ - -template User "generic-user" { - -} - -/** - * Provides default settings for host notifications. - * By convention all host notifications should import - * this template. - */ -template Notification "mail-host-notification" { - command = "mail-host-notification" - - states = [ Up, Down ] - types = [ Problem, Acknowledgement, Recovery, Custom, - FlappingStart, FlappingEnd, - DowntimeStart, DowntimeEnd, DowntimeRemoved ] - - period = "24x7" -} - -/** - * Provides default settings for service notifications. - * By convention all service notifications should import - * this template. - */ -template Notification "mail-service-notification" { - command = "mail-service-notification" - - states = [ OK, Warning, Critical, Unknown ] - types = [ Problem, Acknowledgement, Recovery, Custom, - FlappingStart, FlappingEnd, - DowntimeStart, DowntimeEnd, DowntimeRemoved ] - - period = "24x7" -} - diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/timeperiods.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/timeperiods.conf deleted file mode 100644 index 21fac52..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/timeperiods.conf +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Sample timeperiods for Icinga 2 requiring - * 'legacy-timeperiod' template from the Icinga - * Template Library (ITL). - * Check the documentation for details. - */ - -object TimePeriod "24x7" { - import "legacy-timeperiod" - - display_name = "Icinga 2 24x7 TimePeriod" - 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 "9to5" { - import "legacy-timeperiod" - - display_name = "Icinga 2 9to5 TimePeriod" - 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 "never" { - import "legacy-timeperiod" - - display_name = "Icinga 2 never TimePeriod" - ranges = { - } -} - diff --git a/modules/rhizo_base/files/etc/icinga2/conf.d/users.conf b/modules/rhizo_base/files/etc/icinga2/conf.d/users.conf deleted file mode 100644 index 515ef21..0000000 --- a/modules/rhizo_base/files/etc/icinga2/conf.d/users.conf +++ /dev/null @@ -1,17 +0,0 @@ -/** - * The example user 'icingaadmin' and the example - * group 'icingaadmins'. - */ - -object User "icingaadmin" { - import "generic-user" - - display_name = "Icinga 2 Admin" - groups = [ "icingaadmins" ] - - email = "icinga@localhost" -} - -object UserGroup "icingaadmins" { - display_name = "Icinga 2 Admin Group" -}