Skip to content

Commit

Permalink
Handle smart raw values >2^31
Browse files Browse the repository at this point in the history
"%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).
  • Loading branch information
rtreffer authored Mar 21, 2017
1 parent 620e993 commit d61fef8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion text_collector_examples/smartmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $1 ~ /^[0-9]+$/ && $2 ~ /^[a-zA-Z0-9_-]+$/ {
printf "%s_value{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $4
printf "%s_worst{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $5
printf "%s_threshold{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $6
printf "%s_raw_value{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $10
printf "%s_raw_value{%s,smart_id=\"%s\"} %e\n", $2, labels, $1, $10
}
SMARTCTLAWK
)"
Expand Down

0 comments on commit d61fef8

Please sign in to comment.