📜 ⬆️ ⬇️

Monitor Memcache with Zabbix

Hello.

At the request of those who wish ( Monitor Nginx using ZTC and Zabbix ) I made a mini article on connecting memcache to Zabbix. Everything is much simpler here than with ZTC templates.

First, let's check that memcache is alive and correctly gives us the values ​​we need:

echo -e "stats\nquit" | nc -q2 127.0.0.1 11211 STAT pid 12246 STAT uptime 1310046 STAT time 1333135085 STAT version 1.4.5 STAT pointer_size 64 STAT rusage_user 219.349708 … STAT evictions 403623 STAT reclaimed 9373 END 

Add a little to the commands executed above, and write the following in /etc/zabbix/scripts/memcache.sh
 #!/bin/bash echo -e "stats\nquit" | nc 127.0.0.1 11211 | grep "STAT $1 " | awk '{print $3}' 

Making the script executable:
 chmod +x /etc/zabbix/scripts/memcache.sh 

')
Prepare agent zabbiks, append to /etc/zabbix/zabbix_agentd.conf
 #####Memcache UserParameter=memcache[*],/etc/zabbix/scripts/memcache.sh $1 


Do not forget to do:
 /etc/init.d/zabbix-agent restart 


We connect this memcache.xml template in the web part of Zabbix Server and watch the cache life. And finally, some working graphs:

Current items

Evictions

Retrieval hit and miss per second


PS Immediately make a reservation that option:
 UserParameter=memcache[*], echo -e "stats\nquit" | nc 127.0.0.1 11211 | grep "STAT $1 " | awk '{print $3}' 

he worked for me, for some reason, not with all versions of memkesh.

Source: https://habr.com/ru/post/141110/


All Articles