zabbix配置redis监控

1 redis监控需要用到zabbix_agent2的版本,该版本涵盖了zabbix_agent1的全部功能。安装zabbix_agent2

yum install zabbix-agent2-5.0.13-1.el7.x86_64 -y

2 配置zabbix_agent2.conf的脚本,将redis的相关信息配置。vi /etc/zabbix/zabbix_agent2.conf

### Option: Plugins.Redis.Sessions.*.Uri

# Uri to connect. "*" should be replaced with a session name.

#

# Mandatory: no

# Range:

# Must matches the URI format.

# Supported schemas: "tcp" and "unix".

# Embedded credentials will be ignored.

# Default:

Plugins.Redis.Sessions.Redis.Uri=tcp://192.168.11.16:6379

3 重启zabbix_agent2

systemctl restart zabbix-agent2

4 配置开机启动

systemctl enable zabbix-agent2

注意:需将原有的zabbix-agent取消, systemctl disable zabbix-agent

5 在zabbix web界面配置模板

6 监控效果

官网资料:

概述

Zabbix agent 2中的Redis插件提供了一个原生的Zabbix解决方案来监控Redis服务器(内存数据结构存储)。

Redis 插件从 Zabbix agent 2 版本 4.4.5 开始可用。

自 Zabbix 4.4.8 起,可使用此页面上描述的更新插件版本

该插件使用RESP 协议(通过 TCP 和 Unix 套接字)实现来收集所有必要的指标。

官方提供了 Redis 模板,您可以根据需要对其进行扩展或创建自己的模板。

安装

该插件作为 Zabbix agent 2 的一部分提供,不需要任何特殊的安装步骤。一旦安装了 Zabbix agent 2,插件就可以工作了。您唯一需要做的就是确保 Redis 实例可用于连接。

配置

该插件的参数使用Zabbix agent 2的配置文件

连接

该插件支持同时从多个 Redis 实例收集指标。本地和远程实例都可以被监控。支持 TCP 和 Unix 套接字连接。

该插件在打开状态下保持与 Redis 实例的连接。由于连接数量较少,因此好处是减少了网络拥塞、延迟以及 CPU 和内存使用。客户端库负责这个。

每个连接的基础是一个连接池。在执行第一个度量标准请求(需要连接)(延迟连接)的同时初始化连接:

  • 请求在执行时间上受到超时选项的限制(请参阅Plugin.Redis.Timeout 配置参数);
  • 一个特殊的计时器关闭没有被访问太久的连接(见Plugin.Redis.KeepAlive 配置参数)。

验证

该插件可以使用指定为密钥参数或在命名会话中指定的密码进行身份验证。嵌入的URI凭据 (userinfo) 将被忽略。

命名会话

命名会话允许您为每个 Redis 实例定义特定参数。目前,只支持两个参数:Uri和Password。如果您有多个具有不同凭据的实例,这些会很有用。例如:如果您有两个实例:“Redis1”和“Redis2”,您需要将这些选项添加到您的代理 2 配置中:

Plugins.Redis.Sessions.Redis1.Uri=tcp://127.0.0.1:6379 Plugins.Redis.Sessions.Redis1.Password= Plugins.Redis.Sessions.Redis2.Uri=tcp://127.0.0.1:6380 Plugins.Redis.Sessions.Redis2.Password=

然后,您可以connString在项目键中使用这些名称而不是 URI,例如:

redis.info[Redis1] redis.info[Redis2]

 与项目密钥参数或用户宏相比,命名会话提供了一种更安全的凭据存储方式。

指标

支持以下项目:

  • redis.config[,, ]
  • redis.info[,,

    ]

  • redis.ping[, ]
  • redis.slowlog.count[, ]

另请参阅:Agent 2 物品键

参数优先级

参数覆盖有四个级别:

  1. 硬编码的默认值 →
  2. 一级配置参数 (Plugins.Redis.*) →
  3. 命名会话 (Plugins.Redis.Sessions..*) →
  4. 项目关键参数

故障排除

该插件使用 Zabbix 代理日志。提高 Zabbix 代理上的调试级别以查看日志中的更多信息。

Redis monitoring and integration with Zabbix

Source: Browse Zabbix / Zabbix - ZABBIX GIT

Redis by Zabbix agent 2

Overview

For Zabbix version: 5.4 and higher

The template to monitor Redis server by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.

Template Redis by Zabbix agent 2 — collects metrics by polling zabbix-agent2.

This template was tested on:

  • Redis, version 5.0.6, 4.0.14, 3.0.6

Setup

See Zabbix template operation for basic instructions.

Setup and configure zabbix-agent2 compiled with the Redis monitoring plugin (ZBXNEXT-5428-4.3).

Test availability: zabbix_get -s redis-master -k redis.ping

Zabbix configuration

No specific Zabbix configuration is required.

Macros used

Name

Description

Default

{$REDIS.CLIENTS.PRC.MAX.WARN}

