Skip to content

Commit

Permalink
fix(inputs.smart): Improve regexp to support flags with a plus (#14996)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akito0723 committed Mar 15, 2024
1 parent a2ec012 commit 19ac5e8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/inputs/smart/smart.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ var (
// 1 Raw_Read_Error_Rate -O-RC- 200 200 000 - 0
// 5 Reallocated_Sector_Ct PO--CK 100 100 000 - 0
// 192 Power-Off_Retract_Count -O--C- 097 097 000 - 14716
attribute = regexp.MustCompile(`^\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\+\.]+).*$`)

// ID# ATTRIBUTE_NAME FLAGS VALUE WORST THRESH FAIL RAW_VALUE
// 1 Raw_Read_Error_Rate PO-RC-+ 200 200 051 - 30
// 5 Reallocated_Sector_Ct POS-C-+ 200 200 140 - 0
// 192 Power-Off_Retract_Count -O-RCK+ 200 200 000 - 4
attribute = regexp.MustCompile(`^\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\+\.]+).*$`)

// Additional Smart Log for NVME device:nvme0 namespace-id:ffffffff
// nvme version 1.14+ metrics:
Expand Down

0 comments on commit 19ac5e8

Please sign in to comment.