diff options
| author | Tobias Wiese <tobias@tobiaswiese.com> | 2020-05-13 20:10:08 +0200 |
|---|---|---|
| committer | Tobias Wiese <tobias@tobiaswiese.com> | 2020-05-14 12:15:16 +0200 |
| commit | 34fe8a57df416e7e2b8be0c954a1fa6d6d596c95 (patch) | |
| tree | c6039d19c887c247856bd44cb18f4ab346d7d0a6 | |
| parent | 240b4f8e9f33086ce8cfa2734b5c55a1484d5419 (diff) | |
service/pgsql: Monitor PostgreSQL
Tries to connect to a database in the postgresql cluster.
Signed-off-by: Tobias Wiese <tobias@tobiaswiese.com>
| -rw-r--r-- | zones.d/global-templates/services.conf | 15 | ||||
| -rw-r--r-- | zones.d/master/hosts.conf | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/zones.d/global-templates/services.conf b/zones.d/global-templates/services.conf index 9081f19..825b9fe 100644 --- a/zones.d/global-templates/services.conf +++ b/zones.d/global-templates/services.conf @@ -55,3 +55,18 @@ apply Service "apt" { assign where host.vars.os_family == "debian" } + +/** + * Serice health checks + */ + +apply Service "pgsql" { + import "generic-service" + + check_command = "pgsql" + + vars.pgsql_hostname = "/run/postgresql" + vars += host.vars.pgsql + + assign where host.vars.pgsql != "" +} diff --git a/zones.d/master/hosts.conf b/zones.d/master/hosts.conf index f306dde..eaa89ec 100644 --- a/zones.d/master/hosts.conf +++ b/zones.d/master/hosts.conf @@ -24,4 +24,6 @@ object Host "new-babbage.server.tobiaswiese.net" { http_uri = "/icingaweb2" } } + + vars.pgsql = { } } |
