Revert "Add new eventscript 40.fs_use that can be used to monitor file system use...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 17 Aug 2011 00:00:28 +0000 (10:00 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 17 Aug 2011 00:00:28 +0000 (10:00 +1000)
This reverts commit b65efc69317756fe60479c0df58c874da3fde6db.

Makefile.in
config/events.d/40.fs_use [deleted file]
packaging/RPM/ctdb.spec.in

index 3a4e7d958df2d91ea8b713dd72530a0510ac1107..5fa9e98c10df0471fc56f5d74a597f2720a94da0 100755 (executable)
@@ -257,7 +257,6 @@ install: all
        ${INSTALLCMD} -m 644 config/events.d/20.multipathd $(DESTDIR)$(etcdir)/ctdb/events.d
        ${INSTALLCMD} -m 644 config/events.d/31.clamd $(DESTDIR)$(etcdir)/ctdb/events.d
        ${INSTALLCMD} -m 755 config/events.d/40.vsftpd $(DESTDIR)$(etcdir)/ctdb/events.d
-       ${INSTALLCMD} -m 644 config/events.d/40.fs_use $(DESTDIR)$(etcdir)/ctdb/events.d
        ${INSTALLCMD} -m 755 config/events.d/41.httpd $(DESTDIR)$(etcdir)/ctdb/events.d
        ${INSTALLCMD} -m 755 config/events.d/50.samba $(DESTDIR)$(etcdir)/ctdb/events.d
        ${INSTALLCMD} -m 755 config/events.d/60.nfs $(DESTDIR)$(etcdir)/ctdb/events.d
diff --git a/config/events.d/40.fs_use b/config/events.d/40.fs_use
deleted file mode 100644 (file)
index 14d33fa..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-# ctdb event script for checking local file system utilization
-
-. $CTDB_BASE/functions
-loadconfig
-
-case "$1" in 
-    monitor)
-        # check each specified fs to be checked
-        # config format is <fs_mount>:<fs_threshold>
-        for fs in $CTDB_CHECK_FS_USE
-        do
-            # parse fs_mount and fs_threshold
-            fs_config=(`echo $fs | tr ':' '\n'`)
-            fs_mount=${fs_config[0])}
-            fs_threshold=${fs_config[1])}
-
-            # check if given fs_mount is existing directory
-            if [ ! -d "$fs_mount" ]; then
-                echo "$0: Directory $fs_mount does not exist"
-                exit 1
-            fi
-
-            # check if given fs_threshold is number
-            if ! [[ "$fs_threshold" =~ ^[0-9]+$ ]] ; then
-                echo "$0: Threshold $fs_threshold is invalid number"
-                exit 1
-            fi
-
-            # get utilization of given fs from df
-            fs_usage=`df -k $fs_mount | grep % | awk {'print $5'} | sed 's/%//g' | tail -n 1`
-
-            # check if fs_usage is number
-            if ! [[ "$fs_usage" =~ ^[0-9]+$ ]] ; then
-                echo "$0: FS utilization $fs_usage is invalid number"
-                exit 1
-            fi
-
-            # check if fs_usage is higher than or equal to fs_threshold
-            if [[ "$fs_usage" -ge "$fs_threshold" ]] ; then
-                echo "ERROR: Utilization of $fs_mount ($fs_usage%) is higher than threshold ($fs_threshold%)"
-                exit 1
-            fi
-        done
-
-       ;;
-
-    *)
-       ctdb_standard_event_handler "$@"
-       ;;
-esac
-
-exit 0
index 0bd3be6b7b8145900ed243b32d3ac54fd9130426..d5361144f65897ab098adae2b6f8fb3f56884b8c 100644 (file)
@@ -102,7 +102,6 @@ rm -rf $RPM_BUILD_ROOT
 %{_sysconfdir}/ctdb/events.d/11.routing
 %{_sysconfdir}/ctdb/events.d/20.multipathd
 %{_sysconfdir}/ctdb/events.d/31.clamd
-%{_sysconfdir}/ctdb/events.d/40.fs_use
 %{_sysconfdir}/ctdb/events.d/40.vsftpd
 %{_sysconfdir}/ctdb/events.d/41.httpd
 %{_sysconfdir}/ctdb/events.d/50.samba