From a3472eaea5a7440fab5117dadd8de81b77ce29f1 Mon Sep 17 00:00:00 2001 From: vfebvre Date: Thu, 21 Oct 2021 16:09:53 +0200 Subject: [PATCH] =?UTF-8?q?ajout=20de=20r=C3=A8gles=20suppl=C3=A9mentaires?= =?UTF-8?q?=20pour=20les=20alertes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dicos/70_prometheus.xml | 1 + tmpl/alert-rules-node-exporter.yml | 35 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tmpl/alert-rules-node-exporter.yml diff --git a/dicos/70_prometheus.xml b/dicos/70_prometheus.xml index 1223e71..b6ada52 100644 --- a/dicos/70_prometheus.xml +++ b/dicos/70_prometheus.xml @@ -5,6 +5,7 @@ + diff --git a/tmpl/alert-rules-node-exporter.yml b/tmpl/alert-rules-node-exporter.yml new file mode 100644 index 0000000..29df57c --- /dev/null +++ b/tmpl/alert-rules-node-exporter.yml @@ -0,0 +1,35 @@ +# +# Alert Rules +# +groups: +- name: GeneralNodeExporterRules + rules: + # TooMuch Data IN + - alert: TooMuchNetworkThroughputIn + expr: sum by (instance) (rate(node_network_receive_bytes_total[2m])) / 1024 / 1024 > 100 + for: 5m + labels: + severity: warning + annotations: + summary: Host unusual network throughput in (instance {{ $labels.instance }}) + description: "Host network interfaces are probably receiving too much data (> 100 MB/s)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + + - alert: AlertInodes + expr: node_filesystem_files_free{mountpoint ="/"} / node_filesystem_files{mountpoint="/"} * 100 < 10 and ON (instance, device, mountpoint) node_filesystem_readonly{mountpoint="/"} == 0 + for: 2m + labels: + severity: warning + annotations: + summary: Host out of inodes (instance {{ $labels.instance }}) + description: "Disk is almost running out of available inodes (< 10% left)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + + - alert: HostSwapIsFillingUp + expr: (1 - (node_memory_SwapFree / node_memory_SwapTotal)) * 100 > 80 + for: 2m + labels: + severity: warning + annotations: + summary: Host swap is filling up (instance {{ $labels.instance }}) + description: "Swap is filling up (>80%)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + +