From 72e9128d7bb08e427334f892d9bffa693c139f16 Mon Sep 17 00:00:00 2001
From: Per Cederqvist <ceder@lysator.liu.se>
Date: Tue, 27 May 2008 13:28:37 +0000
Subject: [PATCH] Handle LABEL= partitions.  Check that disks contains 10% or
 5% free space.

---
 rules/gentoo/nrpe-host-auto.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/rules/gentoo/nrpe-host-auto.sh b/rules/gentoo/nrpe-host-auto.sh
index 798f5e0..76cceb3 100644
--- a/rules/gentoo/nrpe-host-auto.sh
+++ b/rules/gentoo/nrpe-host-auto.sh
@@ -3,15 +3,16 @@ trap "rm -f $FILESYSTEMS" 0
 
 > $prefix/etc/nrpe-host-auto.cfg
 awk < /etc/fstab \
-    '! ($1 ~ /\//) { next } 
+    '! ($1 ~ /\// || $1 ~ /LABEL=/) { next } 
      $1 ~ /^#/ { next }
      $3 == "swap" || $3 == "nfs" { next } 
      $4 ~ /noauto/ { next } 
+     $1 ~ /LABEL=/ { print $2, $2; next }
      { print $1, $2 }' \
 | while read dev mp
   do
     mpdash=`echo $mp | sed -e 's%^/$%/root%' -e 's%/%-%g'`
-    echo "command[check-disk$mpdash]=/usr/nagios/libexec/check_disk $dev" \
+    echo "command[check-disk$mpdash]=/usr/nagios/libexec/check_disk -w 10% -c 5% $dev" \
 	>> $prefix/etc/nrpe-host-auto.cfg
     echo $mp
   done > $FILESYSTEMS
-- 
GitLab