Prometheus und Grafana
nMon1 stellt die aktuellen Werte aller Monitore im Prometheus-Format bereit: https://temedum-xuvul.185-94-252-101.webspace123.de//metrics.php. So landen Status, Antwortzeiten, Verfügbarkeit, Zertifikatsabläufe und Serverwerte in Ihrem eigenen Prometheus und Grafana.
- Unter Profil > API-Tokens einen Token mit Recht Lesen anlegen. Er sieht genau die Monitore Ihres Benutzers.
- In der
prometheus.ymleinen Job eintragen:scrape_configs: - job_name: nmon scrape_interval: 60s metrics_path: /metrics.php scheme: https authorization: credentials: nmon_IHR_TOKEN static_configs: - targets: ["ihr-nmon-server.de"] - In Grafana unter Dashboards > Importieren die Vorlage grafana-nmon-dashboard.json hochladen und die Prometheus-Datenquelle wählen.
Werte: nmon_monitor_status (0 unbekannt, 1 OK, 2 Warnung, 3 Alarm), nmon_monitor_up, nmon_monitor_response_seconds, nmon_monitor_uptime_ratio (24 Stunden), 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. Jeder Monitor trägt die Labels monitor, id, name und group.
Beispiel für einen Alarm in Prometheus: Zertifikat läuft in weniger als 14 Tagen ab: nmon_certificate_expiry_timestamp_seconds - time() < 14*86400