Zabbix监控memcache示例

简介:

一、创建memcached-tool脚本

参见http://www.linuxidc.com/Linux/2014-08/105157.htm

1
mkdir  /scripts  &&  cd  /scripts  && vim memcache-tool.pl
1
2
将脚本copy进入memcache-tool.pl
chmod  +x  /scripts/memcache-tool .pl


二、用脚本查看memcache的各类统计数据

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/scripts/memcache-tool .pl 127.0.0.1:11211 stats
#127.0.0.1:11211   Field       Value
          accepting_conns           1
              auth_cmds           0
             auth_errors           0
                 bytes           0
              bytes_read          94
              bytes_written        5261
             cas_badval           0
               cas_hits           0
              cas_misses           0
               cmd_flush           0
                cmd_get           0
                cmd_set           0
               cmd_touch           0
             conn_yields           0
       connection_structures          11
          curr_connections          10
              curr_items           0
               decr_hits           0
             decr_misses           0
             delete_hits           0
            delete_misses           0
         evicted_unfetched           0
               evictions           0
          expired_unfetched           0
                get_hits           0
               get_misses           0
                  hash_bytes      524288
          hash_is_expanding           0
           hash_power_level          16
               incr_hits           0
              incr_misses           0
                libevent        2.0.21-stable
            limit_maxbytes        134217728
         listen_disabled_num           0
                     pid       10459
              pointer_size          64
                reclaimed           0
              reserved_fds          20
               rusage_system    0.121024
                rusage_user    0.045384
                threads           4
                    time       1426727521
          total_connections          18
              total_items           0
               touch_hits           0
             touch_misses           0
                   uptime        2574
                  version      1.4.15

三、在zabbix_agent.conf中自定义UserParameter

修改以下的参数:

1
2
UnsafeUserParameters=1
UserParameter=MemcacheStats[*], /scripts/memcache-tool .pl 127.0.0.1:11211 stats| grep  $1 | awk  '{print $NF}'

然后重启zabbix_agent进程


四、在zabbix中添加item

例如,添加当前“curr_connections”

wKioL1UJxG2y5QoLAADMQH1Z48A053.jpg

保存即可。


*如果出现“Not supported by Zabbix Agent”的错误,

通过下面的命令得到详细的信息:

1
zabbix_agent -t MemcacheStats[curr_connections]]

或者修改zabbix_server.conf中的

1
Timeout=3   #将这个值调整的大一点




本文转自 bannerpei 51CTO博客,原文链接:http://blog.51cto.com/281816327/1622063,如需转载请自行联系原作者
相关文章
|
3月前
|
存储 SQL 监控
修改Zabbix源码实现监控数据双写,满足业务需求!
虽然对接Elasticsearch后有诸多好处,但是它不往数据库写历史数据了,同时还不再计算趋势数据了。有这么一个场景...
修改Zabbix源码实现监控数据双写,满足业务需求!
|
4月前
|
数据采集 监控 数据库
OceanBase社区版可以通过Zabbix监控
OceanBase社区版可以通过Zabbix监控
75 4
|
4月前
|
监控 关系型数据库 机器人
小白带你学习linux的监控平台zabbix
小白带你学习linux的监控平台zabbix
132 0
|
7月前
|
监控 前端开发 JavaScript
Zabbix分布式监控Web监控
Zabbix分布式监控Web监控
76 0
|
6月前
|
监控 关系型数据库 MySQL
企业实战(8)CentOS 6.8安装Zabbix-agent 5.0监控主机性能与Mysql数据库
企业实战(8)CentOS 6.8安装Zabbix-agent 5.0监控主机性能与Mysql数据库
|
1月前
|
数据采集 监控 数据库
请问OceanBase社区版能否通过zabbix监控,然后将报错信息展现到grafana?
【2月更文挑战第25天】请问OceanBase社区版能否通过zabbix监控,然后将报错信息展现到grafana?
25 2
|
6月前
|
监控
zabbix如何添加自定义监控项
zabbix如何添加自定义监控项
252 0
|
2月前
|
监控 Cloud Native 关系型数据库
使用 Grafana 统一监控展示 - 对接 Zabbix
使用 Grafana 统一监控展示 - 对接 Zabbix
|
4月前
|
监控 Docker 容器
Zabbix【部署 03】zabbix-agent2安装配置使用(zabbix-agent2监控docker实例分享)
Zabbix【部署 03】zabbix-agent2安装配置使用(zabbix-agent2监控docker实例分享)
218 0
|
4月前
|
监控 Java
Zabbix【部署 02】Zabbix-Java-Gateway安装配置使用(使用Zabbix-Java-Gateway通过JMX监控Java应用程序实例分享)
Zabbix【部署 02】Zabbix-Java-Gateway安装配置使用(使用Zabbix-Java-Gateway通过JMX监控Java应用程序实例分享)
87 0

推荐镜像

更多