prometheus-community / node-exporter-textfile-collector-scripts

Scripts for node-exporter's textfile collector
Apache License 2.0
513 stars 191 forks source link

nvme_metrics.sh: ensure consistent & predictable numeric format #134

Closed dswarbrick closed 1 year ago

dswarbrick commented 1 year ago

nvme-cli 2.3 and later appears to output numeric values in localized style (even in JSON output), e.g. using comma as thousands separator.

Similar to smartmon.sh, set LC_ALL=C to ensure the least fancy output.

Signed-off-by: Daniel Swarbrick daniel.swarbrick@gmail.com

cc: @anarcat

dswarbrick commented 1 year ago

i typically use C.UTF-8 to avoid things falling over if non-ASCII stuff comes up, just as a general precaution.

If these scripts were only used by Debian (which AFAIK got the C.UTF-8 ball rolling), I would agree. However, these scripts are also used by non-Debian and even non-Linux platforms, which may not have such widespread support of C.UTF-8.

glibc 2.35+ includes C.UTF-8, but not all systems run glibc.

anarcat commented 1 year ago

oh i didn't know that was a debianism, makes sense then