Skip to main content

DRBD SSH

Overview​

DRBD (Distributed Replicated Block Device) is a distributed storage architecture for GNU/Linux, allowing the replication of block devices (disks, partitions, logical volumes etc.) between servers. DRBD is free software, but support exists. DRBD consists of a kernel module, administration tools in user space as well as shell scripts.

Monitoring Connector Assets​

Monitored Objects​

  • DRBD replication including roles, peers, devices

Collected Metrics​

More information about collected metrics is available in the official DRBD documentation : https://www.linbit.com/drbd-user-guide/drbd-guide-9_0-en/

Metric nameDescriptionUnit
disk-statusDisk status
peer-connection-statusPeer connection status
peer-device-replication-statusPeer device replication status
peer-device-disk-statusPeer device disk status
resources.total.countTotal number of resourcescount
disk.data.read.bytespersecondDisk data readB/s
disk.data.written.bytespersecondDisk data writtenB/s
peer.traffic.in.bitspersecondPeer traffic inb/s
peer.traffic.out.bitspersecondPeer traffic outb/s

Prerequisites​

A number of distributions provide DRBD, including pre-built binary packages. Support for these builds, if any, is being provided by the associated distribution vendor. Their release cycle may lag behind DRBD source releases.

More information is available on the official documentation of DRBD : https://www.linbit.com/drbd-user-guide/drbd-guide-9_0-en/#ch-install-packages

The centreon-engine user performs a SSH connection to a remote system user. This user must have enough privileges to run /usr/bin/drbdsetup command.

Setup​

  1. Install the Centreon Plugin on every Poller monitoring DRBD resources:
yum install centreon-plugin-Applications-Drbd-Ssh.noarch
  1. On the Centreon Web interface in Configuration > Monitoring Connector Manager, install the DRBD SSH Monitoring Connector

Configuration​

Adding a Host into Centreon, link it to the Template named App-Drbd-SSH-custom. Once the Template set, you have to set values according to the chosen SSH backend. 3 SSH backends are available to connect to the remote server: sshcli, plink and libssh which are detailed below.

MandatoryNameDescription
XSSHBACKENDName of the backend: sshcli
XSSHUSERNAMEBy default, it uses the user running process centengine on your Poller
SSHPASSWORDCannot be used with backend. Only ssh key authentication
SSHPORTBy default: 22
SSHEXTRAOPTIONSCustomize it with your own if needed. E.g.: --ssh-priv-key=/user/.ssh/id_rsa

With that backend, you have to validate the target server fingerprint manually (with the SSHUSERNAME used).

FAQ​

How to check in the CLI that the configuration is OK and what are the main options for ?​

Once the Plugin installed, log into your Poller using the centreon-engine user account and test by running the following command :

/usr/lib/centreon/plugins/centreon_drbd_ssh.pl \
--plugin=apps::drbd::local::plugin.pm \
--mode=resources \
--hostname=10.30.2.81 \
--ssh-username=centreon \
--ssh-password=centreon-password \
--ssh-backend=libssh \
--legacy-proc \
--verbose

Which output something similar to:

OK: total resources: 9 - All drbd resources are ok
| 'resources.total.count'=9;;;0; '0#disk.data.read.bytespersecond'=0B/s;;;0; '0#disk.data.written.bytespersecond'=0B/s;;;0; '0~0#peer.traffic.in.bitspersecond'=0b/s;;;0;
'0~0#peer.traffic.out.bitspersecond'=0b/s;;;0; '1#disk.data.read.bytespersecond'=0B/s;;;0; '1#disk.data.written.bytespersecond'=0B/s;;;0; '1~0#peer.traffic.in.bitspersecond'=0b/s;;;0;
'1~0#peer.traffic.out.bitspersecond'=0b/s;;;0; '2#disk.data.read.bytespersecond'=0B/s;;;0; '2#disk.data.written.bytespersecond'=0B/s;;;0; '2~0#peer.traffic.in.bitspersecond'=0b/s;;;0;
'2~0#peer.traffic.out.bitspersecond'=0b/s;;;0; '3#disk.data.read.bytespersecond'=0B/s;;;0; '3#disk.data.written.bytespersecond'=0B/s;;;0; '3~0#peer.traffic.in.bitspersecond'=0b/s;;;0;
'3~0#peer.traffic.out.bitspersecond'=0b/s;;;0; '4#disk.data.read.bytespersecond'=0B/s;;;0; '4#disk.data.written.bytespersecond'=0B/s;;;0; '4~0#peer.traffic.in.bitspersecond'=0b/s;;;0;
'4~0#peer.traffic.out.bitspersecond'=0b/s;;;0; '5#disk.data.read.bytespersecond'=0B/s;;;0; '5#disk.data.written.bytespersecond'=0B/s;;;0; '5~0#peer.traffic.in.bitspersecond'=0b/s;;;0;
'5~0#peer.traffic.out.bitspersecond'=0b/s;;;0; '6#disk.data.read.bytespersecond'=0B/s;;;0; '6#disk.data.written.bytespersecond'=0B/s;;;0; '6~0#peer.traffic.in.bitspersecond'=0b/s;;;0;
'6~0#peer.traffic.out.bitspersecond'=0b/s;;;0; '7#disk.data.read.bytespersecond'=0B/s;;;0; '7#disk.data.written.bytespersecond'=0B/s;;;0; '7~0#peer.traffic.in.bitspersecond'=0b/s;;;0;
'7~0#peer.traffic.out.bitspersecond'=0b/s;;;0; '8#disk.data.read.bytespersecond'=0B/s;;;0; '8#disk.data.written.bytespersecond'=0B/s;;;0; '8~0#peer.traffic.in.bitspersecond'=0b/s;;;0;
'8~0#peer.traffic.out.bitspersecond'=0b/s;;;0;

The command above gets the status of resources DRBD SSH (--mode=resources). It uses a SSH username centreon (--ssh-username=centreon), a SSH password centreon-password (--ssh-password='centreon-password'), uses a SSH backend libssh (--ssh-backend='libssh') and it connects to the host 10.30.2.81 (--hostname=10.30.2.81) on the SSH default port 22 (--ssh-port=22).

The legacy-proc (--legacy-proc) option allows you to use the old proc file (/proc/drbd). This makes it possible to use a version prior to version 9.

All the options that can be used with this plugin can be found over the --help options:

/usr/lib/centreon/plugins/centreon_drbd_ssh.pl \
--plugin=apps::drbd::local::plugin.pm \
--mode=resources --help

I have that error message: UNKNOWN: Command error: Host key verification failed.. What does it mean ?​

It means you haven't manually validated the target server fingerprint with ssh or plink on the Centreon Poller.