Report SATA PHY stats to smartctl_device_statistics.

This commit is contained in:
Octavian Cerna 2020-07-26 23:35:22 +03:00
parent 3feff84fbb
commit e8d95208d7
1 changed files with 16 additions and 0 deletions

View File

@ -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 {