From e8d95208d7df55959facb0f892a4a00c94243844 Mon Sep 17 00:00:00 2001 From: Octavian Cerna Date: Sun, 26 Jul 2020 23:35:22 +0300 Subject: [PATCH] Report SATA PHY stats to smartctl_device_statistics. --- smartctl.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/smartctl.go b/smartctl.go index 3a0a409..5d0c977 100644 --- a/smartctl.go +++ b/smartctl.go @@ -271,6 +271,22 @@ func (smart *SMARTctl) mineDeviceStatistics() { ) } } + + for _, statistic := range smart.json.Get("sata_phy_event_counters.table").Array() { + smart.ch <- prometheus.MustNewConstMetric( + metricDeviceStatistics, + prometheus.GaugeValue, + statistic.Get("value").Float(), + smart.device.device, + smart.device.family, + smart.device.model, + smart.device.serial, + "SATA PHY Event Counters", + strings.TrimSpace(statistic.Get("name").String()), + "", + "", + ) + } } func (smart *SMARTctl) mineLongFlags(json gjson.Result, flags []string) string {