Browse Source

add Postgres total connection utilization alarm (#13620)

Ilya Mashchenko 2 years ago
parent
commit
89d3db69b1
2 changed files with 17 additions and 0 deletions
  1. 1 0
      health/Makefile.am
  2. 16 0
      health/health.d/postgres.conf

+ 1 - 0
health/Makefile.am

@@ -67,6 +67,7 @@ dist_healthconfig_DATA = \
     health.d/netfilter.conf \
     health.d/nut.conf \
     health.d/pihole.conf \
+    health.d/postgres.conf \
     health.d/portcheck.conf \
     health.d/processes.conf \
     health.d/python.d.plugin.conf \

+ 16 - 0
health/health.d/postgres.conf

@@ -0,0 +1,16 @@
+# you can disable an alarm notification by setting the 'to' line to: silent
+
+ template: total_connection_utilization
+       on: postgres.connections_utilization
+    class: Utilization
+     type: Database
+component: PostgreSQL
+    hosts: *
+   lookup: average -1m unaligned of used
+    units: %
+    every: 1m
+     warn: $this > (($status >= $WARNING)  ? (70) : (80))
+     crit: $this > (($status == $CRITICAL) ? (80) : (90))
+    delay: down 15m multiplier 1.5 max 1h
+     info: average total connection utilization over the last minute
+       to: dba