Showing posts with label UserParameter. Show all posts
Showing posts with label UserParameter. Show all posts

Oct 1, 2010

Zabbix's template to monitor Memcached

Today's topic is about monitoring Memcached instance. There are several ways/tools to monitor Memcached such as Munin, Nagios and Zabbix. I used to work with several monitoring tools but the most effective & my favorite one is Zabbix. I will discuss my impression about Zabbix later.

How to monitor Memcached's instance by using Zabbix
  1. Import Memcached's template from this link to your Zabbix server
  2. Modify /etc/zabbix/zabbix_agentd.conf and add the following UserParameter (on the Memcached server)
    UserParameter=memcached_stats[*],echo -e "stats\nquit" | nc 127.0.0.1 $1 | grep "STAT $2 " | awk '{print $$3}'
  3. Restart Zabbix agentd service
  4. Link Mecached template to Memcached server
  5. Check the latest data (Application: memcached)
What are inside this template
  • 38 Items (default type is Zabbix Agent Active)
  • 1 trigger
  • 4 graphs
Note
  • This template tries to monitor Memcached instance that running on port 11211
  • If your Memcached instance is running in different port, you could simply replace 11211 with your port number before importing this template
  • If you run more than one Memcached instances, you could simply copy this and modify port number.