eventscripts: Use ctdb_check_counter() instead of ctdb_check_counter_limit()
authorMartin Schwenke <martin@meltin.net>
Tue, 30 Apr 2013 05:23:20 +0000 (15:23 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 6 May 2013 06:24:59 +0000 (16:24 +1000)
ctdb_check_counter_limit() can soon be removed...

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/events.d/01.reclock
config/events.d/40.vsftpd

index 0d8f7ba68796ec3ddf42085e726c6ed4ed094c2e..ec50989743f57e41ed4d3c27b18106a7cac282a7 100755 (executable)
@@ -28,14 +28,14 @@ case "$1" in
        ) >/dev/null 2>&1 &
 
        ctdb_counter_incr
-       (ctdb_check_counter_limit 200 >/dev/null 2>&1) || {
-           echo "Reclock file $RECLOCKFILE\" can not be accessed. Shutting down."
+       if ! ctdb_check_counter "quiet" -ge 200 ; then
+           echo "Reclock file \"$RECLOCKFILE\" can not be accessed. Shutting down."
            df
            sleep 1
            ctdb shutdown
-       }
+       fi
 
-       ctdb_check_counter_limit 3 quiet
+       ctdb_check_counter "error" -gt 3
        ;;
 
     *)
index 25964b87031fd36d8ec3ed547f86f35c9ddfa6be..92a0e9955e904c88762f20bc712881231b9527ca 100755 (executable)
@@ -53,8 +53,9 @@ case "$1" in
                ctdb_counter_init
            else
                ctdb_counter_incr
-               ctdb_check_counter_limit
-               exit 0 # only count 1 failure per monitor event
+               ctdb_check_counter
+               ctdb_check_counter "quiet" -ge 1 || \
+                   echo "WARNING: vsftpd not listening but less than $service_fail_limit consecutive failures, not unhealthy yet" 
            fi
        fi      
        ;;