Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ var (
},
nil,
)
metricDeviceVolatileMemoryBackupFailed = prometheus.NewDesc(
"smartctl_device_volatile_memory_backup_failed",
"Indicates that Volatile Memory Backup (NVMe PLP) is failed",
[]string{
"device",
},
nil,
)
metricDeviceBytesRead = prometheus.NewDesc(
"smartctl_device_bytes_read",
"",
Expand Down
18 changes: 17 additions & 1 deletion smartctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func (smart *SMARTctl) Collect() {
smart.mineNvmeCriticalWarning()
smart.mineNvmeMediaErrors()
smart.mineNvmeNumErrLogEntries()
smart.mineNvmeVolatileMemoryBackupFailed()
smart.mineNvmeBytesRead()
smart.mineNvmeBytesWritten()
}
Expand Down Expand Up @@ -382,6 +383,21 @@ func (smart *SMARTctl) mineNvmeNumErrLogEntries() {
)
}

func (smart *SMARTctl) mineNvmeVolatileMemoryBackupFailed() {
nvmeStatus := smart.json.Get("smart_status.nvme")
if nvmeStatus.Exists() {
volatileMemoryBackupFailed := nvmeStatus.Get("volatile_memory_backup_failed")
if volatileMemoryBackupFailed.Exists() {
smart.ch <- prometheus.MustNewConstMetric(
metricDeviceVolatileMemoryBackupFailed,
prometheus.CounterValue,
volatileMemoryBackupFailed.Float(),
smart.device.device,
)
}
}
}

// https://nvmexpress.org/wp-content/uploads/NVM-Express-NVM-Command-Set-Specification-1.0d-2023.12.28-Ratified.pdf
// 4.1.4.2 SMART / Health Information (02h)
// The SMART / Health Information log page is as defined in the NVM Express Base Specification. For the
Expand Down Expand Up @@ -472,7 +488,7 @@ func (smart *SMARTctl) mineSmartStatus() {
if smartStatus.Exists() {
smart.ch <- prometheus.MustNewConstMetric(
metricDeviceSmartStatus,
prometheus.GaugeValue,
prometheus.CounterValue,
smartStatus.Get("passed").Float(),
smart.device.device,
)
Expand Down
Loading