From e4b2b8bc7c644c87562edf8884b11115427c28f0 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Thu, 16 Mar 2023 11:02:27 +0100 Subject: [PATCH] add: michy server monitoring --- .../files/michy-ese-server.conf | 52 +++++++++++++++++++ roles/monitoring-master/files/users.conf | 8 ++- roles/monitoring-master/tasks/icinga.yaml | 1 + .../templates/mail_notifications.conf | 4 +- 4 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 roles/monitoring-master/files/michy-ese-server.conf diff --git a/roles/monitoring-master/files/michy-ese-server.conf b/roles/monitoring-master/files/michy-ese-server.conf new file mode 100644 index 0000000..149ba46 --- /dev/null +++ b/roles/monitoring-master/files/michy-ese-server.conf @@ -0,0 +1,52 @@ +object Host "esports-erlangen.de" { + + import "generic-host" + + address = "esports-erlangen.de" + name = "esports-erlangen.de" + check_command = "hostalive4" + vars.linux = "true" + + + max_check_attempts = 5 + retry_interval = 1m + + vars.notification["mail"] = { + groups = ["ese"] + } + +} + +apply Service "dovecot-imap-tls-993" { + import "generic-service" + check_command = "ssl" + vars.host = host.address + vars.port = 993 + assign where host.name == "esports-erlangen.de" +} + +apply Service "postfix-smtp-25" { + import "generic-service" + check_command = "smtp" + vars.host = host.address + vars.protocol = "smtp" + vars.port = 25 + assign where host.name == "esports-erlangen.de" +} + +apply Service "postfix-smtp-starttls-25" { + import "generic-service" + check_command = "ssl" + vars.host = host.address + vars.protocol = "smtp" + vars.port = 25 + assign where host.name == "esports-erlangen.de" +} + +apply Service "website-http" { + import "generic-service" + check_command = "http" + vars.host = "www.esports-erlangen.de" + vars.ssl = true + assign where host.name == "esports-erlangen.de" +} diff --git a/roles/monitoring-master/files/users.conf b/roles/monitoring-master/files/users.conf index da95f73..4163144 100644 --- a/roles/monitoring-master/files/users.conf +++ b/roles/monitoring-master/files/users.conf @@ -2,9 +2,9 @@ object User "michy" { import "generic-user" display_name = "Michy Monitoring" - groups = [] + groups = ["ese"] - email = "spamsink@atlantishq.de" + email = "HISTORY_PURGED_SECRET" } object User "icingaadmin" { @@ -19,3 +19,7 @@ object User "icingaadmin" { object UserGroup "icingaadmins" { display_name = "Icinga 2 Admin Group" } + +object UserGroup "ese" { + display_name = "ESports-Erlangen Gruppe" +} diff --git a/roles/monitoring-master/tasks/icinga.yaml b/roles/monitoring-master/tasks/icinga.yaml index 086c312..402ac2e 100644 --- a/roles/monitoring-master/tasks/icinga.yaml +++ b/roles/monitoring-master/tasks/icinga.yaml @@ -87,6 +87,7 @@ - services_passive_mail_extern.conf - services_async.conf - users.conf + - michy-ese-server.conf - async-icinga-services-dynamic.conf notify: - restart icinga diff --git a/roles/monitoring-master/templates/mail_notifications.conf b/roles/monitoring-master/templates/mail_notifications.conf index 5df19b9..6c93526 100644 --- a/roles/monitoring-master/templates/mail_notifications.conf +++ b/roles/monitoring-master/templates/mail_notifications.conf @@ -4,7 +4,7 @@ apply Notification "mail-icingaadmin" to Host { user_groups = host.vars.notification.mail.groups users = host.vars.notification.mail.users - interval = 2h + interval = 7d vars.notification_logtosyslog = true vars.notification_from = "Icinga <{{ smtp_service_user }}@atlantishq.de>" @@ -18,7 +18,7 @@ apply Notification "mail-icingaadmin" to Service { user_groups = host.vars.notification.mail.groups users = host.vars.notification.mail.users - interval = 2h + interval = 7d vars.notification_logtosyslog = true vars.notification_from = "Icinga <{{ smtp_service_user }}@atlantishq.de>" assign where host.vars.notification.mail