The Redis plugin in Zabbix agent 2 provides a native Zabbix solution for monitoring Redis servers (the in-memory data structure store).
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.
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.
The plugin uses the configuration file of Zabbix agent 2 for its parameters.
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):
The plugin can authenticate:
- If you pass a URI as the connString, and this connection requires authentication, you must use the
Plugins.Redis.Password parameter (the 1st level password) in the configuration file. In other words, once defined this parameter will be used for authenticating all connections where the connString is represented by URI.
- If you want to use different passwords for different Redis instances, you should create a named session in the configuration for each instance and should define a session-level password (see 'Named sessions' below).
Named sessions allow you to define specific parameters for each Redis instance. Currently, only two parameters are supported:
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:
The following items are supported:
See also: Agent 2 item keys
There are four levels of parameter overwriting:
The plugin uses Zabbix agent logs. Increase the debug level on the Zabbix agent to view more information in the logs.