The latest solution to monitor Redis using ganglia _redis

Source: Internet
Author: User
Tags redis redis version

Objective

Ganglia is mainly used to monitor the performance of the software, through the curve is very easy to see the working state of each node, for reasonable adjustment, allocation of system resources, improve the overall performance of the system plays an important role in supporting browser access, but can not monitor node hardware technical indicators. Ganglia is a distributed monitoring system.

Redis now in the business application has been very extensive, but how to monitor redis, real-time observation redis performance, in search engine search "ganglia monitoring Redis", found that the 13 old articles, are said to https://github.com/ Ganglia/gmond_python_modules this third-party plug-in library to download the REDIS monitoring module

Solving method

But I found that gmond_python_modules there is no Redis module under this repo, so I looked git log and found that the Redis module has been integrated into the ganglia source pack.

So downloaded the source package, after the search found Redis module is located gmond/python_modules/db/redis.py in the configuration file gmond/python_modules/conf.d/redis.pyconf.disabled .

Modify the host and port two parameters in the configuration file to monitor Redis IP and port, and then copy two files to the corresponding directory. (typically redis.pyconf copied to the ganglia installation directory /etc/conf.d/ , redis.py to the Ganglia installation directory /lib64/ganglia/python_modules )

Restart the Gmond, you can see the redis figure out, but the data are empty.

So stop Gmond, use gmond -f -d 1 enable debug mode, found redis.py error

[PYTHON] Can ' t call the metric handler function for [connected_clients] in the Python module [Redis].

Traceback (most recent):
File "/opt/gmond/lib64/ganglia/python_modules/redis.py", line, in Metric_ Handler
N, v = line.split (":")
valueerror:need more than 1 value to unpack

View Context Code

For line in Info.splitlines () [1:]:
 if "" = = line:
  continue
 N, v = line.split (":")

Probably means to redis info use every non-empty line of the command output: Split, but I installed the Redis version is 2.8+,info command will output similar comments like #server, which causes the press: Split failure, so python error, Gmond can not get the value.

So the solution is also very simple, the above code can be modified as follows, that is, skip the blank line and the line beginning with #

For line in Info.splitlines () [1:]:
 if "" = = line or line[0] = = ' # ':
  continue
 N, v = line.split (":")

Restart Gmond, and you'll see the data in ganglia in a minute.

==========================================

Looking at the ganglia code on the GitHub, I found that the latest code has fixed the bug, but it hasn't been release yet.

Summarize

The above is the entire content of this article, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.