summaryrefslogtreecommitdiffstats
path: root/zones.d
diff options
context:
space:
mode:
authorTobias Wiese <tobias@tobiaswiese.com>2020-05-13 16:12:10 +0200
committerTobias Wiese <tobias@tobiaswiese.com>2020-05-14 12:15:16 +0200
commit71c820054059b801ed53ef5c12bef57d975879fa (patch)
tree7ed3c6cb4d6ea11afa337a1a8417a7de22946825 /zones.d
parent0ca93dff41ff3a9889a5847ff0f854cf5cef1185 (diff)
service/http: Monitor https and https certificates
Check that https endpoints are reachable, and that the certificat is not about to expire. Signed-off-by: Tobias Wiese <tobias@tobiaswiese.com>
Diffstat (limited to 'zones.d')
-rw-r--r--zones.d/master/hosts.conf6
-rw-r--r--zones.d/master/services.conf30
2 files changed, 36 insertions, 0 deletions
diff --git a/zones.d/master/hosts.conf b/zones.d/master/hosts.conf
index 567fdb7..dba700d 100644
--- a/zones.d/master/hosts.conf
+++ b/zones.d/master/hosts.conf
@@ -7,4 +7,10 @@ object Host "new-babbage.server.tobiaswiese.net" {
vars.os = "debian"
vars.os_family = "debian"
vars.kernel = "linux"
+
+ vars.http_vhosts = {
+ "icinga.tobiaswiese.net" = {
+ http_uri = "/icingaweb2"
+ }
+ }
}
diff --git a/zones.d/master/services.conf b/zones.d/master/services.conf
index 25ca1c5..2b31393 100644
--- a/zones.d/master/services.conf
+++ b/zones.d/master/services.conf
@@ -32,3 +32,33 @@ apply Service "ssh" {
assign where (host.address || host.address6) && host.vars.kernel == "linux"
}
+
+/**
+ * Network Service checks
+ */
+
+template Service "http" {
+ import "generic-network-service"
+
+ check_command = "http"
+
+ vars += {
+ http_vhost = http_vhost
+ http_sni = true
+ http_warn_time = 0.2s
+ http_critical_time = 0.3s
+ }
+ vars += config
+}
+
+apply Service "https-" for (http_vhost => config in host.vars.http_vhosts) {
+ import "http"
+
+ vars.http_ssl = true
+}
+
+apply Service "https-cert-" for (http_vhost => config in host.vars.http_vhosts) {
+ import "http"
+
+ vars.http_certificate = "25,10"
+}