1640435254
#!/bin/bash

redis_clent="/beixi/application/redis/src/redis-cli"
redis_password=\'smQdAi8tOt5Q3PsO\'
redis_port=6379
redis_host=\'127.0.0.1\'

#redis 服务是否存活
function redis_status {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} PING
}

#redis 客户端连接数
function redis_connected_clients {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'connected_clients:\'|awk -F \':\' \'{print $2}\'
}

#redis 阻塞客户端数
function redis_blocked_clients {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'blocked_clients:\'|awk -F \':\' \'{print $2}\'
}

#redis 启动到当前的连接总数
function redis_total_connections_received {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'total_connections_received:\'|awk -F \':\' \'{print $2}\'
}

#redis 启动到当前执行的命令总数
function redis_total_commands_processed {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'total_commands_processed:\'|awk -F \':\' \'{print $2}\'
}


#redis 每秒处理的命令
function redis_instantaneous_ops_per_sec {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'instantaneous_ops_per_sec:\'|awk -F \':\' \'{print $2}\'
}

#redis 拒绝的连接数
function redis_rejected_connections {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'rejected_connections:\'|awk -F \':\' \'{print $2}\'
}

#redis 启动到现在过期的key
function redis_expired_keys {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'expired_keys:\'|awk -F \':\' \'{print $2}\'
}

#redis 内存不够被驱逐的key
function redis_evicted_keys {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'evicted_keys:\'|awk -F \':\' \'{print $2}\'
}

#redis 启动到现在命中的key
function redis_keyspace_hits {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'keyspace_hits:\'|awk -F \':\' \'{print $2}\'
}


#redis 启动到现在未命中的key
function redis_keyspace_misses {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'keyspace_misses:\'|awk -F \':\' \'{print $2}\'
}


#redis 数据使用内存,单位byts
function redis_used_memory {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'used_memory:\'|awk -F \':\' \'{print $2}\'
}

#redis 运行内存,单位byts
function redis_used_memory_rss {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'used_memory_rss:\'|awk -F \':\' \'{print $2}\'
}

#redis 运行内存峰值,单位byts
function redis_used_memory_peak {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'used_memory_peak:\'|awk -F \':\' \'{print $2}\'
}


#redis 主从复制中的slave数
function redis_connected_slaves {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info|grep \'connected_slaves:\'|awk -F \':\' \'{print $2}\'
}


#redis 当前所有的key
function redis_keys {
    ${redis_clent} -h ${redis_host} -p ${redis_port} -a ${redis_password} info |grep \'db0:keys\'|awk -F \'[=,]+\' \'{print $2}\'
}


use=$1

case $use in
    redis_status)
    redis_status
    ;;
    redis_connected_clients)
    redis_connected_clients
    ;;
    redis_blocked_clients)
    redis_blocked_clients
    ;;
    redis_total_connections_received)
    redis_total_connections_received
    ;;
    redis_total_commands_processed)
    redis_total_commands_processed
    ;;
    redis_instantaneous_ops_per_sec)
    redis_instantaneous_ops_per_sec
    ;;
    redis_rejected_connections)
    redis_rejected_connections
    ;;
    redis_expired_keys)
    redis_expired_keys
    ;;
    redis_evicted_keys)
    redis_evicted_keys
    ;;
    redis_keyspace_hits)
    redis_keyspace_hits
    ;;
    redis_keyspace_misses)
    redis_keyspace_misses
    ;;
    redis_used_memory)
    redis_used_memory
    ;;
    redis_used_memory_rss)
    redis_used_memory_rss
    ;;
    redis_used_memory_peak)
    redis_used_memory_peak
    ;;
    redis_connected_slaves)
    redis_connected_slaves
    ;;
    redis_keys)
    redis_keys
    ;;

    *)
    echo 0
    ;;
esac

 

Python 安装 Redis 包。

[root@localhost script]# yum install python-pip
[root@localhost script]# pip install redis

 

离线安装Python第三方包。

下载包

再pip install 《包名》

 

 

Zabbix-agent配置

[root@localhost ~]# grep \'^U\' /etc/zabbix/zabbix_agentd.conf
UserParameter=Zabbix_Redis_Status[*],/beixi/application/Python/bin/python3 /etc/zabbix/script/zabbix-redis.py $1

 

Python 脚本 Zabbix 实现 Redis监控。

