mirror of
https://github.com/prometheus-community/smartctl_exporter.git
synced 2024-11-23 01:43:07 +01:00
Merge pull request #137 from tekert/remove_duplicate2
Remove duplicate smartctl_device_status metric
This commit is contained in:
commit
8331d7f6a9
2 changed files with 0 additions and 19 deletions
|
@ -227,14 +227,6 @@ var (
|
||||||
},
|
},
|
||||||
nil,
|
nil,
|
||||||
)
|
)
|
||||||
metricDeviceStatus = prometheus.NewDesc(
|
|
||||||
"smartctl_device_status",
|
|
||||||
"Device status",
|
|
||||||
[]string{
|
|
||||||
"device",
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
)
|
|
||||||
metricDeviceErrorLogCount = prometheus.NewDesc(
|
metricDeviceErrorLogCount = prometheus.NewDesc(
|
||||||
"smartctl_device_error_log_count",
|
"smartctl_device_error_log_count",
|
||||||
"Device SMART error log count",
|
"Device SMART error log count",
|
||||||
|
|
11
smartctl.go
11
smartctl.go
|
@ -68,7 +68,6 @@ func (smart *SMARTctl) Collect() {
|
||||||
smart.minePowerCycleCount()
|
smart.minePowerCycleCount()
|
||||||
smart.mineDeviceSCTStatus()
|
smart.mineDeviceSCTStatus()
|
||||||
smart.mineDeviceStatistics()
|
smart.mineDeviceStatistics()
|
||||||
smart.mineDeviceStatus()
|
|
||||||
smart.mineDeviceErrorLog()
|
smart.mineDeviceErrorLog()
|
||||||
smart.mineDeviceSelfTestLog()
|
smart.mineDeviceSelfTestLog()
|
||||||
smart.mineDeviceERC()
|
smart.mineDeviceERC()
|
||||||
|
@ -388,16 +387,6 @@ func (smart *SMARTctl) mineLongFlags(json gjson.Result, flags []string) string {
|
||||||
return strings.Join(result, ",")
|
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() {
|
func (smart *SMARTctl) mineDeviceErrorLog() {
|
||||||
for logType, status := range smart.json.Get("ata_smart_error_log").Map() {
|
for logType, status := range smart.json.Get("ata_smart_error_log").Map() {
|
||||||
smart.ch <- prometheus.MustNewConstMetric(
|
smart.ch <- prometheus.MustNewConstMetric(
|
||||||
|
|
Loading…
Reference in a new issue