Open bputek opened 10 years ago
I see this too. Did you ever find the solution?
When I run from the command line, here is the output:
[zenoss@ip-172-31-48-116 libexec]$ ./check_redis.py -H 172.31.49.54 -p 6379
Traceback (most recent call last):
File "./check_redis.py", line 49, in
I updated the file /opt/zenoss/ZenPacks/ZenPacks.chudler.redis-1.0.1.egg/ZenPacks/chudler/redis/lib/redis/client.py
which had this:
def parse_info(response): "Parse the result of Redis's INFO command into a Python dict" info = {} def get_value(value): if ',' not in value: return value sub_dict = {} for item in value.split(','): k, v = item.split('=') try: sub_dict[k] = int(v) except ValueError: sub_dict[k] = v return sub_dict for line in response.splitlines(): ! key, value = line.split(':') try: info[key] = int(value) except ValueError: info[key] = get_value(value) return info
to this:
def parse_info(response): "Parse the result of Redis's INFO command into a Python dict" info = {} def get_value(value): if ',' not in value: return value sub_dict = {} for item in value.split(','): k, v = item.split('=') try: sub_dict[k] = int(v) except ValueError: sub_dict[k] = v return sub_dict for line in response.splitlines(): ! try: ! key, value = line.split(':') ! except ValueError: ! continue try: info[key] = int(value) except ValueError: info[key] = get_value(value) return info
and the command runs now.
Yeah I fixed it in a similar way.
From: Kendal Montgomery [mailto:notifications@github.com] Sent: Friday, August 15, 2014 2:35 PM To: zenoss/ZenPacks.chudler.redis Cc: Brendan Putek Subject: Re: [ZenPacks.chudler.redis] No output from COMMAND plugin (#4)
I updated the file /opt/zenoss/ZenPacks/ZenPacks.chudler.redis-1.0.1.egg/ZenPacks/chudler/redis/lib/redis/client.py
which had this:
def parse_info(response): "Parse the result of Redis's INFO command into a Python dict" info = {} def get_value(value): if ',' not in value: return value sub_dict = {} for item in value.split(','): k, v = item.split('=') try: sub_dict[k] = int(v) except ValueError: sub_dict[k] = v return sub_dict for line in response.splitlines(): ! key, value = line.split(':') try: info[key] = int(value) except ValueError: info[key] = get_value(value) return info
to this:
def parse_info(response): "Parse the result of Redis's INFO command into a Python dict" info = {} def get_value(value): if ',' not in value: return value sub_dict = {} for item in value.split(','): k, v = item.split('=') try: sub_dict[k] = int(v) except ValueError: sub_dict[k] = v return sub_dict for line in response.splitlines(): ! try: ! key, value = line.split(':') ! except ValueError: ! continue try: info[key] = int(value) except ValueError: info[key] = get_value(value) return info
and the command runs now.
— Reply to this email directly or view it on GitHubhttps://github.com/zenoss/ZenPacks.chudler.redis/issues/4#issuecomment-52341998.
This email and any attachments may contain confidential and proprietary information of Blackboard that is for the sole use of the intended recipient. If you are not the intended recipient, disclosure, copying, re-distribution or other use of any of this information is strictly prohibited. Please immediately notify the sender and delete this transmission if you received this email in error.
The issue it seems is that new versions of Redis include comment-style lines in the INFO response. Instead of a try / except block, I included the following around line 129 of client.py where the response processing is happening:
if line.startswith('#'): continue
we also had to add in a line to skip the blank lines to get around this error:
if line.startswith('#'):
continue
if not line.strip():
continue
Hi I am seeing
/DB/Redis No output from COMMAND plugin.
I am running Zenoss 4.2.4 Core