Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[[inputs.smart]] SMART Attributes Data with different FLAGS #14995

Closed
Akito0723 opened this issue Mar 15, 2024 · 1 comment · Fixed by #14996
Closed

[[inputs.smart]] SMART Attributes Data with different FLAGS #14995

Akito0723 opened this issue Mar 15, 2024 · 1 comment · Fixed by #14996

Comments

@Akito0723
Copy link
Contributor

smartctl --info --attributes --health -n standby --format=brief /dev/sda
and my disk SMART Attributes Data:

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAGS    VALUE WORST THRESH FAIL RAW_VALUE
  1 Raw_Read_Error_Rate     PO-RC-+  200   200   051    -    30
  3 Spin_Up_Time            POSRCK+  230   230   021    -    5466
  4 Start_Stop_Count        -OS-CK+  100   100   000    -    6
  5 Reallocated_Sector_Ct   POS-C-+  200   200   140    -    0
  7 Seek_Error_Rate         PO-RCK+  200   200   051    -    0
  9 Power_On_Hours          -OSRCK+  092   092   000    -    5867
 10 Spin_Retry_Count        POS-CK+  100   253   051    -    0
 11 Calibration_Retry_Count -OSRCK+  100   253   051    -    0
 12 Power_Cycle_Count       -OSRCK+  100   100   000    -    6
184 End-to-End_Error        POSRCK+  100   100   097    -    0
187 Reported_Uncorrect      -OS-CK+  100   088   000    -    24
188 Command_Timeout         -OS--K+  100   100   000    -    0
190 Airflow_Temperature_Cel -O-RCK+  058   046   000    -    42
192 Power-Off_Retract_Count -O-RCK+  200   200   000    -    4
193 Load_Cycle_Count        --S-CK+  200   200   000    -    2
194 Temperature_Celsius     -OSRCK+  110   098   000    -    42
195 Hardware_ECC_Recovered  -OSRC-+  200   200   000    -    0
196 Reallocated_Event_Count -O-RCK+  200   200   000    -    0
197 Current_Pending_Sector  -OS-CK+  200   200   000    -    0
198 Offline_Uncorrectable   -OSRCK+  100   253   000    -    0
199 UDMA_CRC_Error_Count    -OS--K+  200   200   000    -    0
200 Multi_Zone_Error_Rate   POSRCK+  100   253   051    -    0
                            ||||||_ K auto-keep
                            |||||__ C event count
                            ||||___ R error rate
                            |||____ S speed/performance
                            ||_____ O updated online
                            |______ P prefailure warning

This regex ^\s*([0-9]+)\s(\S+)\s+([-P][-O][-S][-R][-C][-K])\s+([0-9]+)\s+([0-9]+)\s+([0-9-]+)\s+([-\w]+)\s+([\w\+\.]+).*$cannot match my SMART Attributes Data.
Is it possible to modify the regex to include ([+]?) for matching?
The new regex looks like this:
^\s*([0-9]+)\s(\S+)\s+([-P][-O][-S][-R][-C][-K])([\+]?)\s+([0-9]+)\s+([0-9]+)\s+([0-9-]+)\s+([-\w]+)\s+([\w\+\.]+).*$

@srebhan
Copy link
Member

srebhan commented Mar 15, 2024

Commented in the PR, we need the "No AI generated code was used in this PR" box to be ticked otherwise the PR looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants