How to Monitor Ceph Clusters with Zabbix: 3 Practical Methods
This guide explains three ways to monitor Ceph distributed storage using Zabbix—Agent2 with the RESTful module, Zabbix Sender, and custom scripts—providing step‑by‑step commands, configuration tips, and troubleshooting notes for reliable operations.
Ceph is an open‑source distributed storage platform; this article introduces three methods to monitor a Ceph cluster with Zabbix, focusing on concepts and commands without detailed configuration.
1. Monitor Ceph with Agent2
Since Zabbix 5.0, Agent2 supports Ceph monitoring via Ceph's RESTful module (listening on port 8003). Enable the module, generate a self‑signed SSL certificate, create an API user, list keys, and test the API with curl. Then configure the Zabbix agent to collect data.
Enable RESTful module
<code>ceph mgr module enable restful</code>Generate SSL certificate
<code>ceph restful create-self-signed-cert</code>Create API user
<code>ceph restful create-key zabbix</code>List all API keys:
<code>ceph restful list-keys</code>Verify the API user (replace and with actual values):
<code>curl -k https://api:YOUR_TOKEN@<ceph-mgr>:<port>/server</code>Modify the Zabbix Agent2 configuration to skip TLS verification and restart the service:
<code>vim /etc/zabbix/zabbix_agent2.conf
Plugins.Ceph.InsecureSkipVerify=true
systemctl restart zabbix-agent2</code>Data collection works, but the
ceph pg dumpcommand is denied, a known issue discussed in Ceph forums.
2. Monitor Ceph with Zabbix Sender
From Ceph Luminous onward, the ceph‑mgr provides a Zabbix module.
Install zabbix‑sender
<code>rpm -Uvh https://repo.zabbix.com/zabbix/5.2/rhel/7/x86_64/zabbix-release-5.2-1.el7.noarch.rpm
yum install zabbix-sender -y</code>Enable Zabbix module
<code>ceph mgr module enable zabbix</code>Configure Zabbix server and host
<code>ceph zabbix config-set zabbix_host 192.168.2.24
ceph zabbix config-set identifier node1
ceph zabbix config-show</code>Import template and link to host
The template is located at
/usr/share/ceph/mgr/zabbix/zabbix_template.xml; import it in Zabbix and attach it to the host.
Test data sending
<code>ceph zabbix send</code>Data appears in Zabbix every 60 seconds.
3. Custom scripts
Shell or Python scripts can invoke Ceph commands or the RESTful API for monitoring; many open‑source examples are available online.
Ops Development Stories
Maintained by a like‑minded team, covering both operations and development. Topics span Linux ops, DevOps toolchain, Kubernetes containerization, monitoring, log collection, network security, and Python or Go development. Team members: Qiao Ke, wanger, Dong Ge, Su Xin, Hua Zai, Zheng Ge, Teacher Xia.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.