OPNexusdocs

Prometheus

GET /api/metrics delivers the state in Prometheus text format. The response comes only from the OPNexus database (no requests to the firewalls), so frequent scraping puts no load on anything. With a "Read" token:

yaml
scrape_configs:
  - job_name: opnexus
    scheme: https
    metrics_path: /api/metrics
    authorization: { credentials: "opx_…" }
    static_configs: [{ targets: ["opnexus.example"] }]
MetricMeaning
opnexus_info{version}Version, always 1
opnexus_hostsNumber of firewalls
opnexus_host_up{host,cluster}1 if the host responded within the last 3 minutes
opnexus_host_enabled, …_last_sample_timestamp_secondsMonitoring on; time of the last measurement
opnexus_host_memory_used_percent, opnexus_host_load1, opnexus_host_disk_used_percentLast measurement
opnexus_host_carp_master1 = MASTER, 0 = BACKUP (missing if unknown)
opnexus_host_swap_used_percentSwap usage of the last measurement (missing without swap)
opnexus_host_gateway_up{gateway}1 as long as OPNsense does not list the gateway as down
opnexus_host_gateway_loss_percent, …_delay_seconds, …_stddev_seconds {gateway}Packet loss, round-trip time and deviation to the monitor (missing without measurement)
opnexus_host_api_rights_missing{read}1 as long as the firewall denies the read access read (gateways, services, swap, cpu) because of missing API privileges; otherwise the line is absent
opnexus_host_service_running{service,instance}1 = running, only for services on the monitoring list
opnexus_host_compliance_score, opnexus_host_compliance_findings{severity}Security posture
opnexus_pending_actions{kind,status}Open actions as on the dashboard
opnexus_problems_open{type}Open problems of the notifications
opnexus_scheduled_maintenance_pendingScheduled maintenance not yet run
opnexus_rollout_runs{status}Fleet rollouts by status (waiting, running, paused, successful, …)

A ready-made Grafana dashboard is at docs/grafana-opnexus.json (Grafana › Dashboards › Import, choose the Prometheus data source): reachable firewalls, open actions and problems, security score and findings, load, memory, swap, disk and CARP role as well as gateways (reachable, packet loss, latency), stopped services, missing API privileges and rollouts by status.