You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there is no leader in Zookeeper, stat command returns :
echo stat | nc 10.0.0.7 2181
This ZooKeeper instance is not currently serving requests
Monitoring script check_zookeeper.py can't handle this situation gracefuly, and dies with
/etc/sensu/plugins/check_zookeeper.py -s 10.0.0.7:2181,10.0.0.8:2181,10.0.0.9:2181 -o nagios -w 1 -c 0 -k zk_followers
Traceback (most recent call last):
File "/etc/sensu/plugins/check_zookeeper.py", line 369, in <module>
sys.exit(main())
File "/etc/sensu/plugins/check_zookeeper.py", line 287, in main
cluster_stats = get_cluster_stats(opts.servers)
File "/etc/sensu/plugins/check_zookeeper.py", line 325, in get_cluster_stats
stats["%s:%s" % (host, port)] = zk.get_stats()
File "/etc/sensu/plugins/check_zookeeper.py", line 172, in get_stats
stat = self._parse_stat(self._send_cmd('stat'))
File "/etc/sensu/plugins/check_zookeeper.py", line 221, in _parse_stat
result['zk_version'] = version[version.index(':')+1:].strip()
ValueError: substring not found
Problem exists here (change in lines 218-221 is my dirty hack):
214 def _parse_stat(self, data):
215 """ Parse the output from the 'stat' 4letter word command """
216 h = StringIO(data)
217
218 not_serving_requests = re.match("^This ZooKeeper instance is not", data)
219 if not_serving_requests:
220 print("CRITICAL: Zookeeper is out of quorum, not serving requests")
221 sys.exit(2)
222
223 result = {}
224
225 version = h.readline()
226 if version:
227 result['zk_version'] = version[version.index(':')+1:].strip()
I'm not sure how to fix it in legitimate way :-)
The text was updated successfully, but these errors were encountered:
Hello,
When there is no leader in Zookeeper, stat command returns :
Monitoring script check_zookeeper.py can't handle this situation gracefuly, and dies with
Problem exists here (change in lines 218-221 is my dirty hack):
I'm not sure how to fix it in legitimate way :-)
The text was updated successfully, but these errors were encountered: