[[email protected] bin]# ./redis-cli -c -p 7000 ping | grep -c PONG
1
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w "connected_clients" | awk -F":" '{print $2}'
1
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w rejected_connections
rejected_connections:0
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w total_connections_received
total_connections_received:217
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w blocked_clients
blocked_clients:0
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w used_memory
used_memory:2513656
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w used_memory_rss
used_memory_rss:9728000
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w mem_fragmentation_ratio
mem_fragmentation_ratio:3.89
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w keys | awk -F':' '{print $2}' | awk -F',' '{print $1}' | awk -F'=' '{print $2}'
43
./redis-cli -c -p 7000 info | grep -w total_commands_processed| awk -F':' '{print $2}'
./redis-cli -c -p 7000 info | grep -w instantaneous_ops_per_sec | awk -F':' '{print $2}'
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w keyspace_hits | awk -F':' '{print $2}'
354
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w keyspace_misses
keyspace_misses:122
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w latest_fork_usec
latest_fork_usec:315
[[email protected] bin]# ./redis-cli -c -p 7000 info | grep -w cluster_enabled
cluster_enabled:1
[[email protected] bin]# ./redis-cli -c -p 7000 cluster info
cluster_state:ok
不等于16384则告警
[[email protected] bin]# ./redis-cli -c -p 7000 cluster info | grep -w cluster_slots_ok
cluster_slots_ok:16384
[[email protected] bin]# ./redis-cli -c -p 7000 cluster info | grep -w cluster_slots_fail
cluster_slots_fail:0
[[email protected] bin]# ./redis-cli -c -p 7000 cluster info | grep -w cluster_known_nodes
cluster_known_nodes:6