zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1381901 - in /zookeeper/branches/branch-3.4: CHANGES.txt src/contrib/monitoring/check_zookeeper.py
Date Fri, 07 Sep 2012 06:28:56 GMT
Author: mahadev
Date: Fri Sep  7 06:28:55 2012
New Revision: 1381901

URL: http://svn.apache.org/viewvc?rev=1381901&view=rev
Log:
ZOOKEEPER-1501. Nagios plugin always returns OK when it cannot connect to zookeeper. (Brian
Sutherland via mahadev)

Modified:
    zookeeper/branches/branch-3.4/CHANGES.txt
    zookeeper/branches/branch-3.4/src/contrib/monitoring/check_zookeeper.py

Modified: zookeeper/branches/branch-3.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/CHANGES.txt?rev=1381901&r1=1381900&r2=1381901&view=diff
==============================================================================
--- zookeeper/branches/branch-3.4/CHANGES.txt (original)
+++ zookeeper/branches/branch-3.4/CHANGES.txt Fri Sep  7 06:28:55 2012
@@ -105,6 +105,9 @@ BUGFIXES:
   ZOOKEEPER-1380. zkperl: _zk_release_watch doesn't remove items properly from
   the watch list. (Botond Hejj via mahadev)
 
+  ZOOKEEPER-1501. Nagios plugin always returns OK when it cannot connect to
+  zookeeper. (Brian Sutherland via mahadev)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1389. it would be nice if start-foreground used exec $JAVA

Modified: zookeeper/branches/branch-3.4/src/contrib/monitoring/check_zookeeper.py
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/src/contrib/monitoring/check_zookeeper.py?rev=1381901&r1=1381900&r2=1381901&view=diff
==============================================================================
--- zookeeper/branches/branch-3.4/src/contrib/monitoring/check_zookeeper.py (original)
+++ zookeeper/branches/branch-3.4/src/contrib/monitoring/check_zookeeper.py Fri Sep  7 06:28:55
2012
@@ -74,6 +74,11 @@ class NagiosHandler(object):
                 elif (warning < critical and critical <= value) or (warning > critical
and critical >= value):
                     critical_state.append(host)
 
+        if not values:
+            # Zookeeper may be down, not serving requests or we may have a bad configuration
+            print 'Critical, %s not found' % opts.key
+            return 2
+
         values = ' '.join(values)
         if critical_state:
             print 'Critical "%s" %s!|%s' % (opts.key, ', '.join(critical_state), values)



Mime
View raw message