Merge pull request #137 from tekert/remove_duplicate2

Remove duplicate smartctl_device_status metric
This commit is contained in:
David Randall 2023-08-10 13:25:23 -04:00 committed by GitHub
commit 8331d7f6a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 19 deletions

View file

@ -227,14 +227,6 @@ var (
},
nil,
)
metricDeviceStatus = prometheus.NewDesc(
"smartctl_device_status",
"Device status",
[]string{
"device",
},
nil,
)
metricDeviceErrorLogCount = prometheus.NewDesc(
"smartctl_device_error_log_count",
"Device SMART error log count",

View file

@ -68,7 +68,6 @@ func (smart *SMARTctl) Collect() {
smart.minePowerCycleCount()
smart.mineDeviceSCTStatus()
smart.mineDeviceStatistics()
smart.mineDeviceStatus()
smart.mineDeviceErrorLog()
smart.mineDeviceSelfTestLog()
smart.mineDeviceERC()
@ -388,16 +387,6 @@ func (smart *SMARTctl) mineLongFlags(json gjson.Result, flags []string) string {
return strings.Join(result, ",")
}
func (smart *SMARTctl) mineDeviceStatus() {
status := smart.json.Get("smart_status")
smart.ch <- prometheus.MustNewConstMetric(
metricDeviceStatus,
prometheus.GaugeValue,
status.Get("passed").Float(),
smart.device.device,
)
}
func (smart *SMARTctl) mineDeviceErrorLog() {
for logType, status := range smart.json.Get("ata_smart_error_log").Map() {
smart.ch <- prometheus.MustNewConstMetric(