Prometheus and Grafana
nMon1 provides the current values of all monitors in the Prometheus format: https://temedum-xuvul.185-94-252-101.webspace123.de//metrics.php. Status, response times, availability, certificate expiry and server values end up in your own Prometheus and Grafana.
- Under Profile > API tokens create a token with the permission Read. It sees exactly the monitors of your user.
- Add a job to
prometheus.yml:scrape_configs: - job_name: nmon scrape_interval: 60s metrics_path: /metrics.php scheme: https authorization: credentials: nmon_YOUR_TOKEN static_configs: - targets: ["your-nmon-server.com"] - In Grafana, under Dashboards > Import, upload the template grafana-nmon-dashboard.json and choose the Prometheus data source.
Values: nmon_monitor_status (0 unknown, 1 ok, 2 warning, 3 critical), nmon_monitor_up, nmon_monitor_response_seconds, nmon_monitor_uptime_ratio (24 hours), nmon_website_http_status, nmon_certificate_expiry_timestamp_seconds, nmon_domain_expiry_timestamp_seconds, nmon_server_cpu_percent, nmon_server_ram_used_bytes, nmon_server_disk_used_percent, nmon_server_load1, nmon_incidents_open. Every monitor carries the labels monitor, id, name and group.
Example of a Prometheus alert, certificate expires in less than 14 days: nmon_certificate_expiry_timestamp_seconds - time() < 14*86400