Maximum percentage of connected clients

80

{$REDIS.CONN.URI}

Connection string in the URI format (password is not used). This param overwrites a value configured in the "Server" option of the configuration file (if it's set), otherwise, the plugin's default value is used: "tcp://localhost:6379"

tcp://localhost:6379

{$REDIS.LLD.FILTER.DB.MATCHES}

Filter of discoverable databases

.*

{$REDIS.LLD.FILTER.DB.NOT_MATCHES}

Filter to exclude discovered databases

CHANGE_IF_NEEDED

{$REDIS.LLD.PROCESS_NAME}

Redis server process name for LLD

redis-server

{$REDIS.MEM.FRAG_RATIO.MAX.WARN}

Maximum memory fragmentation ratio

1.5

{$REDIS.MEM.PUSED.MAX.WARN}

Maximum percentage of memory used

90

{$REDIS.PROCESS_NAME}

Redis server process name

redis-server

{$REDIS.REPL.LAG.MAX.WARN}

Maximum replication lag in seconds

30s

{$REDIS.SLOWLOG.COUNT.MAX.WARN}

Maximum number of slowlog entries per second

1

Template links

There are no template links in this template.

Discovery rules

Name

Description

Type

Key and additional info

Keyspace discovery

Individual keyspace metrics

DEPENDENT

redis.keyspace.discovery

Preprocessing:

- JAVASCRIPT: Text is too long. Please see the template.

Filter:

AND

- A: {#DB} MATCHES_REGEX {$REDIS.LLD.FILTER.DB.MATCHES}

- B: {#DB} NOT_MATCHES_REGEX {$REDIS.LLD.FILTER.DB.NOT_MATCHES}

AOF metrics discovery

If AOF is activated, additional metrics will be added

DEPENDENT

redis.persistence.aof.discovery

Preprocessing:

- JAVASCRIPT: Text is too long. Please see the template.

Slave metrics discovery

If the instance is a replica, additional metrics are provided

DEPENDENT

redis.replication.slave.discovery

Preprocessing:

- JAVASCRIPT: Text is too long. Please see the template.

Replication metrics discovery

If the instance is the master and the slaves are connected, additional metrics are provided

DEPENDENT

redis.replication.master.discovery

Preprocessing:

- JAVASCRIPT: Text is too long. Please see the template.

Process metrics discovery

Collect metrics by Zabbix agent if it exists

ZABBIX_PASSIVE

proc.num["{$REDIS.LLD.PROCESS_NAME}"]

Preprocessing:

- JAVASCRIPT: return JSON.stringify(value > 0 ? [{'{#SINGLETON}': ''}] : []);

Version 4+ metrics discovery

Additional metrics for versions 4+

DEPENDENT

redis.metrics.v4.discovery

Preprocessing:

- JSONPATH: $.Server.redis_version

- JAVASCRIPT: return JSON.stringify(parseInt(value.split('.')[0]) >= 4 ? [{'{#SINGLETON}': ''}] : []);

Version 5+ metrics discovery

Additional metrics for versions 5+

DEPENDENT

redis.metrics.v5.discovery

Preprocessing:

- JSONPATH: $.Server.redis_version

- JAVASCRIPT: return JSON.stringify(parseInt(value.split('.')[0]) >= 5 ? [{'{#SINGLETON}': ''}] : []);

Items collected

Group

Name

Description

Type

Key and additional info

Redis

Redis: Ping

ZABBIX_PASSIVE

redis.ping["{$REDIS.CONN.URI}"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

Redis

Redis: Slowlog entries per second

ZABBIX_PASSIVE

redis.slowlog.count["{$REDIS.CONN.URI}"]

Preprocessing:

- CHANGE_PER_SECOND

Redis

Redis: CPU sys

System CPU consumed by the Redis server

DEPENDENT

redis.cpu.sys

Preprocessing:

- JSONPATH: $.CPU.used_cpu_sys

Redis

Redis: CPU sys children

System CPU consumed by the background processes

DEPENDENT

redis.cpu.sys_children

Preprocessing:

- JSONPATH: $.CPU.used_cpu_sys_children

Redis

Redis: CPU user

User CPU consumed by the Redis server

DEPENDENT

redis.cpu.user

Preprocessing:

- JSONPATH: $.CPU.used_cpu_user

Redis

Redis: CPU user children

User CPU consumed by the background processes

DEPENDENT

redis.cpu.user_children

Preprocessing:

- JSONPATH: $.CPU.used_cpu_user_children

Redis

Redis: Blocked clients

The number of connections waiting on a blocking call

DEPENDENT

redis.clients.blocked

Preprocessing:

- JSONPATH: $.Clients.blocked_clients

Redis

Redis: Max input buffer

The biggest input buffer among current client connections

DEPENDENT

redis.clients.max_input_buffer

Preprocessing:

- JAVASCRIPT: Text is too long. Please see the template.

Redis

Redis: Max output buffer

The biggest output buffer among current client connections

DEPENDENT

redis.clients.max_output_buffer

Preprocessing:

- JAVASCRIPT: Text is too long. Please see the template.

Redis

Redis: Connected clients

The number of connected clients

DEPENDENT

redis.clients.connected

Preprocessing:

- JSONPATH: $.Clients.connected_clients

Redis

Redis: Cluster enabled

Indicate Redis cluster is enabled

DEPENDENT

redis.cluster.enabled

Preprocessing:

- JSONPATH: $.Cluster.cluster_enabled

Redis

Redis: Memory used

Total number of bytes allocated by Redis using its allocator

DEPENDENT

redis.memory.used_memory

Preprocessing:

- JSONPATH: $.Memory.used_memory

Redis

Redis: Memory used Lua

Amount of memory used by the Lua engine

DEPENDENT

redis.memory.used_memory_lua

Preprocessing:

- JSONPATH: $.Memory.used_memory_lua

Redis

Redis: Memory used peak

Peak memory consumed by Redis (in bytes)

DEPENDENT

redis.memory.used_memory_peak

Preprocessing:

- JSONPATH: $.Memory.used_memory_peak

Redis

Redis: Memory used RSS

Number of bytes that Redis allocated as seen by the operating system

DEPENDENT

redis.memory.used_memory_rss

Preprocessing:

- JSONPATH: $.Memory.used_memory_rss

Redis

Redis: Memory fragmentation ratio

This ratio is an indication of memory mapping efficiency:

— Value over 1.0 indicate that memory fragmentation is very likely. Consider restarting the Redis server so the operating system can recover fragmented memory, especially with a ratio over 1.5.

— Value under 1.0 indicate that Redis likely has insufficient memory available. Consider optimizing memory usage or adding more RAM.

Note: If your peak memory usage is much higher than your current memory usage, the memory fragmentation ratio may be unreliable.

https://redis.io/topics/memory-optimization

DEPENDENT

redis.memory.fragmentation_ratio

Preprocessing:

- JSONPATH: $.Memory.mem_fragmentation_ratio

Redis

Redis: AOF current rewrite time sec

Duration of the on-going AOF rewrite operation if any

DEPENDENT

redis.persistence.aof_current_rewrite_time_sec

Preprocessing:

- JSONPATH: $.Persistence.aof_current_rewrite_time_sec

Redis

Redis: AOF enabled

Flag indicating AOF logging is activated

DEPENDENT

redis.persistence.aof_enabled

Preprocessing:

- JSONPATH: $.Persistence.aof_enabled

Redis

Redis: AOF last bgrewrite status

Status of the last AOF rewrite operation

DEPENDENT

redis.persistence.aof_last_bgrewrite_status

Preprocessing:

- JSONPATH: $.Persistence.aof_last_bgrewrite_status

- BOOL_TO_DECIMAL

Redis

Redis: AOF last rewrite time sec

Duration of the last AOF rewrite

DEPENDENT

redis.persistence.aof_last_rewrite_time_sec

Preprocessing:

- JSONPATH: $.Persistence.aof_last_rewrite_time_sec

Redis

Redis: AOF last write status

Status of the last write operation to the AOF

DEPENDENT

redis.persistence.aof_last_write_status

Preprocessing:

- JSONPATH: $.Persistence.aof_last_write_status

- BOOL_TO_DECIMAL

Redis

Redis: AOF rewrite in progress

Flag indicating a AOF rewrite operation is on-going

DEPENDENT

redis.persistence.aof_rewrite_in_progress

Preprocessing:

- JSONPATH: $.Persistence.aof_rewrite_in_progress

Redis

Redis: AOF rewrite scheduled

Flag indicating an AOF rewrite operation will be scheduled once the on-going RDB save is complete

DEPENDENT

redis.persistence.aof_rewrite_scheduled

Preprocessing:

- JSONPATH: $.Persistence.aof_rewrite_scheduled

Redis

Redis: Dump loading

Flag indicating if the load of a dump file is on-going

DEPENDENT

redis.persistence.loading

Preprocessing:

- JSONPATH: $.Persistence.loading

Redis

Redis: RDB bgsave in progress

"1" if bgsave is in progress and "0" otherwise

DEPENDENT

redis.persistence.rdb_bgsave_in_progress

Preprocessing:

- JSONPATH: $.Persistence.rdb_bgsave_in_progress

Redis

Redis: RDB changes since last save

Number of changes since the last background save

DEPENDENT

redis.persistence.rdb_changes_since_last_save

Preprocessing:

- JSONPATH: $.Persistence.rdb_changes_since_last_save

Redis

Redis: RDB current bgsave time sec

Duration of the on-going RDB save operation if any

DEPENDENT

redis.persistence.rdb_current_bgsave_time_sec

Preprocessing:

- JSONPATH: $.Persistence.rdb_current_bgsave_time_sec

Redis

Redis: RDB last bgsave status

Status of the last RDB save operation

DEPENDENT

redis.persistence.rdb_last_bgsave_status

Preprocessing:

- JSONPATH: $.Persistence.rdb_last_bgsave_status

- BOOL_TO_DECIMAL

Redis

Redis: RDB last bgsave time sec

Duration of the last bg_save operation

DEPENDENT

redis.persistence.rdb_last_bgsave_time_sec

Preprocessing:

- JSONPATH: $.Persistence.rdb_last_bgsave_time_sec

Redis

Redis: RDB last save time

Epoch-based timestamp of last successful RDB save

DEPENDENT

redis.persistence.rdb_last_save_time

Preprocessing:

- JSONPATH: $.Persistence.rdb_last_save_time

Redis

Redis: Connected slaves

Number of connected slaves

DEPENDENT

redis.replication.connected_slaves

Preprocessing:

- JSONPATH: $.Replication.connected_slaves

Redis

Redis: Replication backlog active

Flag indicating replication backlog is active

DEPENDENT

redis.replication.repl_backlog_active

Preprocessing:

- JSONPATH: $.Replication.repl_backlog_active

Redis

Redis: Replication backlog first byte offset

The master offset of the replication backlog buffer

DEPENDENT

redis.replication.repl_backlog_first_byte_offset

Preprocessing:

- JSONPATH: $.Replication.repl_backlog_first_byte_offset

Redis

Redis: Replication backlog history length

Amount of data in the backlog sync buffer

DEPENDENT

redis.replication.repl_backlog_histlen

Preprocessing:

- JSONPATH: $.Replication.repl_backlog_histlen

Redis

Redis: Replication backlog size

Total size in bytes of the replication backlog buffer

DEPENDENT

redis.replication.repl_backlog_size

Preprocessing:

- JSONPATH: $.Replication.repl_backlog_size

Redis

Redis: Replication role

Value is "master" if the instance is replica of no one, or "slave" if the instance is a replica of some master instance. Note that a replica can be master of another replica (chained replication).

DEPENDENT

redis.replication.role

Preprocessing:

- JSONPATH: $.Replication.role

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Redis

Redis: Master replication offset

Replication offset reported by the master

DEPENDENT

redis.replication.master_repl_offset

Preprocessing:

- JSONPATH: $.Replication.master_repl_offset

Redis

Redis: Process id

PID of the server process

DEPENDENT

redis.server.process_id

Preprocessing:

- JSONPATH: $.Server.process_id

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Redis

Redis: Redis mode

The server's mode ("standalone", "sentinel" or "cluster")

DEPENDENT

redis.server.redis_mode

Preprocessing:

- JSONPATH: $.Server.redis_mode

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Redis

Redis: Redis version

Version of the Redis server

DEPENDENT

redis.server.redis_version

Preprocessing:

- JSONPATH: $.Server.redis_version

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Redis

Redis: TCP port

TCP/IP listen port

DEPENDENT

redis.server.tcp_port

Preprocessing:

- JSONPATH: $.Server.tcp_port

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Redis

Redis: Uptime

Number of seconds since Redis server start

DEPENDENT

redis.server.uptime

Preprocessing:

- JSONPATH: $.Server.uptime_in_seconds

Redis

Redis: Evicted keys

Number of evicted keys due to maxmemory limit

DEPENDENT

redis.stats.evicted_keys

Preprocessing:

- JSONPATH: $.Stats.evicted_keys

Redis

Redis: Expired keys

Total number of key expiration events

DEPENDENT

redis.stats.expired_keys

Preprocessing:

- JSONPATH: $.Stats.expired_keys

Redis

Redis: Instantaneous input bytes per second

The network's read rate per second in KB/sec

DEPENDENT

redis.stats.instantaneous_input.rate

Preprocessing:

- JSONPATH: $.Stats.instantaneous_input_kbps

- MULTIPLIER: 1024

Redis

Redis: Instantaneous operations per sec

Number of commands processed per second

DEPENDENT

redis.stats.instantaneous_ops.rate

Preprocessing:

- JSONPATH: $.Stats.instantaneous_ops_per_sec

Redis

Redis: Instantaneous output bytes per second

The network's write rate per second in KB/sec

DEPENDENT

redis.stats.instantaneous_output.rate

Preprocessing:

- JSONPATH: $.Stats.instantaneous_output_kbps

- MULTIPLIER: 1024

Redis

Redis: Keyspace hits

Number of successful lookup of keys in the main dictionary

DEPENDENT

redis.stats.keyspace_hits

Preprocessing:

- JSONPATH: $.Stats.keyspace_hits

Redis

Redis: Keyspace misses

Number of failed lookup of keys in the main dictionary

DEPENDENT

redis.stats.keyspace_misses

Preprocessing:

- JSONPATH: $.Stats.keyspace_misses

Redis

Redis: Latest fork usec

Duration of the latest fork operation in microseconds

DEPENDENT

redis.stats.latest_fork_usec

Preprocessing:

- JSONPATH: $.Stats.latest_fork_usec

- MULTIPLIER: 1.0E-5

Redis

Redis: Migrate cached sockets

The number of sockets open for MIGRATE purposes

DEPENDENT

redis.stats.migrate_cached_sockets

Preprocessing:

- JSONPATH: $.Stats.migrate_cached_sockets

Redis

Redis: Pubsub channels

Global number of pub/sub channels with client subscriptions

DEPENDENT

redis.stats.pubsub_channels

Preprocessing:

- JSONPATH: $.Stats.pubsub_channels

Redis

Redis: Pubsub patterns

Global number of pub/sub pattern with client subscriptions

DEPENDENT

redis.stats.pubsub_patterns

Preprocessing:

- JSONPATH: $.Stats.pubsub_patterns

Redis

Redis: Rejected connections

Number of connections rejected because of maxclients limit

DEPENDENT

redis.stats.rejected_connections

Preprocessing:

- JSONPATH: $.Stats.rejected_connections

Redis

Redis: Sync full

The number of full resyncs with replicas

DEPENDENT

redis.stats.sync_full

Preprocessing:

- JSONPATH: $.Stats.sync_full

Redis

Redis: Sync partial err

The number of denied partial resync requests

DEPENDENT

redis.stats.sync_partial_err

Preprocessing:

- JSONPATH: $.Stats.sync_partial_err

Redis

Redis: Sync partial ok

The number of accepted partial resync requests

DEPENDENT

redis.stats.sync_partial_ok

Preprocessing:

- JSONPATH: $.Stats.sync_partial_ok

Redis

Redis: Total commands processed

Total number of commands processed by the server

DEPENDENT

redis.stats.total_commands_processed

Preprocessing:

- JSONPATH: $.Stats.total_commands_processed

Redis

Redis: Total connections received

Total number of connections accepted by the server

DEPENDENT

redis.stats.total_connections_received

Preprocessing:

- JSONPATH: $.Stats.total_connections_received

Redis

Redis: Total net input bytes

The total number of bytes read from the network

DEPENDENT

redis.stats.total_net_input_bytes

Preprocessing:

- JSONPATH: $.Stats.total_net_input_bytes

Redis

Redis: Total net output bytes

The total number of bytes written to the network

DEPENDENT

redis.stats.total_net_output_bytes

Preprocessing:

- JSONPATH: $.Stats.total_net_output_bytes

Redis

Redis: Max clients

Max number of connected clients at the same time.

Once the limit is reached Redis will close all the new connections sending an error "max number of clients reached".

DEPENDENT

redis.config.maxclients

Preprocessing:

- JSONPATH: $.maxclients

- DISCARD_UNCHANGED_HEARTBEAT: 30m

Redis

DB {#DB}: Average TTL

Average TTL

DEPENDENT

redis.db.avg_ttl["{#DB}"]

Preprocessing:

- JSONPATH: $.Keyspace["{#DB}"].avg_ttl

- MULTIPLIER: 0.001

Redis

DB {#DB}: Expires

Number of keys with an expiration

DEPENDENT

redis.db.expires["{#DB}"]

Preprocessing:

- JSONPATH: $.Keyspace["{#DB}"].expires

Redis

DB {#DB}: Keys

Total number of keys

DEPENDENT

redis.db.keys["{#DB}"]

Preprocessing:

- JSONPATH: $.Keyspace["{#DB}"].keys

Redis

Redis: AOF current size{#SINGLETON}

AOF current file size

DEPENDENT

redis.persistence.aof_current_size[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Persistence.aof_current_size

Redis

Redis: AOF base size{#SINGLETON}

AOF file size on latest startup or rewrite

DEPENDENT

redis.persistence.aof_base_size[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Persistence.aof_base_size

Redis

Redis: AOF pending rewrite{#SINGLETON}

Flag indicating an AOF rewrite operation will

DEPENDENT

redis.persistence.aof_pending_rewrite[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Persistence.aof_pending_rewrite

Redis

Redis: AOF buffer length{#SINGLETON}

Size of the AOF buffer

DEPENDENT

redis.persistence.aof_buffer_length[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Persistence.aof_buffer_length

Redis

Redis: AOF rewrite buffer length{#SINGLETON}

Size of the AOF rewrite buffer

DEPENDENT

redis.persistence.aof_rewrite_buffer_length[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Persistence.aof_rewrite_buffer_length

Redis

Redis: AOF pending background I/O fsync{#SINGLETON}

Number of fsync pending jobs in background I/O queue

DEPENDENT

redis.persistence.aof_pending_bio_fsync[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Persistence.aof_pending_bio_fsync

Redis

Redis: AOF delayed fsync{#SINGLETON}

Delayed fsync counter

DEPENDENT

redis.persistence.aof_delayed_fsync[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Persistence.aof_delayed_fsync

Redis

Redis: Master host{#SINGLETON}

Host or IP address of the master

DEPENDENT

redis.replication.master_host[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Replication.master_host

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Redis

Redis: Master port{#SINGLETON}

Master listening TCP port

DEPENDENT

redis.replication.master_port[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Replication.master_port

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Redis

Redis: Master link status{#SINGLETON}

Status of the link (up/down)

DEPENDENT

redis.replication.master_link_status[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Replication.master_link_status

- BOOL_TO_DECIMAL

Redis

Redis: Master last I/O seconds ago{#SINGLETON}

Number of seconds since the last interaction with master

DEPENDENT

redis.replication.master_last_io_seconds_ago[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Replication.master_last_io_seconds_ago

Redis

Redis: Master sync in progress{#SINGLETON}

Indicate the master is syncing to the replica

DEPENDENT

redis.replication.master_sync_in_progress[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Replication.master_sync_in_progress

Redis

Redis: Slave replication offset{#SINGLETON}

The replication offset of the replica instance

DEPENDENT

redis.replication.slave_repl_offset[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Replication.slave_repl_offset

Redis

Redis: Slave priority{#SINGLETON}

The priority of the instance as a candidate for failover

DEPENDENT

redis.replication.slave_priority[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Replication.slave_priority

Redis

Redis: Slave priority{#SINGLETON}

Flag indicating if the replica is read-only

DEPENDENT

redis.replication.slave_read_only[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Replication.slave_read_only

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Redis

Redis slave {#SLAVE_IP}:{#SLAVE_PORT}: Replication lag in bytes

Replication lag in bytes

DEPENDENT

redis.replication.lag_bytes["{#SLAVE_IP}:{#SLAVE_PORT}"]

Preprocessing:

- JAVASCRIPT: Text is too long. Please see the template.

Redis

Redis: Number of processes running

-

ZABBIX_PASSIVE

proc.num["{$REDIS.PROCESS_NAME}{#SINGLETON}"]

Redis

Redis: Memory usage (rss)

Resident set size memory used by process in bytes.

ZABBIX_PASSIVE

proc.mem["{$REDIS.PROCESS_NAME}{#SINGLETON}",,,,rss]

Redis

Redis: Memory usage (vsize)

Virtual memory size used by process in bytes.

ZABBIX_PASSIVE

proc.mem["{$REDIS.PROCESS_NAME}{#SINGLETON}",,,,vsize]

Redis

Redis: CPU utilization

Process CPU utilization percentage.

ZABBIX_PASSIVE

proc.cpu.util["{$REDIS.PROCESS_NAME}{#SINGLETON}"]

Redis

Redis: Executable path{#SINGLETON}

The path to the server's executable

DEPENDENT

redis.server.executable[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Server.executable

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Redis

Redis: Memory used peak %{#SINGLETON}

The percentage of used_memory_peak out of used_memory

DEPENDENT

redis.memory.used_memory_peak_perc[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.used_memory_peak_perc

- REGEX: (.+)% \1

Redis

Redis: Memory used overhead{#SINGLETON}

The sum in bytes of all overheads that the server allocated for managing its internal data structures

DEPENDENT

redis.memory.used_memory_overhead[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.used_memory_overhead

Redis

Redis: Memory used startup{#SINGLETON}

Initial amount of memory consumed by Redis at startup in bytes

DEPENDENT

redis.memory.used_memory_startup[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.used_memory_startup

Redis

Redis: Memory used dataset{#SINGLETON}

The size in bytes of the dataset

DEPENDENT

redis.memory.used_memory_dataset[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.used_memory_dataset

Redis

Redis: Memory used dataset %{#SINGLETON}

The percentage of used_memory_dataset out of the net memory usage (used_memory minus used_memory_startup)

DEPENDENT

redis.memory.used_memory_dataset_perc[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.used_memory_dataset_perc

- REGEX: (.+)% \1

Redis

Redis: Total system memory{#SINGLETON}

The total amount of memory that the Redis host has

DEPENDENT

redis.memory.total_system_memory[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.total_system_memory

Redis

Redis: Max memory{#SINGLETON}

Maximum amount of memory allocated to the Redisdb system

DEPENDENT

redis.memory.maxmemory[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.maxmemory

Redis

Redis: Max memory policy{#SINGLETON}

The value of the maxmemory-policy configuration directive

DEPENDENT

redis.memory.maxmemory_policy[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.maxmemory_policy

- DISCARD_UNCHANGED_HEARTBEAT: 1d

Redis

Redis: Active defrag running{#SINGLETON}

Flag indicating if active defragmentation is active

DEPENDENT

redis.memory.active_defrag_running[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.active_defrag_running

Redis

Redis: Lazyfree pending objects{#SINGLETON}

The number of objects waiting to be freed (as a result of calling UNLINK, or FLUSHDB and FLUSHALL with the ASYNC option)

DEPENDENT

redis.memory.lazyfree_pending_objects[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.lazyfree_pending_objects

Redis

Redis: RDB last CoW size{#SINGLETON}

The size in bytes of copy-on-write allocations during the last RDB save operation

DEPENDENT

redis.persistence.rdb_last_cow_size[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Persistence.rdb_last_cow_size

Redis

Redis: AOF last CoW size{#SINGLETON}

The size in bytes of copy-on-write allocations during the last AOF rewrite operation

DEPENDENT

redis.persistence.aof_last_cow_size[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Persistence.aof_last_cow_size

Redis

Redis: Expired stale %{#SINGLETON}

DEPENDENT

redis.stats.expired_stale_perc[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Stats.expired_stale_perc

Redis

Redis: Expired time cap reached count{#SINGLETON}

DEPENDENT

redis.stats.expired_time_cap_reached_count[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Stats.expired_time_cap_reached_count

Redis

Redis: Slave expires tracked keys{#SINGLETON}

The number of keys tracked for expiry purposes (applicable only to writable replicas)

DEPENDENT

redis.stats.slave_expires_tracked_keys[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Stats.slave_expires_tracked_keys

Redis

Redis: Active defrag hits{#SINGLETON}

Number of value reallocations performed by active the defragmentation process

DEPENDENT

redis.stats.active_defrag_hits[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Stats.active_defrag_hits

Redis

Redis: Active defrag misses{#SINGLETON}

Number of aborted value reallocations started by the active defragmentation process

DEPENDENT

redis.stats.active_defrag_misses[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Stats.active_defrag_misses

Redis

Redis: Active defrag key hits{#SINGLETON}

Number of keys that were actively defragmented

DEPENDENT

redis.stats.active_defrag_key_hits[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Stats.active_defrag_key_hits

Redis

Redis: Active defrag key misses{#SINGLETON}

Number of keys that were skipped by the active defragmentation process

DEPENDENT

redis.stats.active_defrag_key_misses[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Stats.active_defrag_key_misses

Redis

Redis: Replication second offset{#SINGLETON}

Offset up to which replication IDs are accepted

DEPENDENT

redis.replication.second_repl_offset[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Replication.second_repl_offset

Redis

Redis: Allocator active{#SINGLETON}

DEPENDENT

redis.memory.allocator_active[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.allocator_active

Redis

Redis: Allocator allocated{#SINGLETON}

DEPENDENT

redis.memory.allocator_allocated[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.allocator_allocated

Redis

Redis: Allocator resident{#SINGLETON}

DEPENDENT

redis.memory.allocator_resident[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.allocator_resident

Redis

Redis: Memory used scripts{#SINGLETON}

DEPENDENT

redis.memory.used_memory_scripts[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.used_memory_scripts

Redis

Redis: Memory number of cached scripts{#SINGLETON}

DEPENDENT

redis.memory.number_of_cached_scripts[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.number_of_cached_scripts

Redis

Redis: Allocator fragmentation bytes{#SINGLETON}

DEPENDENT

redis.memory.allocator_frag_bytes[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.allocator_frag_bytes

Redis

Redis: Allocator fragmentation ratio{#SINGLETON}

DEPENDENT

redis.memory.allocator_frag_ratio[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.allocator_frag_ratio

Redis

Redis: Allocator RSS bytes{#SINGLETON}

DEPENDENT

redis.memory.allocator_rss_bytes[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.allocator_rss_bytes

Redis

Redis: Allocator RSS ratio{#SINGLETON}

DEPENDENT

redis.memory.allocator_rss_ratio[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.allocator_rss_ratio

Redis

Redis: Memory RSS overhead bytes{#SINGLETON}

DEPENDENT

redis.memory.rss_overhead_bytes[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.rss_overhead_bytes

Redis

Redis: Memory RSS overhead ratio{#SINGLETON}

DEPENDENT

redis.memory.rss_overhead_ratio[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.rss_overhead_ratio

Redis

Redis: Memory fragmentation bytes{#SINGLETON}

DEPENDENT

redis.memory.fragmentation_bytes[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.mem_fragmentation_bytes

Redis

Redis: Memory not counted for evict{#SINGLETON}

DEPENDENT

redis.memory.not_counted_for_evict[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.mem_not_counted_for_evict

Redis

Redis: Memory replication backlog{#SINGLETON}

DEPENDENT

redis.memory.replication_backlog[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.mem_replication_backlog

Redis

Redis: Memory clients normal{#SINGLETON}

DEPENDENT

redis.memory.mem_clients_normal[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.mem_clients_normal

Redis

Redis: Memory clients slaves{#SINGLETON}

DEPENDENT

redis.memory.mem_clients_slaves[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.mem_clients_slaves

Redis

Redis: Memory AOF buffer{#SINGLETON}

Size of the AOF buffer

DEPENDENT

redis.memory.mem_aof_buffer[{#SINGLETON}]

Preprocessing:

- JSONPATH: $.Memory.mem_aof_buffer

Zabbix_raw_items

Redis: Get info

ZABBIX_PASSIVE

redis.info["{$REDIS.CONN.URI}"]

Zabbix_raw_items

Redis: Get config

ZABBIX_PASSIVE

redis.config["{$REDIS.CONN.URI}"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Triggers

Name

Description

Expression

Severity

Dependencies and additional info

Redis: Service is down

-

{TEMPLATE_NAME:redis.ping["{$REDIS.CONN.URI}"].last()}=0

AVERAGE

Manual close: YES

Redis: Too many entries in the slowlog (over {$REDIS.SLOWLOG.COUNT.MAX.WARN} per second in 5m)

-

{TEMPLATE_NAME:redis.slowlog.count["{$REDIS.CONN.URI}"].min(5m)}>{$REDIS.SLOWLOG.COUNT.MAX.WARN}

INFO

Redis: Total number of connected clients is too high (over {$REDIS.CLIENTS.PRC.MAX.WARN}% in 5m)

When the number of clients reaches the value of the "maxclients" parameter, new connections will be rejected.

https://redis.io/topics/clients#maximum-number-of-clients

{TEMPLATE_NAME:redis.clients.connected.min(5m)}/{Redis:redis.config.maxclients.last()}*100>{$REDIS.CLIENTS.PRC.MAX.WARN}

WARNING

Redis: Memory fragmentation ratio is too high (over {$REDIS.MEM.FRAG_RATIO.MAX.WARN} in 15m)

This ratio is an indication of memory mapping efficiency:

— Value over 1.0 indicate that memory fragmentation is very likely. Consider restarting the Redis server so the operating system can recover fragmented memory, especially with a ratio over 1.5.

— Value under 1.0 indicate that Redis likely has insufficient memory available. Consider optimizing memory usage or adding more RAM.

Note: If your peak memory usage is much higher than your current memory usage, the memory fragmentation ratio may be unreliable.

https://redis.io/topics/memory-optimization

{TEMPLATE_NAME:redis.memory.fragmentation_ratio.min(15m)}>{$REDIS.MEM.FRAG_RATIO.MAX.WARN}

WARNING

Redis: Last AOF write operation failed

Detailed information about persistence: Redis Persistence – Redis

{TEMPLATE_NAME:redis.persistence.aof_last_write_status.last()}=0

WARNING

Redis: Last RDB save operation failed

Detailed information about persistence: Redis Persistence – Redis

{TEMPLATE_NAME:redis.persistence.rdb_last_bgsave_status.last()}=0

WARNING

Redis: Number of slaves has changed

Redis number of slaves has changed. Ack to close.

{TEMPLATE_NAME:redis.replication.connected_slaves.diff()}=1

INFO

Manual close: YES

Redis: Replication role has changed (new role: {ITEM.VALUE})

Redis replication role has changed. Ack to close.

{TEMPLATE_NAME:redis.replication.role.diff()}=1 and {TEMPLATE_NAME:redis.replication.role.strlen()}>0

WARNING

Manual close: YES

Redis: Version has changed (new version: {ITEM.VALUE})

Redis version has changed. Ack to close.

{TEMPLATE_NAME:redis.server.redis_version.diff()}=1 and {TEMPLATE_NAME:redis.server.redis_version.strlen()}>0

INFO

Manual close: YES

Redis: has been restarted (uptime < 10m)

Uptime is less than 10 minutes

{TEMPLATE_NAME:redis.server.uptime.last()}

INFO

Manual close: YES

Redis: Connections are rejected

The number of connections has reached the value of "maxclients".

https://redis.io/topics/clients

{TEMPLATE_NAME:redis.stats.rejected_connections.last()}>0

HIGH

Redis: Replication lag with master is too high (over {$REDIS.REPL.LAG.MAX.WARN} in 5m)

-

{TEMPLATE_NAME:redis.replication.master_last_io_seconds_ago[{#SINGLETON}].min(5m)}>{$REDIS.REPL.LAG.MAX.WARN}

WARNING

Redis: Process is not running

-

{TEMPLATE_NAME:proc.num["{$REDIS.PROCESS_NAME}{#SINGLETON}"].last()}=0

HIGH

Redis: Memory usage is too high (over {$REDIS.MEM.PUSED.MAX.WARN}% in 5m)

-

{TEMPLATE_NAME:redis.memory.used_memory.last()}/{TEMPLATE_NAME:redis.memory.maxmemory[{#SINGLETON}].min(5m)}*100>{$REDIS.MEM.PUSED.MAX.WARN}

WARNING

Redis: Failed to fetch info data (or no data for 30m)

Zabbix has not received data for items for the last 30 minutes

{TEMPLATE_NAME:redis.info["{$REDIS.CONN.URI}"].nodata(30m)}=1

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值