After installing Zabbix server and client (PS: Please refer to: http://www.zifangsky.cn/576.html), we can use Zabbix to monitor some services, such as: Zabbix predefined monitoring CPU, memory, Basic system parameters such as disks. In addition, we can configure Zabbix to monitor the number of memcached, Tomcat, Nginx, TCP port connections, and order number and other specific business system status
Below I will briefly explain how to configure Zabbix to monitor some of the performance of memcached:
One Client Configuration
(1) Add script memcached-status.shto get memcached status:
[Email protected] zabbix]# cd/usr/local/zabbix/scripts[[email protected] zabbix]# vim memcached-status.sh
#!/bin/bash item=$1ip=127.0.0.1port=11211 (echo "stats"; Sleep 0.5) | Telnet $ip $port 2>/dev/null | grep "STAT $item \b" | awk ' {print $} '
Add executable permissions to the script:
[Email protected] zabbix]# chmod a+x memcached-status.sh
(2) Modify zabbix_agentd.conf:
[Email protected] zabbix]# vim/usr/local/zabbix/etc/zabbix_agentd.conf
Add to:
Userparameter=memcached.stat[*],/usr/local/zabbix/scripts/memcached-status.sh "$"
It is necessary to note that a new "user parameter" is added here:memcached.stat[*] , Calling this parameter on the Zabbix server is actually the memcached-status.sh script that follows the calling argument.
(3) Restart Zabbix_agentd:
[Email protected] zabbix]# service Zabbix_agentd restart
two server-side Web interface configuration
Import the Memcache template and select the template on the host with memcached
Note: The template file is shown in the attachment
This article is from "Zifangsky's personal blog" blog, make sure to keep this source http://983836259.blog.51cto.com/7311475/1855288
Zabbix monitoring memcached