Page MenuHomePhabricator

redis::ganglia collides with python-redis package
Closed, ResolvedPublic

Description

I was testing an instance (toolsbeta-puppettestbed) for Ganglia statistics of a Redis server with "import redis::ganglia". The instance had the Ubuntu package python-redis installed from earlier, unrelated tests.

This led to ganglia-monitor, upon reading /etc/ganglia/conf.d/redis.pyconf's:

modules {
module {
name = "redis"
language = "python"
param host { value = "127.0.0.1" }
param port { value = 6379 }
}
}

to import the Python module redis from the Ubuntu package, but not the module of the same name in /usr/lib/ganglia/python_modules/redis.py. Symptoms were /var/log/upstart/ganglia-monitor.log containing:

[PYTHON] Can't find the metric_init function in the python module [redis].
Unable to find the metric information for 'connected_clients'. Possible that the module has not been loaded.
[...]

but in fact *a* module had been loaded, just not the "right" one.

Two immediate possible solutions:

a) Rename /usr/lib/ganglia/python_modules/redis.py to redis_monitoring.py or something similar;

b) liaison with upstream Ganglia so that /usr/lib/ganglia/python_modules gets higher priority in Python's path.


Version: unspecified
Severity: minor
URL: https://github.com/ganglia/monitor-core/issues/22

Details

Reference
bz52540

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:52 AM
bzimport set Reference to bz52540.

(In reply to comment #0)

Two immediate possible solutions:

a) Rename /usr/lib/ganglia/python_modules/redis.py to redis_monitoring.py or
something similar;

Yep. That's a nice, simple fix.

b) liaison with upstream Ganglia so that /usr/lib/ganglia/python_modules gets
higher priority in Python's path.

Upstream: https://github.com/ganglia/monitor-core/issues/22

Change 77657 had a related patch set uploaded by Ori.livneh:
Rename 'redis.py' to 'redis_monitoring.py' to avoid conflict

https://gerrit.wikimedia.org/r/77657

Change 77657 merged by Faidon:
Rename 'redis.py' to 'redis_monitoring.py' to avoid conflict

https://gerrit.wikimedia.org/r/77657