diff options
author | Rene Treffer <treffer+github@measite.de> | 2017-03-21 10:47:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 10:47:27 +0100 |
commit | d61fef8ce6cc14f55aff89a5e210369d4363f810 (patch) | |
tree | f849502ae51a17368a531516ed2b6d5e822137c5 /text_collector_examples | |
parent | 620e9937e6c19f2797da79086e058082ab7ad530 (diff) | |
download | prometheus_node_collector-d61fef8ce6cc14f55aff89a5e210369d4363f810.tar.bz2 prometheus_node_collector-d61fef8ce6cc14f55aff89a5e210369d4363f810.tar.xz prometheus_node_collector-d61fef8ce6cc14f55aff89a5e210369d4363f810.zip |
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).
Diffstat (limited to 'text_collector_examples')
-rwxr-xr-x | text_collector_examples/smartmon.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/text_collector_examples/smartmon.sh b/text_collector_examples/smartmon.sh index 3ba9e3b..ed50c87 100755 --- a/text_collector_examples/smartmon.sh +++ b/text_collector_examples/smartmon.sh | |||
@@ -15,7 +15,7 @@ $1 ~ /^[0-9]+$/ && $2 ~ /^[a-zA-Z0-9_-]+$/ { | |||
15 | printf "%s_value{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $4 | 15 | printf "%s_value{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $4 |
16 | printf "%s_worst{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $5 | 16 | printf "%s_worst{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $5 |
17 | printf "%s_threshold{%s,smart_id=\"%s\"} %d\n", $2, labels, $1, $6 | 17 | 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 |
19 | } | 19 | } |
20 | SMARTCTLAWK | 20 | SMARTCTLAWK |
21 | )" | 21 | )" |