This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

Redis plugin metrics

Overview

The Redis plugin in Zabbix agent 2 provides a native Zabbix solution for monitoring Redis servers (the in-memory data structure store).

The Redis plugin is available since Zabbix agent 2 version 4.4.5.
An updated plugin version, described on this page, is available since Zabbix 4.4.8

The plugin uses the RESP protocol (over TCP and Unix-sockets) implementation in order to gather all necessary metrics.

An official Redis template is available, which you may extend as needed or create your own template.

Installation

The plugin is supplied as part of Zabbix agent 2, and it does not require any special installation steps. Once Zabbix agent 2 installed, the plugin is ready to work. The only thing you need to do is to make sure that a Redis instance is available for connection.

Configuration

The plugin uses the configuration file of Zabbix agent 2 for its parameters.

Connections

The plugin supports gathering metrics from multiple Redis instances simultaneously. Both local and remote instances can be monitored. TCP and Unix-socket connections are supported.

The plugin keeps connections to Redis instances in the opened state. The benefits are reduced network congestion, latency and CPU and memory usage due to the lower number of connections. The client library takes care of this.

Underlying every connection is a pool of connections. A connection is initialized at the same time when the first metric request (that needs a connection) is performed (lazy connection):

  • Requests are limited in time of execution by the timeout option (see Plugin.Redis.Timeout configuration parameter);
  • A special timer closes connections that have not been accessed too long (see Plugin.Redis.KeepAlive configuration parameter).

Authentication

The plugin can authenticate using the password specified as a key parameter or within named sessions. Embedded URI credentials (userinfo) will be ignored.

Named sessions

Named sessions allow you to define specific parameters for each Redis instance. Currently, only two parameters are supported: Uri and Password. Those can be useful if you have multiple instances with different credentials. E.g: if you have two instances: "Redis1" and "Redis2", you need to add these options to your agent 2 configuration:

Plugins.Redis.Sessions.Redis1.Uri=tcp://127.0.0.1:6379
       Plugins.Redis.Sessions.Redis1.Password=<PasswordForRedis1>
       Plugins.Redis.Sessions.Redis2.Uri=tcp://127.0.0.1:6380
       Plugins.Redis.Sessions.Redis2.Password=<PasswordForRedis2>

Then you can use these names as connString in the item keys instead of URIs, e.g:

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

Named sessions provide a more secure way to store credentials compared to item key parameters or user macros.

Metrics

The following items are supported:

  • redis.config[<connString>,<password>, <pattern>]
  • redis.info[<connString>,<password>, <section>]
  • redis.ping[<connString>, <password>]
  • redis.slowlog.count[<connString>, <password>]

See also: Agent 2 item keys

Parameter priority

There are four levels of parameter overwriting:

  1. hardcoded default values →
  2. 1st level configuration parameters (Plugins.Redis.*) →
  3. named sessions (Plugins.Redis.Sessions.<sessionName>.*) →
  4. item key parameters

Troubleshooting

The plugin uses Zabbix agent logs. Increase the debug level on the Zabbix agent to view more information in the logs.