banshee/services-collection/services/redis/ssh/
replication
The replication of a Redis server from either side: each replica or the master link, its state and lag, by SSH and redis-cli INFO.
par banshee1 installation1 version
v1Dernière
Publiée le 27 octobre 2026. First version.
Redis replication, by SSH
Returns the replication of a Redis server, from either side, read by redis-cli INFO on the Redis server over SSH. On a master, one link per replica connected: its state and its lag. On a replica, one link, master: the state of its link to the master and the seconds since they last talked. The role of the server, and the number of links, so that a replica that is gone says so. Five watches are offered, each one set on the probe. No password leaves banshee.
Versions
Redis 2.8 and later, and Valkey. Generic: no folder of version.
How it works
The collector runs, on the server, LC_ALL=C redis-cli -p <port> INFO, as redis/ssh/memory does, the password, when there is one, going from its file on the server into REDISCLI_AUTH. It reads the section Replication:
role:master
connected_slaves:1
slave0:ip=192.0.2.21,port=6379,state=online,offset=1093,lag=0 role:slave
master_host:192.0.2.20
master_port:6379
master_link_status:up
master_last_io_seconds_ago:1 - On a master, one link per line
slaveN, named<ip>:<port>:stateisonline, orwait_bgsave,send_bulkwhile the replica loads its first copy;lagis the seconds since the replica last acknowledged. - On a replica, the link
master:stateismaster_link_status,upordown;lagismaster_last_io_seconds_ago, not returned while the link is down. The replicas chained behind it are returned beside it, as on a master. linksis the number of links returned. A replica that disconnects disappears from the master's list: "No replication link" raises when none is left, and "Replica missing" names the one gone, once its name is set on the probe.roleismasterorslave, as Redis writes it: after a failover (Sentinel), "Role changed" raises once the expected role is set on the probe.- A Redis that refuses the connection is critical: "Redis is not running". A refused account stops the collector
misconfigured, as does any other answer thanINFO. - Nothing is written:
INFOonly reads.
Prerequisites
The same as redis/ssh/memory: an SSH account without write rights, redis-cli in its path, the password, when Redis asks for one, in a file of that account, mode 0400 (redis:password-file), no sudo, and the fingerprint of the server's host key.
Variables
| Name | Label | Says | Default |
|---|---|---|---|
redis:port | Port | the port Redis listens on, on the server | 6379 |
redis:password-file | Password file | the path, on the server, of the file that holds the password; empty: no password | — |
Outputs
| Name | Label | Unit | Per instance |
|---|---|---|---|
role | Role | — | no |
links | Replication links | — | no |
state | State | — | yes, per link |
lag | Seconds since last exchange | s | yes, per link |
Watches
| Name | Title | Kind | Defaults | Checked by default |
|---|---|---|---|---|
no-link | No replication link | below a threshold, on links | critical below 1 | yes |
down | Replication link down | expected value, on state | critical when anything but online or up, for 3 runs | yes |
lag | Replication late | above a threshold, on lag | warning above 10 s, critical above 60 s | yes |
role | Role changed | expected value, on role | no role given: set master or slave on the probe | no |
missing | Replica missing | expected instances, on state | no name given: it raises nothing until names are set on the probe | no |
Deploy the collector on each server: a Redis alone, without replication, has no link, and "No replication link" would raise there.
Limits
- The lag is in seconds since the last exchange, not in data behind: the replication offsets are not compared.
- Redis Cluster (shards and their replicas) is not read as a cluster: each node reads as a master or a replica.
- Redis is reached on the server itself (
127.0.0.1), without TLS, as its default user only (seeredis/ssh/memory). - Not checked against a Redis: the fields are those of the documentation of
INFO(redis.io).