Check_redis says 'has 0 databases ()' while 100 databases are in place
Opened this issue · 2 comments
Hi,
First of all: Thanks for sharing this nice nagios check!
Please help me solving this issue: What am I doing wrong when the check returns that 0 db's are in place while redis-cli returns 100?
~ # redis-cli -h redisserver -p 6379 config get databases
1) "databases"
2) "100"
~ # ./check_redis -H redisserver -p6379 --connected_client=WARN:">850",CRIT:">950"
# (I also get this warning which I do not understand)
Odd number of elements in anonymous hash at /usr/share/perl5/Redis.pm line 222, <GEN1> line 2.
OK: REDIS on redisserver:6379 has 0 databases () - connected_clients is 810
I have the same issue, did anyone fix this?
I found the solution! The problem is your version of the Redis perl module.
I did a little digging, and in that perl module, it parses the Redis INFO output all wrong. The hash is all mangled and the data is useless by the time it's passed to the plugin.
If you run this: perl -MRedis -e 'print $Redis::VERSION'
it will give you the version of the module you have installed. In my case (on Wheezy) I had version 1.951 which didn't have Redis 2.6 support.
I installed a newer version (but still not the newest) 1.976 and all its dependencies (just a straight line of other perl libraries) which you can find here.
Now it gives me everything I need.