成功最有效的方法就是向有经验的人学习!

Redis性能指标详解和监控办法

redis-cli命令介绍与使用

redis性能指标的介绍以及监控涉及的redis-cli info命令,在了解info命令的相关指标之后可根据需要选择几个相对重要的指标进行监控。

有关redis操作的命令参照:
https://www.gl.sh.cn/2019/08/20/redis-cli_ming_ling_zong_jie.html

redis-cli -h 10.168.204.x -p 6379 -a "pass" info 
#没有密码且在本机执行可以直接用:
redis-cli info

配合grep和awk可以对数据更加精确的取值

redis-cli info|awk '/connected_clients/'

redis info信息解释

[root@iZbp19yq6gmkhcnh216pliZ ~]# redis-cli info
# Server
redis_version:3.2.4 #Redis版本                                        
redis_git_sha1:00000000 #Git SHA1
redis_git_dirty:0 #Git dirty flag
redis_build_id:4a0a5391316325c5
redis_mode:cluster
os:Linux 2.6.32-358.el6.x86_64 x86_64 #Redis 服务器的宿主操作系统
arch_bits:64 #架构(32 或 64 位)
multiplexing_api:epoll #Redis 所使用的事件处理机制
gcc_version:4.4.7 #编译 Redis 时所使用的 GCC 版本
process_id:42341 #服务器进程的 PID
run_id:961f96e23843202ae98dbeffb655b4f9c4d4c57e #Redis 服务器的随机标识符(用于 Sentinel 和集群)
tcp_port:28001  #TCP/IP 监听端口
uptime_in_seconds:60872 #运行时间(秒)
uptime_in_days:0 #运行天数
hz:10
lru_clock:12112874 #以分钟为单位进行自增的时钟,用于 LRU 管理
executable:/home/app/redis3/redis-server
config_file:/home/app/redis3/./cluster/28001/redis-28001.conf  #cluster配置文件

# Clients
connected_clients:68  #连接的客户端数量
client_longest_output_list:0 #当前连接的客户端当中,最长的输出列表
client_biggest_input_buf:0 #当前连接的客户端当中,最大输入缓存
blocked_clients:0 #正在等待阻塞命令(BLPOP、BRPOP、BRPOPLPUSH)的客户端的数量

# Memory
used_memory:831391096 #由 Redis 分配器分配的内存总量(以字节为单位)
used_memory_human:792.88M
used_memory_rss:888795136 #Redis分配的内存总量(该值与top命令输出一致)
used_memory_rss_human:847.62M
used_memory_peak:833008000 #Redis 的内存消耗峰值(以字节为单位)
used_memory_peak_human:794.42M 
total_system_memory:33661575168
total_system_memory_human:31.35G
used_memory_lua:37888
used_memory_lua_human:37.00K
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
mem_fragmentation_ratio:1.07 #内存碎片比率
mem_allocator:jemalloc-4.0.3

# Persistence
loading:0 #一个标志值,记录了服务器是否正在载入持久化文件
rdb_changes_since_last_save:7358 #距离最近一次成功创建持久化文件之后,经过了多少秒
rdb_bgsave_in_progress:0 #一个标志值,记录了服务器是否正在创建 RDB 文件
rdb_last_save_time:1505285008 #最近一次成功创建 RDB 文件的 UNIX 时间戳
rdb_last_bgsave_status:ok #一个标志值,记录了最近一次创建 RDB 文件的结果是成功还是失败
rdb_last_bgsave_time_sec:10 #记录了最近一次创建 RDB 文件耗费的秒数
rdb_current_bgsave_time_sec:-1 #如果服务器正在创建 RDB 文件,那么这个值记录的就是当前的创建操作已经耗费的秒数
aof_enabled:1 #redis是否开启了aof
aof_rewrite_in_progress:0 #一个标志值,记录了服务器是否正在创建 AOF 文件
aof_rewrite_scheduled:0 #一个标志值,记录了在 RDB 文件创建完毕之后,是否需要执行预约的 AOF 重写操作
aof_last_rewrite_time_sec:4 #最近一次创建 AOF 文件耗费的时长
aof_current_rewrite_time_sec:-1 #如果服务器正在创建 AOF 文件,那么这个域记录的就是当前的创建操作已经耗费的秒数
aof_last_bgrewrite_status:ok #一个标志值,记录了最近一次创建 AOF 文件的结果是成功还是失败
aof_last_write_status:ok
aof_current_size:633883114
aof_base_size:428945179 #服务器启动时或者 AOF 重写最近一次执行之后,AOF 文件的大小
aof_pending_rewrite:0 # 一个标志值,记录了是否有 AOF 重写操作在等待 RDB 文件创建完毕之后执行
aof_buffer_length:0 #AOF 缓冲区的大小
aof_rewrite_buffer_length:0 #AOF 重写缓冲区的大小
aof_pending_bio_fsync:0 # 后台 I/O 队列里面,等待执行的 fsync 调用数量
aof_delayed_fsync:12 #被延迟的 fsync 调用数量

