Skip to content

Commit d61fef8

Browse files
authored
Handle smart raw values >2^31
"%d" in awk will truncate values at 2^31. S.M.A.R.T. values can exceed that, thus use a floating point notation instead to encode larger values (at the possible cost of some precision).
1 parent 620e993 commit d61fef8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

text_collector_examples/smartmon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $1 ~ /^[0-9]+$/ && $2 ~ /^[a-zA-Z0-9_-]+$/ {
1515
printf "%s_value{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $4
1616
printf "%s_worst{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $5
1717
printf "%s_threshold{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $6
18-
printf "%s_raw_value{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $10
18+
printf "%s_raw_value{%s,smart_id=\"%s\"} %e\n", $2, labels, $1, $10
1919
}
2020
SMARTCTLAWK
2121
)"

0 commit comments

Comments
 (0)