Merge pull request #82 from k0ste/help

Removed doubled NVMe metrics
This commit is contained in:
Ben Kochie 2022-10-14 07:43:45 +02:00 committed by GitHub
commit ed7dbafd00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 90 deletions

View file

@ -289,17 +289,6 @@ var (
},
nil,
)
metricCriticalWarning = prometheus.NewDesc(
"critical_warning",
"Critical warning counter",
[]string{
"device",
"model_family",
"model_name",
"serial_number",
},
nil,
)
metricDeviceStatus = prometheus.NewDesc(
"smartctl_device_status",
"Device status",
@ -311,17 +300,6 @@ var (
},
nil,
)
metricAvailableSpare = prometheus.NewDesc(
"available_spare",
"Available spare",
[]string{
"device",
"model_family",
"model_name",
"serial_number",
},
nil,
)
metricDeviceErrorLogCount = prometheus.NewDesc(
"smartctl_device_error_log_count",
"Device SMART error log count",
@ -334,17 +312,6 @@ var (
},
nil,
)
metricMediaErrors = prometheus.NewDesc(
"media_errors",
"Media errors counter",
[]string{
"device",
"model_family",
"model_name",
"serial_number",
},
nil,
)
metricDeviceSelfTestLogCount = prometheus.NewDesc(
"smartctl_device_self_test_log_count",
"Device SMART self test log count",
@ -357,17 +324,6 @@ var (
},
nil,
)
metricSmartStatus = prometheus.NewDesc(
"smart_status",
"Smart status",
[]string{
"device",
"model_family",
"model_name",
"serial_number",
},
nil,
)
metricDeviceSelfTestLogErrorCount = prometheus.NewDesc(
"smartctl_device_self_test_log_error_count",
"Device SMART self test log error count",

View file

@ -68,8 +68,6 @@ func (smart *SMARTctl) Collect() {
smart.minePowerCycleCount()
smart.mineDeviceSCTStatus()
smart.mineDeviceStatistics()
smart.mineNvmeSmartHealthInformationLog()
smart.mineNvmeSmartStatus()
smart.mineDeviceStatus()
smart.mineDeviceErrorLog()
smart.mineDeviceSelfTestLog()
@ -442,37 +440,6 @@ func (smart *SMARTctl) mineLongFlags(json gjson.Result, flags []string) string {
return strings.Join(result, ",")
}
func (smart *SMARTctl) mineNvmeSmartHealthInformationLog() {
iHealth := smart.json.Get("nvme_smart_health_information_log")
smart.ch <- prometheus.MustNewConstMetric(
metricCriticalWarning,
prometheus.GaugeValue,
iHealth.Get("critical_warning").Float(),
smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
)
smart.ch <- prometheus.MustNewConstMetric(
metricAvailableSpare,
prometheus.GaugeValue,
iHealth.Get("available_spare").Float(),
smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
)
smart.ch <- prometheus.MustNewConstMetric(
metricMediaErrors,
prometheus.GaugeValue,
iHealth.Get("media_errors").Float(),
smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
)
}
func (smart *SMARTctl) mineDeviceStatus() {
status := smart.json.Get("smart_status")
smart.ch <- prometheus.MustNewConstMetric(
@ -486,19 +453,6 @@ func (smart *SMARTctl) mineDeviceStatus() {
)
}
func (smart *SMARTctl) mineNvmeSmartStatus() {
iStatus := smart.json.Get("smart_status")
smart.ch <- prometheus.MustNewConstMetric(
metricSmartStatus,
prometheus.GaugeValue,
iStatus.Get("passed").Float(),
smart.device.device,
smart.device.family,
smart.device.model,
smart.device.serial,
)
}
func (smart *SMARTctl) mineDeviceErrorLog() {
for logType, status := range smart.json.Get("ata_smart_error_log").Map() {
smart.ch <- prometheus.MustNewConstMetric(