Oct 4, 2010

Zabbix's template to monitor Redis

Today, i'm going to release Zabbix's template & script to monitor Redis.
I copied the perl script from Munin's plugin and modify some parts to make it match with Zabbix. Thank you Munin's plugin developers.

Here are the files


Howto install?

  • If you running your own Redis on port 6379, you don't need to change anything. If you run Redis in another port, just simply use text editor to replace 6379 to your port number.
  • If you running multiple instances of Redis, your could just simply copy the template to your own ports. No need to modify perl script
  • Import template
  • Upload redis.pl to your Redis server at /etc/zabbix/scripts, chmod to 755
  • Make sure that you could run below command and don't get any error.

    sudo su - zabbix --shell=/bin/bash && /etc/zabbib/scripts/redis.pl 127.0.0.1 6379 role
  • Append below line to /etc/zabbix/zabbix_agentd.conf

    UserParameter=redis_stats[*],/etc/zabbix/scripts/redis.pl $1 $2 $3 
  • Restart zabbix-agentd service
  • Check your latest data at Zabbix server via web interface

Good luck.

11 comments:

Robert said...

"connected_slave" must be replaced with "connected_slaves" in perl script and template.

leo said...

thanks :P

Anonymous said...

Hi,

I have added the template and script according. Also, executed the script with no errors, still I am not getting any graphs.
I do not see any log on the zabbix_agentd.log.

Could you please help me out.

Anonymous said...

hey,

looks output of INFO command now contains also comments (# Server, # Clients, etc...) and empty lines so perl script output warnings (Use of uninitialized value in hash element at ./redis.pl line 55, line 1.)

I tuned up the loop to process only lines starting with chars (I am not perl guru - so be careful), here we go:

if ($_ =~ /^[a-z]+/ ) {
my ($key,$val) = split(/:/, $_, 2);
$hash->{$key} = $val;
}

thx for the good job btw ;)
ET

Unknown said...

Having the same issue. Not really getting any data...

Anonymous said...

Anyone know of the solution to get data posted to the Zabbix Server?

Anonymous said...

FYI, I had to change the Type (for the item from Zabbix Agent (Active) to Zabbix Agent and I could get data from the clients.

Unknown said...

Can't use an undefined value as a symbol reference at /etc/zabbix/scripts/redis.pl line 46

Anonymous said...

How can i pass a password as an argument to script ?

AuntiSpam said...

Sorry folks,

The script is not written by me and I'm not the Perl guru. If you found any error, you may need to fix it by yourself.

And I didn't explain clearly about how could you feed data into Zabbix. You have to read the Zabbix documentation manually and choose your own approach for feed data into Zabbix such as Item, Active Item, Zabbix Trapper. Then, modify your zabbix agent configuration or cron accordingly.

Unknown said...


One of the guys here at work fixed the script so it works for us on Redis 3.0

email me at x52_50@yahoodotcom and I can send what we have or I guess follow up comments will be sent to me