banshee is under active development: collectors will keep changing, and a version you publish will likely need adjustments. For stable use, wait for version 1.0.0.

Services

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.

  • services
  • redis
  • valkey
  • replication
  • replica
  • sentinel
  • redis-cli
  • ssh

by banshee1 installation1 version

v1Latest

Published on October 27, 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>: state is online, or wait_bgsave, send_bulk while the replica loads its first copy; lag is the seconds since the replica last acknowledged.
  • On a replica, the link master: state is master_link_status, up or down; lag is master_last_io_seconds_ago, not returned while the link is down. The replicas chained behind it are returned beside it, as on a master.
  • links is 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.
  • role is master or slave, 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 than INFO.
  • Nothing is written: INFO only 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

NameLabelSaysDefault
redis:portPortthe port Redis listens on, on the server6379
redis:password-filePassword filethe path, on the server, of the file that holds the password; empty: no password—

Outputs

NameLabelUnitPer instance
roleRole—no
linksReplication links—no
stateState—yes, per link
lagSeconds since last exchangesyes, per link

Watches

NameTitleKindDefaultsChecked by default
no-linkNo replication linkbelow a threshold, on linkscritical below 1yes
downReplication link downexpected value, on statecritical when anything but online or up, for 3 runsyes
lagReplication lateabove a threshold, on lagwarning above 10 s, critical above 60 syes
roleRole changedexpected value, on roleno role given: set master or slave on the probeno
missingReplica missingexpected instances, on stateno name given: it raises nothing until names are set on the probeno

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 (see redis/ssh/memory).
  • Not checked against a Redis: the fields are those of the documentation of INFO (redis.io).