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
#!/bin/bash echo -e "stats\nquit" | nc 127.0.0.1 11211 | grep "STAT $1 " | awk '{print $3}'
chmod +x /etc/zabbix/scripts/memcache.sh
#####Memcache UserParameter=memcache[*],/etc/zabbix/scripts/memcache.sh $1
/etc/init.d/zabbix-agent restart
UserParameter=memcache[*], echo -e "stats\nquit" | nc 127.0.0.1 11211 | grep "STAT $1 " | awk '{print $3}'
Source: https://habr.com/ru/post/141110/
All Articles