๐Ÿ™ Deploying the Ceph Mgr Prometheus Module to Proxmox Nodes

๐Ÿ“– Purpose

This runbook explains how to:

  1. add Proxmox Ceph nodes to Ceph monitoring
  2. enable and configure the ceph-mgr Prometheus module
  3. refresh the Prometheus scrape configuration and Ceph alert rules
  4. 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:

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:

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:

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:

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.yml does not currently have an alerting: 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:

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:


โš ๏ธ Common Mistakes


โœ… Summary

To monitor Ceph on the Proxmox nodes:

  1. Add each Ceph node to ceph_nodes (and pvenodes) in inventory/pve/inventory.ini.
  2. Make sure the nodes run a ceph-mgr daemon and allow TCP 9283 from Prometheus.
  3. Run playbooks/proxmox/deploy_pve_monitoring.yml with the PVE inventory to enable the module.
  4. Run playbooks/prometheus/deploy_prometheus.yml to deploy the Ceph alert rules.
  5. Run playbooks/prometheus/deploy_prometheus_exporters.yml with the combined default inventory.
  6. Verify the ceph job 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.