Monitoring the status of drbd with Zabbix.
Zabbix drbd monitoring #
Monitoring the status of drbd with Zabbix.
Github - Zabbix/community-templates/drbd
Description #
I updated my old DRBD Monitoring template for zabbix to use drbdadm status instead of reading the contents of /proc/drbd. You can find the original blog post here: Torminal - Zabbix Template: Monitor health of DRBD .
The repository is now split in two versions, one for DRBD < version 9.x and a new for DRBD > version 9.x.
- older than Version 9.x: Github - zabbix-old-version
- Shows warning if the primary DRBD host becomes secondary or the secondary goes offline.
- The
/proc/drbdfile in the Linux system is read for this purpose.
- newer than version 9.x: Github - zabbix-new-version
- Shows warning if:
- Host is no longer Primary
- Local disk is not UpToDate
- Peer is not Secondary (connection problem)
- Replication not established
- Reads the content of the
drbdadm statuscommand.
- Shows warning if:
Tested with:
- Zabbix Server 6 & Zabbix Server 7
- zabbix-agent2
- DRBD 8.x (on Debian 12 server)
- DRBD 9.x (on Debian 12 server)
Dependencies #
- Zabbix-Server
- Host with zabbix-agent2 and DRBD installed
Installing #
New Version, based on “drbdadm status” #
Example alerts:
On Zabbix frontend server: #
- Files can be found at Github - zabbix-new-version
- Download and import the template
drbd9-status.yaml - Assign the
Template DRBD 9.x Statusto the docker host(s) you want to monitor
On the DRBD Primary Node #
- Add the file
drbd.confin the zabbix-agent2 configuration path at/etc/zabbix/zabbix_agent2.d - Restart zabbix-agent2 with
systemctl restart zabbix-agent2
Now you should be able to get warnings in Zabbix. You can test it with switching primary and secondary node, you should get a warning after up to 10 minutes that says “Host is no longer Primary”.
Old Version, based on “/proc/drbd” #
On Zabbix frontend server: #
- Files can be found at Github - zabbix-old-version
- Download and import the template
drbd-status.yaml - Assign the
Template DRBD Statusto the docker host(s) you want to monitor
Conclusion #
The new version of the template now got a bunch of new warnings. Thanks to Lukáš Grygera, who commented on the old blog-post at told me about “drbdadm status”.
If you have more requests, issues with the template or anything else to tell me, feel free to leave a comment below (no registration required).