From 6bc445a827ffd297984168698e0ea1c40d90d389 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Fri, 24 Feb 2023 10:37:37 +0100 Subject: [PATCH] Added controller id. --- cmon_exporter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmon_exporter.go b/cmon_exporter.go index 1b94a24..e63c994 100644 --- a/cmon_exporter.go +++ b/cmon_exporter.go @@ -32,7 +32,7 @@ const namespace = "cmon" var ( labels = []string{"ClusterName", "ClusterID", "ControllerId"} labels2 = []string{"ControllerId"} - labelsCmon = []string{"CmonVersion"} + labelsCmon = []string{"CmonVersion", "ControllerId"} up = prometheus.NewDesc( prometheus.BuildFQName(namespace, "", "up"), "Was the last CMON query successful.", @@ -191,7 +191,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) { // _, _ := json.Marshal(res) // } ch <- prometheus.MustNewConstMetric( - up, prometheus.GaugeValue, 1, serverVersion) + up, prometheus.GaugeValue, 1, serverVersion, controllerId) totalCriticalAlarms, totalCount, totalStarted, totalDegraded, totalStopped, totalUnknown, totalFailed, totalBackupFailedAlarms := 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 for _, cluster := range res.Clusters { // log.Println(cluster.Hosts[0])