# Stats
total_connections_received:619104 #服务器已接受的连接请求数量
total_commands_processed:26830012 #服务器已执行的命令数量
instantaneous_ops_per_sec:1159 #服务器每秒钟执行的命令数量
total_net_input_bytes:1304952619 #redis网络入口流量字节数
total_net_output_bytes:1009790961 #redis网络出口流量字节数
instantaneous_input_kbps:55.85 #redis网络入口kps
instantaneous_output_kbps:3553.89 #redis网络出口kps
rejected_connections:0 #因为最大客户端数量限制而被拒绝的连接请求数量
sync_full:2
sync_partial_ok:0
sync_partial_err:0
expired_keys:0 #因为过期而被自动删除的数据库键数量
evicted_keys:0 #因为最大内存容量限制而被驱逐(evict)的键数量
keyspace_hits:0 #查找数据库键成功的次数
keyspace_misses:0 #查找数据库键失败的次数
pubsub_channels:0 #当前使用中的频道数量
pubsub_patterns:0 #当前使用中的模式数量
latest_fork_usec:2639
migrate_cached_sockets:0

# Replication
role:master #当前实例的角色master还是slave
connected_slaves:1
slave0:ip=172.18.1.162,port=28004,state=online,offset=674295829,lag=0
master_repl_offset:674298545
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:673249970
repl_backlog_histlen:1048576

# CPU
used_cpu_sys:718.26 #服务器耗费的累计系统 CPU
used_cpu_user:468.60 #服务器耗费的累计用户 CPU
used_cpu_sys_children:122.46 #后台进程耗费的系统 CPU 
used_cpu_user_children:835.28 #后台进程耗费的用户 CPU 

# Cluster
cluster_enabled:1 #是否开启集群模式 1代表是

# Keyspace
db0:keys=3322,expires=0,avg_ttl=0 #各个数据库的 key 的数量,以及带有生存期的 key 的数量

redis监控指标选择

上节所列指标列表条目较多,具体监控的时候根据做一些取舍,读者可以根据各自项目需要进行选择,本文选择几个重要的指标进行监控:

connected_clients:68  #连接的客户端数量
used_memory_rss_human:847.62M
used_memory_peak_human:794.42M 
total_connections_received:619104 #服务器已接受的连接请求数量
instantaneous_ops_per_sec:1159 #服务器每秒钟执行的命令数量
instantaneous_input_kbps:55.85 #redis网络入口kps
instantaneous_output_kbps:3553.89 #redis网络出口kps
rejected_connections:0 #因为最大客户端数量限制而被拒绝的连接请求数量
expired_keys:0 #因为过期而被自动删除的数据库键数量
evicted_keys:0 #因为最大内存容量限制而被驱逐(evict)的键数量
keyspace_hits:0 #查找数据库键成功的次数
keyspace_misses:0 #查找数据库键失败的次数

redis监控脚本编写

选择好需要监控的指标后,接下来就可以开始编写脚本(shell)了。
进入zabbix目录

[root@VM-302c2b77-2097-42c6-8527-0154a2685b76 zabbix]# mkdir scripts
[root@VM-302c2b77-2097-42c6-8527-0154a2685b76 zabbix]# cd scripts/
[root@VM-302c2b77-2097-42c6-8527-0154a2685b76 scripts]# vim chk_redis.sh
#!/bin/bash
# -------------------------------------------------------------------------------
# FileName:    check_redis.sh
# Revision:    1.0
# Date:        2017/09/13
# Author:      ct99.cn

REDIS_CLI_COMMAND="redis-cli"
REDIS_HOST="172.18.1.*"
REDIS_PORT="28001"

ARGS=1

