linuxRedisRedis

redis监控指标

2016-10-17  本文已影响3455人  疲马羁禽

一、服务器存活监控

1>ping监控告警

2>CPU

3>丢包率

<b>

二、Redis Server监控数据采集

<b>

Redis存活监控
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 ping | grep -c PONG
1

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w "connected_clients" | awk -F":" '{print $2}'
1

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w rejected_connections
rejected_connections:0
[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w total_connections_received
total_connections_received:217

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w blocked_clients
blocked_clients:0

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w used_memory
used_memory:2513656

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w used_memory_rss
used_memory_rss:9728000

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w mem_fragmentation_ratio
mem_fragmentation_ratio:3.89

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w keys | awk -F':' '{print $2}' | awk -F',' '{print $1}' | awk -F'=' '{print $2}'
43

<b>

./redis-cli -c -p 7000 info | grep -w total_commands_processed| awk -F':' '{print $2}'

<b>

./redis-cli -c -p 7000 info | grep -w instantaneous_ops_per_sec | awk -F':' '{print $2}'

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w keyspace_hits | awk -F':' '{print $2}'
354

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w keyspace_misses
keyspace_misses:122

<b>

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w latest_fork_usec
latest_fork_usec:315

三、Redis集群监控

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 info | grep -w cluster_enabled
cluster_enabled:1

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 cluster info
cluster_state:ok

<b>

不等于16384则告警

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 cluster info | grep -w cluster_slots_ok
cluster_slots_ok:16384

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 cluster info | grep -w cluster_slots_fail
cluster_slots_fail:0

<b>

[root@tzgdevapp10 bin]# ./redis-cli -c -p 7000 cluster info | grep -w cluster_known_nodes
cluster_known_nodes:6
上一篇下一篇

猜你喜欢

热点阅读