prometheus-community / smartctl_exporter

Export smartctl statistics to prometheus
Apache License 2.0
293 stars 88 forks source link

Is there a metric which corresponds to the power mode? #195

Open AeroNotix opened 8 months ago

AeroNotix commented 8 months ago

Hi,

looking to keep an eye on which power state a disk is in. E.g. IDLE_A, IDLE_B etc. Looking over the metrics being exported for the setup I have, nothing seems to indicate they cover the power state.

Am I missing something or is this an attribute which isn't currently exported?

robbat2 commented 8 months ago

@AeroNotix to the best of what I can see from drives in my fleet, that is NOT something exported by underlying smartctl at all.

I don't even see it in sysfs that might be exported via node_exporter either.

AeroNotix commented 8 months ago
sudo smartctl -i -n standby /dev/sde                                                                             ~
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.6.10-arch1-1] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Seagate IronWolf
Device Model:     ST8000VN004-3CP101
Serial Number:    WWZ3TJ59
LU WWN Device Id: 5 000c50 0f67ac4ba
Firmware Version: SC60
User Capacity:    8,001,563,222,016 bytes [8.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database 7.3/5528
ATA Version is:   ACS-4 (minor revision not indicated)
SATA Version is:  SATA 3.3, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Fri Jan 19 20:48:39 2024 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Power mode was:   IDLE_A

smartctl -i reports this under Power mode was.

k0ste commented 8 months ago

May be

[root@host]$ smartctl --json --info --health --attributes \
--tolerance=verypermissive --nocheck=standby \
--format=brief --log=error \
--get=apm /dev/sda | jq '.ata_apm'
{
  "enabled": true,
  "level": 128,
  "string": "minimum power consumption without standby",
  "max_performance": false,
  "min_power": true,
  "with_standby": false
}
robbat2 commented 8 months ago

Nope, those aren't the same. That is the power mode settings.

Not the power mode.

It looks like the smartmontools source has a function ataCheckPowerMode, but it's not exposed in JSON at all.

Please open an upstream ticket for smartmontools to add that data to the JSON.

AeroNotix commented 8 months ago

https://github.com/smartmontools/smartmontools/pull/239 upstream PR opened here.