From fc8b3125b9d35dd91cf49ede99fe5918443b257c Mon Sep 17 00:00:00 2001 From: Martin Hansen Date: Wed, 17 Jul 2024 09:17:41 +0200 Subject: [PATCH] updated dashboards --- README.md | 2 +- grafana/idrac.json | 27 +++++++-------------------- grafana/idrac_overview.json | 27 +++++++-------------------- internal/collector/collector.go | 2 +- internal/collector/model.go | 1 + 5 files changed, 17 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index d2b64d9..e9e8553 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ idrac_power_control_interval_in_minutes{id="0",name="System Power Control"} 1 This is not exactly an ordinary metric, but it is often convenient to be informed about new entries in the event log. The value of this metric is the unix timestamp for when the entry was created. ```text -idrac_log_entry{id="1",message="The process of installing an operating system or hypervisor is successfully completed",severity="OK"} 1631175352 +idrac_events_log_entry{id="1",message="The process of installing an operating system or hypervisor is successfully completed",severity="OK"} 1631175352 ``` ### Storage diff --git a/grafana/idrac.json b/grafana/idrac.json index 567feb8..bab885e 100644 --- a/grafana/idrac.json +++ b/grafana/idrac.json @@ -25,12 +25,12 @@ "uid": "${datasource}" }, "enable": true, - "expr": "idrac_sel_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 < ${__to} and \nidrac_sel_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 > ${__from}", + "expr": "idrac_events_log_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 < ${__to} and \nidrac_events_log_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 > ${__from}", "iconColor": "purple", "name": "SEL", - "tagKeys": "instance,component,severity", + "tagKeys": "instance,severity", "textFormat": "{{ message }}", - "titleFormat": "{{id}}:{{ component }}", + "titleFormat": "{{ id }}", "useValueForTime": "on" } ] @@ -2644,18 +2644,6 @@ } ] }, - { - "matcher": { - "id": "byName", - "options": "component" - }, - "properties": [ - { - "id": "custom.width", - "value": 217 - } - ] - }, { "matcher": { "id": "byName", @@ -2699,10 +2687,10 @@ }, "editorMode": "code", "exemplar": false, - "expr": "idrac_sel_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 < ${__to} and \nidrac_sel_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 > ${__from}", + "expr": "idrac_events_log_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 < ${__to} and \nidrac_events_log_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 > ${__from}", "format": "table", "instant": true, - "legendFormat": "{{id}} {{component}}: {{message}}", + "legendFormat": "{{ id }}: {{ message }}", "range": false, "refId": "A" } @@ -2737,7 +2725,7 @@ "id": "filterFieldsByName", "options": { "include": { - "pattern": "message|id|component|severity|Value" + "pattern": "message|id|severity|Value" } } }, @@ -2747,10 +2735,9 @@ "excludeByName": {}, "indexByName": { "Value": 0, - "component": 4, "id": 2, "instance": 1, - "message": 5, + "message": 4, "severity": 3 }, "renameByName": { diff --git a/grafana/idrac_overview.json b/grafana/idrac_overview.json index 61eff1e..fc4b2ef 100644 --- a/grafana/idrac_overview.json +++ b/grafana/idrac_overview.json @@ -25,12 +25,12 @@ "uid": "${datasource}" }, "enable": true, - "expr": "idrac_sel_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 < ${__to} and \nidrac_sel_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 > ${__from}", + "expr": "idrac_events_log_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 < ${__to} and \nidrac_events_log_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 > ${__from}", "iconColor": "purple", "name": "SEL", - "tagKeys": "instance,component,severity", + "tagKeys": "instance,severity", "textFormat": "{{ message }}", - "titleFormat": "{{id}}:{{ component }}", + "titleFormat": "{{ id }}", "useValueForTime": "on" } ] @@ -1828,18 +1828,6 @@ } ] }, - { - "matcher": { - "id": "byName", - "options": "component" - }, - "properties": [ - { - "id": "custom.width", - "value": 217 - } - ] - }, { "matcher": { "id": "byName", @@ -1881,10 +1869,10 @@ }, "editorMode": "code", "exemplar": false, - "expr": "idrac_sel_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 < ${__to} and \nidrac_sel_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 > ${__from}", + "expr": "idrac_events_log_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 < ${__to} and \nidrac_events_log_entry{job=~\"$job\", instance=~\"$instance\"} * 1000 > ${__from}", "format": "table", "instant": true, - "legendFormat": "{{id}} {{component}}: {{message}}", + "legendFormat": "{{ id }}: {{ message }}", "range": false, "refId": "A" } @@ -1919,7 +1907,7 @@ "id": "filterFieldsByName", "options": { "include": { - "pattern": "instance|message|id|component|severity|Value" + "pattern": "instance|message|id|severity|Value" } } }, @@ -1929,10 +1917,9 @@ "excludeByName": {}, "indexByName": { "Value": 0, - "component": 4, "id": 2, "instance": 1, - "message": 5, + "message": 4, "severity": 3 }, "renameByName": { diff --git a/internal/collector/collector.go b/internal/collector/collector.go index 071aabd..d2faf94 100644 --- a/internal/collector/collector.go +++ b/internal/collector/collector.go @@ -211,7 +211,7 @@ func NewCollector() *Collector { []string{"id", "name"}, nil, ), EventLogEntry: prometheus.NewDesc( - prometheus.BuildFQName(prefix, "log", "entry"), + prometheus.BuildFQName(prefix, "events", "log_entry"), "Entry from the system event log", []string{"id", "message", "severity"}, nil, ), diff --git a/internal/collector/model.go b/internal/collector/model.go index 51d9bb5..5e53a7b 100644 --- a/internal/collector/model.go +++ b/internal/collector/model.go @@ -476,6 +476,7 @@ type EventLogResponse struct { Description string `json:"Description"` Members []struct { Id string `json:"Id"` + EventId string `json:"EventId"` Name string `json:"Name"` Created string `json:"Created"` Description string `json:"Description"`