Control: found -1 0+git20210115.7d89f19-1
Control: tags -1 + patch

[Daniel Swarbrick]
> Sadly I am not able to reproduce this (in a de_DE.UTF-8 locale).

I ran into this on a machine using the nb_NO.UTF-8 locale.

My journald log swould show lines like tihs:

nov. 20 10:48:41 somehost prometheus-node-exporter[3154]: level=error 
ts=2022-11-20T09:48:41.802Z caller=textfile.go:209 collector=textfile 
msg="failed to collect textfile data" file=smartmon.prom err="failed to parse 
textfile data from \"/var/lib/prometheus/node-exporter/smartmon.prom\": text 
format parsing error in line 6: expected float as value, got \"1,000000e+00\""

I fixed it by adding the following code snippet at the start of
/usr/share/prometheus-node-exporter-collectors/smartmon.sh:

  LC_ALL=C
  export LC_ALL


--- smartmon.sh.old    2022-11-20 11:04:25.743602052 +0100
+++ smartmon.sh  2022-11-20 10:49:33.866521913 +0100
@@ -10,6 +10,9 @@
 # Formatting done via shfmt -i 2
 # https://github.com/mvdan/sh
 
+LC_ALL=C
+export LC_ALL
+
 parse_smartctl_attributes_awk="$(
   cat <<'SMARTCTLAWK'
 $1 ~ /^ *[0-9]+$/ && $2 ~ /^[a-zA-Z0-9_-]+$/ {

-- 
Happy hacking
Petter Reinholdtsen

Reply via email to