[root@localhost ~]# vim /etc/zabbix/script/zabbix-redis.py
#!/beixi/application/Python/bin/python3

"""
DOC: https://www.cnblogs.com/1640435254/articles/14290613.html
Auth: fan


"""

from redis import Redis
import sys
import os

redisParameter = sys.argv[1]
host="127.0.0.1"
port=\'6379\'
password=\'beixi20200308\'
redisProcessName=\'/beixi/application/redis\'

redisExample=Redis(host=host,port=port,password=password)
re = redisExample.info()

def RedisStatus(Parameter):
    if Parameter == "process":
        os.system("ps -ef|grep {} |grep -v grep|wc -l".format(redisProcessName))
        return  
    print(re[Parameter])

RedisStatus(redisParameter)

  

 

模板

{
    "zabbix_export": {
        "version": "5.2",
        "date": "2021-04-08T03:47:02Z",
        "groups": [
            {
                "name": "\u500d\u84f0\u963f\u91cc\u4e91"
            }
        ],
        "templates": [
            {
                "template": "Zabbix Mysql Custom Template",
                "name": "Zabbix Mysql Custom Template",
                "description": "Mysql \u76d1\u63a7\u6a21\u677f",
                "groups": [
                    {
                        "name": "\u500d\u84f0\u963f\u91cc\u4e91"
                    }
                ],
                "applications": [
                    {
                        "name": "Custom monitor set"
                    }
                ],
                "items": [
                    {
                        "name": "\u7531\u4e8e\u5ba2\u6237\u7aef\u6ca1\u6709\u6b63\u786e\u5173\u95ed\u8fde\u63a5\u5bfc\u81f4\u5ba2\u6237\u7aef\u7ec8\u6b62\u800c\u4e2d\u65ad\u7684\u8fde\u63a5\u6570",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Aborted_clients]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "\u8bd5\u56fe\u8fde\u63a5\u5230MySQL\u670d\u52a1\u5668\u800c\u5931\u8d25\u7684\u8fde\u63a5\u6570",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Aborted_connects]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "\u8bd5\u56fe\u8fde\u63a5\u5230(\u4e0d\u7ba1\u662f\u5426\u6210\u529f)MySQL\u670d\u52a1\u5668\u7684\u8fde\u63a5\u6570",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Connections]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "\u670d\u52a1\u5668\u6267\u884c\u8bed\u53e5\u65f6\u5728\u786c\u76d8\u4e0a\u81ea\u52a8\u521b\u5efa\u7684\u4e34\u65f6\u8868\u7684\u6570\u91cf",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Created_tmp_disk_tables]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "\u5df2\u7ecf\u521b\u5efa\u7684\u4e34\u65f6\u6587\u4ef6\u7684\u6570\u91cf",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Created_tmp_files]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "\u6570\u636e\u8bfb\u603b\u6570\u91cf",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Innodb_data_reads]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "\u6570\u636e\u5199\u603b\u6570\u91cf",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Innodb_data_written]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "\u5df2\u7ecf\u6253\u5f00\u7684\u8868\u7684\u6570\u91cf",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Opened_files]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "\u6253\u5f00\u7684\u6587\u4ef6\u7684\u6570\u76ee",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Open_files]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "\u5f53\u524d\u6253\u5f00\u7684\u8868\u7684\u6570\u91cf",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Open_tables]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Mysql process",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[process]",
                        "history": "30d",
                        "trends": "90d",
                        "description": "mysql \u8fdb\u7a0b",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ],
                        "triggers": [
                            {
                                "expression": "{last()}=0",
                                "name": "Zabbix Mysql process",
                                "priority": "DISASTER"
                            }
                        ]
                    },
                    {
                        "name": "MySQL QPS",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[QPS]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "\u5f53\u524d\u6253\u5f00\u7684\u8fde\u63a5\u7684\u6570\u91cf",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[Threads_connected]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "MySQL TPS",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Mysql_Status[TPS]",
                        "history": "30d",
                        "trends": "90d",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    }
                ]
            },
            {
                "template": "Zabbix Redis Custom Template",
                "name": "Zabbix Redis Custom Template",
                "description": "Zabbox Redis \u81ea\u5b9a\u4e49\u6a21\u677f",
                "groups": [
                    {
                        "name": "\u500d\u84f0\u963f\u91cc\u4e91"
                    }
                ],
                "applications": [
                    {
                        "name": "Custom monitor set"
                    }
                ],
                "items": [
                    {
                        "name": "Zabbix Redis  client_longest_output_list",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[client_longest_output_list]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_client",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_client]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_command",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_command]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_del",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_del]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_hgetall",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_hgetall]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_hmset",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_hmset]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_info",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_info]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_keys",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_keys]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_ping",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_ping]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_psync",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_psync]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_replconf",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_replconf]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  cmdstat_set",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[cmdstat_set]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  connected_clients",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[connected_clients]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  instantaneous_ops_per_sec",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[instantaneous_ops_per_sec]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  instantaneous_output_kbps",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[instantaneous_output_kbps]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  keyspace_hits",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[keyspace_hits]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  keyspace_misses",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[keyspace_misses]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  maxmemory",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[maxmemory]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  maxmemory_human",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[maxmemory_human]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  process",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[process]",
                        "delay": "1s",
                        "description": "\u76d1\u63a7Redis \u8fd0\u884c\u5b9e\u4f8b\u8fdb\u7a0b",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ],
                        "triggers": [
                            {
                                "expression": "{last()}=0",
                                "name": "Zabbix Redis process",
                                "priority": "DISASTER",
                                "manual_close": "YES"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  rejected_connections",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[rejected_connections]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  total_commands_processed",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[total_commands_processed]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  total_net_input_bytes",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[total_net_input_bytes]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  total_system_memory",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[total_system_memory]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  total_system_memory_human",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[total_system_memory_human]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  used_cpu_sys",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[used_cpu_sys]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  used_cpu_sys_children",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[used_cpu_sys_children]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  used_cpu_user",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[used_cpu_user]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  used_cpu_user_children",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[used_cpu_user_children]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  used_memory",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[used_memory]",
                        "units": "byte",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  used_memory_human",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[used_memory_human]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  used_memory_peak_human",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[used_memory_peak_human]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  used_memory_tss_human",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[used_memory_rss_human]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    },
                    {
                        "name": "Zabbix Redis  used_memory_startup",
                        "type": "ZABBIX_ACTIVE",
                        "key": "Zabbix_Redis_Status[used_memory_startup]",
                        "applications": [
                            {
                                "name": "Custom monitor set"
                            }
                        ]
                    }
                ]
            }
        ],
        "graphs": [
            {
                "name": "Zabbix Mysql lnfo",
                "graph_items": [
                    {
                        "sortorder": "1",
                        "color": "FC6EA3",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[QPS]"
                        }
                    },
                    {
                        "sortorder": "2",
                        "color": "6C59DC",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[TPS]"
                        }
                    },
                    {
                        "sortorder": "3",
                        "color": "C7A72D",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Created_tmp_files]"
                        }
                    },
                    {
                        "sortorder": "4",
                        "color": "BA2A5D",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Opened_files]"
                        }
                    },
                    {
                        "sortorder": "5",
                        "color": "F230E0",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Open_tables]"
                        }
                    },
                    {
                        "sortorder": "6",
                        "color": "5CCD18",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Threads_connected]"
                        }
                    },
                    {
                        "sortorder": "7",
                        "color": "BB2A02",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Open_files]"
                        }
                    },
                    {
                        "sortorder": "8",
                        "color": "AC41A5",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Innodb_data_written]"
                        }
                    },
                    {
                        "sortorder": "9",
                        "color": "89ABF8",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Innodb_data_reads]"
                        }
                    },
                    {
                        "sortorder": "10",
                        "color": "7EC25C",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Created_tmp_disk_tables]"
                        }
                    },
                    {
                        "sortorder": "11",
                        "color": "3165D5",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Aborted_clients]"
                        }
                    },
                    {
                        "sortorder": "12",
                        "color": "79A277",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Connections]"
                        }
                    },
                    {
                        "sortorder": "13",
                        "color": "AA73DE",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[Aborted_connects]"
                        }
                    },
                    {
                        "sortorder": "14",
                        "color": "7EC25C",
                        "item": {
                            "host": "Zabbix Mysql Custom Template",
                            "key": "Zabbix_Mysql_Status[process]"
                        }
                    }
                ]
            },
            {
                "name": "Zabbix Redis  Info",
                "graph_items": [
                    {
                        "sortorder": "1",
                        "color": "199C0D",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[client_longest_output_list]"
                        }
                    },
                    {
                        "sortorder": "2",
                        "color": "F63100",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_client]"
                        }
                    },
                    {
                        "sortorder": "3",
                        "color": "2774A4",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_command]"
                        }
                    },
                    {
                        "sortorder": "4",
                        "color": "F7941D",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_del]"
                        }
                    },
                    {
                        "sortorder": "5",
                        "color": "FC6EA3",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_hgetall]"
                        }
                    },
                    {
                        "sortorder": "6",
                        "color": "6C59DC",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_hmset]"
                        }
                    },
                    {
                        "sortorder": "7",
                        "color": "C7A72D",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_info]"
                        }
                    },
                    {
                        "sortorder": "8",
                        "color": "BA2A5D",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_keys]"
                        }
                    },
                    {
                        "sortorder": "9",
                        "color": "F230E0",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_ping]"
                        }
                    },
                    {
                        "sortorder": "10",
                        "color": "5CCD18",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_psync]"
                        }
                    },
                    {
                        "sortorder": "11",
                        "color": "BB2A02",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_replconf]"
                        }
                    },
                    {
                        "sortorder": "12",
                        "color": "AC41A5",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[cmdstat_set]"
                        }
                    },
                    {
                        "sortorder": "13",
                        "color": "89ABF8",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[connected_clients]"
                        }
                    },
                    {
                        "sortorder": "14",
                        "color": "7EC25C",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[instantaneous_ops_per_sec]"
                        }
                    },
                    {
                        "sortorder": "15",
                        "color": "3165D5",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[instantaneous_output_kbps]"
                        }
                    },
                    {
                        "sortorder": "16",
                        "color": "79A277",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[keyspace_hits]"
                        }
                    },
                    {
                        "sortorder": "17",
                        "color": "AA73DE",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[keyspace_misses]"
                        }
                    },
                    {
                        "sortorder": "18",
                        "color": "FD5434",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[maxmemory]"
                        }
                    },
                    {
                        "sortorder": "19",
                        "color": "F21C3E",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[maxmemory_human]"
                        }
                    },
                    {
                        "sortorder": "20",
                        "color": "87AC4D",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[rejected_connections]"
                        }
                    },
                    {
                        "sortorder": "21",
                        "color": "E89DF4",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[total_commands_processed]"
                        }
                    },
                    {
                        "sortorder": "22",
                        "color": "199C0D",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[total_net_input_bytes]"
                        }
                    },
                    {
                        "sortorder": "23",
                        "color": "F63100",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[total_system_memory]"
                        }
                    },
                    {
                        "sortorder": "24",
                        "color": "2774A4",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[total_system_memory_human]"
                        }
                    },
                    {
                        "sortorder": "25",
                        "color": "F7941D",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[used_cpu_sys]"
                        }
                    },
                    {
                        "sortorder": "26",
                        "color": "FC6EA3",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[used_cpu_sys_children]"
                        }
                    },
                    {
                        "sortorder": "27",
                        "color": "6C59DC",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[used_cpu_user]"
                        }
                    },
                    {
                        "sortorder": "28",
                        "color": "C7A72D",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[used_cpu_user_children]"
                        }
                    },
                    {
                        "sortorder": "29",
                        "color": "BA2A5D",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[used_memory]"
                        }
                    },
                    {
                        "sortorder": "30",
                        "color": "F230E0",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[used_memory_peak_human]"
                        }
                    },
                    {
                        "sortorder": "31",
                        "color": "5CCD18",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[used_memory_startup]"
                        }
                    },
                    {
                        "sortorder": "32",
                        "color": "BB2A02",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[used_memory_rss_human]"
                        }
                    },
                    {
                        "sortorder": "33",
                        "color": "AC41A5",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[used_memory_human]"
                        }
                    },
                    {
                        "sortorder": "34",
                        "color": "89ABF8",
                        "item": {
                            "host": "Zabbix Redis Custom Template",
                            "key": "Zabbix_Redis_Status[process]"
                        }
                    }
                ]
            }
        ]
    }
}

  

 

分类:

技术点:

相关文章:

  • 2021-12-19
  • 2021-05-09
  • 2021-12-02
  • 2021-05-15
  • 2021-07-13
  • 2021-12-19
  • 2021-12-19
  • 2021-12-19
猜你喜欢
  • 2021-12-19
  • 2021-10-25
  • 2021-12-11
  • 2021-05-24
  • 2021-05-31
相关资源
相似解决方案