if [ $# -ne "$ARGS" ];then
    echo "Please input one arguement:"
fi

case $1 in
    connected_clients)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "connected_clients" | awk -F':' '{print $2}'`
            echo $result
            ;;
    used_memory_rss_human)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "used_memory_rss_human" | awk -F':' '{print $2}'`
            echo $result
            ;;
    used_memory_peak_human)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "used_memory_peak_human" | awk -F':' '{print $2}'`
            echo $result
            ;;
    total_connections_received)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "total_connections_received" | awk -F':' '{print $2}'`
            echo $result
            ;;
    instantaneous_ops_per_sec)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "instantaneous_ops_per_sec" | awk -F':' '{print $2}'`
            echo $result
            ;;
    instantaneous_input_kbps)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "instantaneous_input_kbps" | awk -F':' '{print $2}'`
            echo $result
            ;;
    instantaneous_output_kbps)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "instantaneous_output_kbps" | awk -F':' '{print $2}'`
            echo $result
            ;;
    rejected_connections)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "rejected_connections" | awk -F':' '{print $2}'`
            echo $result
            ;;
    expired_keys)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "expired_keys" | awk -F':' '{print $2}'`
            echo $result
            ;;
    evicted_keys)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "evicted_keys" | awk -F':' '{print $2}'`
            echo $result
            ;;
    keyspace_hits)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "keyspace_hits" | awk -F':' '{print $2}'`
            echo $result
            ;;
    keyspace_misses)
        result=`$REDIS_CLI_COMMAND -h $REDIS_HOST -p $REDIS_PORT -a 'password' info | grep -w "keyspace_misses" | awk -F':' '{print $2}'`
            echo $result
            ;;

        *)
        echo "Usage:$0(connected_clients|used_memory_rss_human|used_memory_peak_human|instantaneous_ops_per_sec|instantaneous_input_kbps|instantaneous_output_kbps|rejected_connections|expired_keys|evicted_keys|keyspace_hits|keyspace_misses)"
        ;;
esac

检验下脚本是否有效,运行如上命令,可以看到得到数据66,表明当前有66个连接存在,脚本编写完成。

[root@VM-302c2b77-2097-42c6-8527-0154a2685b76 scripts]# ./chk_redis.sh connected_clients
66

zabbix客户端配置文件修改

打开zabbix客户端配置文件zabbix_agentd.conf

[root@VM-302c2b77-2097-42c6-8527-0154a2685b76 scripts]# vim ../etc/zabbix_agentd.conf
#在zabbix_agentd.conf文件末尾添加如下内容
#Redis monitor
UserParameter=Redis.Info[*],/usr/local/zabbix/scripts/chk_redis.sh $1

重启zabbix客户端

zabbix管理界面设置

1、创建模板
配置->模板->创建模板,模板名称和可见的名称都填上"Template App Redis",群组默认为Templates,点击添加,完成模板创建
2、在模板中创建应用集
找到刚创建的模本(Template App Redis)->点击进入应用集->创建应用集,名称中填入"Redis Info",点击添加,完成应用集合创建
3、在应用集中创建监控项
找到刚创建的模本(Template App Redis)->点击进入监控项->创建监控项,名称中填入"redis_connected_clients",键值填入"Redis.Info[connected_clients]",应用集选择刚刚创建的"Redis Info",点击添加,完成改监控项的创建(redis的connected_clients指标)。
这里说明一下:键值得Redis.Info对应于zabbix_agentd.conf中Redis.Info[*],connected_clients对应于zk_redis.sh中的connected_clients选项,组合到一起形成一个键值(也就是item)。其他指标的监控如此这般配置即可,道理是一样的,这里就不一一说明,直接按部就班配置各个指标即可。
4、将模本应用到主机
选择要监控的主机,点击模板,把刚才创建的模本(Template App Redis)添加进去,更新。

模板
复制后保存成xml文件导入zabbix管理平台,导出的版本是zabbix4.0.7

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>4.0</version>
    <date>2020-09-16T07:44:09Z</date>
    <groups>
        <group>
            <name>Templates</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>Template App Redis</template>
            <name>Template App Redis</name>
            <description/>
            <groups>
                <group>
                    <name>Templates</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>Redis Info</name>
                </application>
            </applications>
            <items>
                <item>
                    <name>redis_evicted_keys</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[evicted_keys]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing/>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
                <item>
                    <name>redis_expired_keys</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[expired_keys]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing/>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
                <item>
                    <name>redis_instantaneous_input_kbps</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[instantaneous_input_kbps]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>0</value_type>
                    <allowed_hosts/>
                    <units/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing/>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
                <item>
                    <name>redis_instantaneous_ops_per_sec</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[instantaneous_ops_per_sec]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing/>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
                <item>
                    <name>redis_instantaneous_output_kbps</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[instantaneous_output_kbps]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>0</value_type>
                    <allowed_hosts/>
                    <units/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing/>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
                <item>
                    <name>redis_keyspace_hits</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[keyspace_hits]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing/>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
                <item>
                    <name>redis_keyspace_misses</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[keyspace_misses]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing/>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
                <item>
                    <name>redis_rejected_connections</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[rejected_connections]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing/>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
                <item>
                    <name>redis_total_connections_received</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[total_connections_received]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing/>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
                <item>
                    <name>redis_used_memory_peak_human</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[used_memory_peak_human]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>0</value_type>
                    <allowed_hosts/>
                    <units>M</units>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing>
                        <step>
                            <type>2</type>
                            <params>M</params>
                        </step>
                    </preprocessing>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
                <item>
                    <name>redis_used_memory_rss_human</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>Redis.Info[used_memory_rss_human]</key>
                    <delay>1m</delay>
                    <history>90d</history>
                    <trends>365d</trends>
                    <status>0</status>
                    <value_type>0</value_type>
                    <allowed_hosts/>
                    <units>M</units>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Redis Info</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                    <preprocessing>
                        <step>
                            <type>2</type>
                            <params>M</params>
                        </step>
                    </preprocessing>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <output_format>0</output_format>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                    <master_item/>
                </item>
            </items>
            <discovery_rules/>
            <httptests/>
            <macros/>
            <templates/>
            <screens/>
        </template>
    </templates>
</zabbix_export>
赞(0) 打赏
未经允许不得转载:陈桂林博客 » Redis性能指标详解和监控办法
分享到

大佬们的评论 抢沙发

全新“一站式”建站,高质量、高售后的一条龙服务

微信 抖音 支付宝 百度 头条 快手全平台打通信息流

橙子建站.极速智能建站8折购买虚拟主机

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册