From b50c8ce9e1cb4ffe1ffc339e9bb847f3fea69fa7 Mon Sep 17 00:00:00 2001 From: Ludovic Cartier Date: Fri, 19 Sep 2025 09:27:21 +0200 Subject: [PATCH] add new check_disk_usage in nrpe config file --- templates/nrpe.j2 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/templates/nrpe.j2 b/templates/nrpe.j2 index 8e3740e..e7feab8 100644 --- a/templates/nrpe.j2 +++ b/templates/nrpe.j2 @@ -16,13 +16,19 @@ command[check_eth]=/usr/lib/nagios/plugins/check_eth -i {{ ansible_default_ipv4. command[check_proc_fail2ban]=/usr/lib/nagios/plugins/check_procs -a fail2ban -w 1: -c 1: command[check_proc_age]=/usr/lib/nagios/plugins/check_proc_age -p -w 400 -c 600 -# disk -# -w space warning / -c space critical / -W inode warning / -K inode criticak / -C reset after -command[check_disk]=/usr/lib/nagios/plugins/check_disk -x /lib/init/rw -x /dev -x /dev/shm -x /sys -x /proc -X tmpfs -w 10% -c 3% -W 10% -K 3% -A -I '^/dev/loop.*$' -I '^/run/docker/.*$' -X overlay -x /sys/kernel/debug/tracing -# -w space warning / -c space critical / -W inode warning / -K inode criticak / -C reset after -command[check_disk_advanced]=/usr/lib/nagios/plugins/check_disk_advanced -x /lib/init/rw -x /run -x /sys -x /dev/shm -X tmpfs -X nsfs -X overlay -X fuse -X proc -X sysfs -X devtmpfs -w 10% -c 3% -W 10% -K 3% -H +# check_disk_usage +# -w <%>: Warning threshold for block usage. +# -c <%>: Critical threshold for block usage. +# -W <%>: Warning threshold for inode usage. +# -C <%>: Critical threshold for inode usage. +# -e : Exclude a mount point by exact match (e.g., -e /tmp). +# -E : Exclude mount points matching a regex pattern (e.g., -E '/run/user/.*'). +# -x : Exclude a filesystem type (e.g., -x tmpfs). +command[check_disk_usage]=/usr/lib/nagios/plugins/check_disk_usage -w 80 -c 90 -e /run -e /dev -e /dev/shm -e /sys -e /proc -e /sys/kernel/debug/tracing -x tmpfs -x overlay -x fuse -x proc -x devtmpfs + command[check_disk_root]=/usr/lib/nagios/plugins/check_disk -w 30% -W 30% -c 10% -K 10% -p / command[check_rw_root]=/usr/lib/nagios/plugins/check_rofs / + {% if nrpe_disk is defined %} {% for target in nrpe_disk %} command[check_disk_data]=/usr/lib/nagios/plugins/check_disk -w 30% -W 30% -c 10% -K 10% -p /data