summaryrefslogtreecommitdiffstats
path: root/zones.d
diff options
context:
space:
mode:
authorTobias Wiese <tobias@tobiaswiese.com>2020-05-14 23:16:48 +0200
committerTobias Wiese <tobias@tobiaswiese.com>2020-05-14 23:16:48 +0200
commitd6e394443554fd987101edeacec8c37853fdfdc8 (patch)
tree2cd67b235167c5e9ef5724eec80b1436e3e5abbc /zones.d
parent1d3f54ef5966e8b10304f0ed364a7ad7d3a9c73f (diff)
hosts/keen-morse: Monitor the mailserver
Add monitoring to the mailserver. Alos adds services for the mailq, smtp and imap Signed-off-by: Tobias Wiese <tobias@tobiaswiese.com>
Diffstat (limited to 'zones.d')
-rw-r--r--zones.d/global-templates/services.conf20
-rw-r--r--zones.d/keen-morse.server.tobiaswiese.net/hosts.conf14
-rw-r--r--zones.d/master/services.conf48
3 files changed, 81 insertions, 1 deletions
diff --git a/zones.d/global-templates/services.conf b/zones.d/global-templates/services.conf
index 825b9fe..d86a7a0 100644
--- a/zones.d/global-templates/services.conf
+++ b/zones.d/global-templates/services.conf
@@ -42,6 +42,8 @@ apply Service "swap" {
check_command = "swap"
+ vars.swap_noswap = "ok"
+
assign where host.vars.kernel == "linux"
}
@@ -57,9 +59,25 @@ apply Service "apt" {
}
/**
- * Serice health checks
+ * Service health checks
*/
+apply Service "mailq" {
+ import "generic-service"
+
+ check_command = "mailq"
+
+ vars += {
+ mailq_warning = 50
+ mailq_critical = 55
+ mailq_domain_warning = 30
+ mailq_domain_critical = 35
+ mailq_servertype = host.vars.mailserver
+ }
+
+ assign where host.vars.mailserver
+}
+
apply Service "pgsql" {
import "generic-service"
diff --git a/zones.d/keen-morse.server.tobiaswiese.net/hosts.conf b/zones.d/keen-morse.server.tobiaswiese.net/hosts.conf
new file mode 100644
index 0000000..3dd24e2
--- /dev/null
+++ b/zones.d/keen-morse.server.tobiaswiese.net/hosts.conf
@@ -0,0 +1,14 @@
+object Host "keen-morse.server.tobiaswiese.net" {
+ import "generic-host"
+
+ address = "165.227.161.52"
+ address6 = "2a03:b0c0:3:d0::ce7:6001"
+
+ vars.os = "debian"
+ vars.os_family = "debian"
+ vars.kernel = "linux"
+
+ vars.mailserver = "postfix"
+
+ vars.pgsql = { }
+}
diff --git a/zones.d/master/services.conf b/zones.d/master/services.conf
index fc362d8..9a86a10 100644
--- a/zones.d/master/services.conf
+++ b/zones.d/master/services.conf
@@ -84,3 +84,51 @@ apply Service "https-cert-" for (http_vhost => config in host.vars.http_vhosts)
vars.http_certificate = "25,10"
}
+
+apply Service "imap" {
+ import "generic-network-service"
+
+ check_command = "imap"
+
+ vars += {
+ imap_warning = 0.1s
+ imap_critical = 0.2s
+ }
+
+ assign where host.vars.mailserver
+}
+
+template Service "smtp" {
+ import "generic-network-service"
+
+ check_command = "smtp"
+
+ vars += {
+ smtp_starttls = true
+ smtp_certificate_age = 10
+ smtp_warning = 0.1s
+ smtp_critical = 0.2s
+ }
+}
+
+apply Service "smtp-insecure" {
+ import "smtp"
+
+ vars.smtp_starttls = false
+
+ assign where host.vars.mailserver
+}
+
+apply Service "smtp-secure" {
+ import "smtp"
+
+ assign where host.vars.mailserver
+}
+
+apply Service "submission" {
+ import "smtp"
+
+ vars.smtp_port = 587
+
+ assign where host.vars.mailserver
+}