๐ Deploying the Ceph Mgr Prometheus Module to Proxmox Nodes
๐ Purpose
This runbook explains how to:
- add Proxmox Ceph nodes to Ceph monitoring
- enable and configure the
ceph-mgrPrometheus module - refresh the Prometheus scrape configuration and Ceph alert rules
- verify Ceph metrics in Prometheus and Grafana
In this repository, Ceph scrape targets come from the ceph_nodes inventory group. Prometheus does not maintain a separate manual list of Ceph targets.
๐งญ How Ceph Monitoring Works Here
Ceph metrics come from the Prometheus module built into ceph-mgr. There is no separate exporter to install. Once the module is enabled, every manager daemon listens on port 9283 and serves /metrics.
Key behavior:
- Only the active manager returns Ceph metrics. Standby managers answer the scrape but return no Ceph samples.
- Prometheus therefore scrapes every node in
ceph_nodes. Whichever node holds the active manager supplies the data, and scraping keeps working after a manager failover. - The
cephscrape job useshonor_labels: trueso labels set byceph-mgrare kept rather than overwritten. - The module is cluster-wide. It is enabled once, not per node.
The module is configured by:
playbooks/proxmox/deploy_pve_monitoring.yml
Prometheus scraping is driven by the ceph_nodes group in the PVE inventory:
[ceph_nodes]
pve-0
pve-1
pve-2
๐ Add a Proxmox Node to Ceph Monitoring
1. Open the PVE inventory
inventory/pve/inventory.ini
2. Add the node to the Ceph node group
Add the host to ceph_nodes:
[ceph_nodes]
pve-0
pve-1
pve-2
Guidelines:
- Only add hosts that are members of the Proxmox Ceph cluster.
- Keep the host in
pvenodesas well, sodeploy_pve_monitoring.ymltargets it. - Ensure each host has a matching entry in
global_ip_addressesinroles/global/vars/main.yml. Prometheus scrapes that address, not the Ceph cluster network address.
3. Make sure the node runs a Ceph manager
Prometheus only receives data from nodes that run a ceph-mgr daemon. Check from any Ceph node:
ceph mgr stat
ceph mgr services
If the new node has no manager and should have one, create it in the Proxmox UI under Ceph โ Monitor โ Manager, or on the node:
pveceph mgr create
4. Open the port if the Proxmox firewall is enabled
Allow TCP 9283 from the Prometheus host (prometheus-0) to every node in ceph_nodes.
5. Review the scrape settings (optional)
The defaults live in roles/prometheus_setup/defaults/main/main.yml:
prometheus_setup_ceph_job_name: "ceph"
prometheus_setup_ceph_port: 9283
prometheus_setup_ceph_alerts_enabled: true
No credentials are needed. The module serves metrics without authentication, so restrict access to port 9283 at the network or firewall level.
๐ Enable the Ceph Mgr Prometheus Module
Run the Proxmox monitoring playbook against the PVE inventory:
ansible-playbook -i inventory/pve/inventory.ini playbooks/proxmox/deploy_pve_monitoring.yml
What this does for Ceph, once, on the first host in ceph_nodes:
- runs
ceph mgr module enable prometheus - sets
mgr/prometheus/exclude_perf_counterstofalse, only if it is not alreadyfalse
Since Ceph Reef, per-daemon performance counters (per-OSD latency, operations, and similar) are excluded from the manager module by default. They are expected to come from cephadmโs ceph-exporter daemon, which Proxmox does not deploy. Turning the exclusion off makes the manager module export them instead.
The same playbook also deploys node exporter and PVE exporter to every pvenodes host. It does not update the Prometheus configuration.
๐ Deploy the Updated Targets and Rules to Prometheus
Scrape targets
Refresh the Prometheus exporter scrape configuration using the repositoryโs combined default inventory:
ansible-playbook playbooks/prometheus/deploy_prometheus_exporters.yml
What this does:
- reads the
ceph_nodesgroup from the combined inventory - merges its hosts into the existing Ceph targets
- renders the
cephscrape job with a 30 second interval andhonor_labels: true - points each target at
<global_ip_addresses entry>:9283
Do not scope this run with -i to a single inventory folder, because other exporter groups would not be visible.
Alert rules
The Ceph alert rules are part of prometheus.rules.yml, which is deployed by the main Prometheus playbook:
ansible-playbook -i inventory/prometheus/inventory.ini playbooks/prometheus/deploy_prometheus.yml
ansible-playbook playbooks/prometheus/deploy_prometheus_exporters.yml
Run the exporter refresh afterward so every exporter scrape job is rendered back into prometheus.yml. The role validates the rule file with promtool and reloads Prometheus.
The ceph rule group contains:
| Alert | Fires when | Severity |
|---|---|---|
CephMetricsAbsent |
no ceph_health_status for 5 minutes (no active manager is being scraped) |
critical |
CephHealthWarning |
cluster in HEALTH_WARN for 15 minutes |
warning |
CephHealthError |
cluster in HEALTH_ERR for 5 minutes |
critical |
CephMonQuorumLost |
a monitor out of quorum for 5 minutes | warning |
CephOSDDown |
an OSD down for 5 minutes | critical |
CephOSDOut |
an OSD marked out for 15 minutes | warning |
CephOSDNearFull |
an OSD over 80% used for 15 minutes | warning |
CephClusterNearFull |
raw cluster capacity over 80% used for 15 minutes | warning |
CephClusterCriticallyFull |
raw cluster capacity over 90% used for 5 minutes | critical |
CephPGsNotActive |
any placement group not active for 15 minutes | critical |
Set prometheus_setup_ceph_alerts_enabled: false to leave the group out.
Note:
prometheus.ymldoes not currently have analerting:section, so these alerts appear in Prometheus and Grafana but are not sent to Alertmanager.
โ Validate Before Deploying
If Ansible is installed in the repository Python environment:
source /opt/python_3.12/bin/activate
ansible-inventory -i inventory/pve/inventory.ini --graph ceph_nodes
ansible-playbook -i inventory/pve/inventory.ini playbooks/proxmox/deploy_pve_monitoring.yml --syntax-check
ansible-playbook playbooks/prometheus/deploy_prometheus_exporters.yml --syntax-check
Confirm that the inventory graph lists the intended nodes under ceph_nodes.
๐ Verify After Deployment
On a Proxmox Ceph node
Check that the module is enabled and where it is served:
ceph mgr module ls | grep prometheus
ceph mgr services
ceph mgr services should list "prometheus": "http://<active-node>:9283/".
Check the perf counter setting:
ceph config get mgr mgr/prometheus/exclude_perf_counters
The result should be false.
Check the endpoint on the active manager node:
curl --fail -s http://localhost:9283/metrics | grep '^ceph_health_status'
The response should contain ceph_health_status. The same command on a standby node returns no Ceph metrics, which is expected.
In Prometheus
Run:
up{job="ceph"}
Expected behavior:
- every node in
ceph_nodesappears in thecephjob - the
instancelabel matches the inventory host name - the value is
1when port9283is reachable
Then confirm that exactly one node supplies Ceph data:
count by (instance) (ceph_health_status{job="ceph"})
This should return one series, for the node with the active manager.
Check the alert rules on the Alerts page. The ceph group should be listed. If CephMetricsAbsent is firing, no active manager is being scraped.
In Grafana
Open the Proxmox VE Status dashboard and confirm that the Ceph panels report current data:
- Ceph Health
- Ceph OSDs Up / Total
- Ceph Capacity Used
- Ceph Monitors In Quorum
- Ceph Pool Usage
โ ๏ธ Common Mistakes
- Adding a host to
ceph_nodesbut not topvenodes, so the monitoring playbook does not target it - Adding a host that is not part of the Ceph cluster
- Forgetting the hostโs
global_ip_addressesentry - Scraping only one node, so metrics stop after a manager failover
- Expecting Ceph metrics from a standby manager
- Enabling the module but forgetting to refresh Prometheus exporters
- Passing only the PVE inventory to
deploy_prometheus_exporters.yml - Running
deploy_prometheus.ymlwithout runningdeploy_prometheus_exporters.ymlafterward - Leaving TCP
9283blocked by the Proxmox firewall - Expecting the Ceph alerts to send notifications while Prometheus has no
alerting:section
โ Summary
To monitor Ceph on the Proxmox nodes:
- Add each Ceph node to
ceph_nodes(andpvenodes) ininventory/pve/inventory.ini. - Make sure the nodes run a
ceph-mgrdaemon and allow TCP9283from Prometheus. - Run
playbooks/proxmox/deploy_pve_monitoring.ymlwith the PVE inventory to enable the module. - Run
playbooks/prometheus/deploy_prometheus.ymlto deploy the Ceph alert rules. - Run
playbooks/prometheus/deploy_prometheus_exporters.ymlwith the combined default inventory. - Verify the
cephjob in Prometheus and the Ceph panels in the Proxmox VE Status dashboard.
The inventory is the source of truth for which Ceph nodes are scraped.