ctdb-scripts: Don't fail monitoring if sanity checks fail
authorMartin Schwenke <martin@meltin.net>
Fri, 24 Jul 2015 09:56:06 +0000 (19:56 +1000)
committerAmitay Isaacs <amitay@samba.org>
Sat, 29 Aug 2015 15:06:25 +0000 (17:06 +0200)
Just log some warnings.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/events.d/05.system

index fcb5ab54f440984e3c917645e4e0b9c41c4d27fe..f255bb454e91c44fa06e8f02b3889e0d1d2f60fe 100644 (file)
@@ -17,19 +17,22 @@ monitor_filesystem_usage ()
         _fs_threshold="${_fs#*:}"
 
         if [ ! -d "$_fs_mount" ]; then
-            die "Directory ${_fs_mount} does not exist"
+            echo "WARNING: Directory ${_fs_mount} does not exist"
+           continue
         fi
 
        case "$_fs_threshold" in
            [0-9]|[0-9][0-9]|100) : ;;
-           *) die "Threshold ${_fs_threshold} is invalid number"
+           *) echo "WARNING: Threshold ${_fs_threshold} is invalid number"
+              continue
        esac
 
         # Get current utilization
         _fs_usage=$(df -kP "$_fs_mount" | \
                           sed -n -e 's@.*[[:space:]]\([[:digit:]]*\)%.*@\1@p')
         if [ -z "$_fs_usage" ] ; then
-            die "Unable to get FS utilization for ${_fs_mount}"
+            echo "WARNING: Unable to get FS utilization for ${_fs_mount}"
+           continue
         fi
 
         if [ "$_fs_usage" -ge "$_fs_threshold" ] ; then