prometheus / node_exporter

Exporter for machine metrics
https://prometheus.io/
Apache License 2.0
11.18k stars 2.36k forks source link

smartmon.py ignore raw value #1295

Open hadmut opened 5 years ago

hadmut commented 5 years ago

Host operating system: output of uname -a

Linux 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

commit 2f87b7cba6d6eb729a78724335fd59e746fcdff4

Hi,

I'm testing the text_collector_examples/smartmon.py script. It ignores those smartmon values, where the raw value is important.

E.g.

smartctl -a /dev/sda outputs ... 9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 9306 ...

where 9306 is the important information. smartmon.py just gives smartmon_attr_threshold{name="power_on_hours",disk="/dev/sda"} 0 smartmon_attr_value{name="power_on_hours",disk="/dev/sda"} 100 smartmon_attr_worst{name="power_on_hours",disk="/dev/sda"} 100

which is useless.

smartmon.sh is better.

baryluk commented 5 years ago

There are many other ones that are important to monitor as raw, Factory_Bad_Block_Ct , Power_Cycle_Count , Power_On_Hours , Wear_Leveling_Count , Unexpect_Power_Loss_Ct , Factory_Bad_Block_Ct , Perc_Rated_Life_Used (probably), Lifetime_Writes , Reallocated_Sector_Ct , Raw_Read_Error_Rate , Start_Stop_Count , Temperature_Celsius , UDMA_CRC_Error_Count , Offline_Uncorrectable , Current_Pending_Sector , and few more.

It appears that raw value is parsed in the script https://github.com/prometheus/node_exporter/blob/master/text_collector_examples/smartmon.py#L287 , but this is not used for anything.