在一个小型的prometheus设置中,我收到了数百条这种风格的syslog消息:
Sep 23 08:09:01 raspi4-bolli gpsd-exporter[20242]: 0 {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/stdin","driver":"NMEA0183","activated":"2021-09-23T06:08:59.997Z","flags":1,"native":0,"bps":9600,"parity":"}]}
Sep 23 08:09:01 raspi4-bolli gpsd-exporter[20242]: Invalid control character at: line 1 column 173 (char 172)所以我在想: gpsd-exporter是用Python语言编写的,我会试着做一个抛出相同错误的最小运行示例(使用this gpsd library):
import gpsd
gpsd.connect()这将提供以下输出:
{"class":"VERSION","release":"3.17","rev":"3.17","proto_major":3,"proto_minor":12}
0 {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/stdin","driver":"NMEA0183","activated":"2021-09-23T06:35:47.017Z","flags":1,"native":0,"bps":9600,"parity":"}]}
0 {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/stdin","driver":"NMEA0183","activated":"2021-09-23T06:35:47.017Z","flags":1,"native":0,"bps":9600,"parity":"}]}
Invalid control character at: line 1 column 173 (char 172)
1 {"class":"WATCH","enable":true,"json":false,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}正如你所看到的,设备的答案是不完整的:"parity":"}]}。我不确定这是否与gpsd Python库或gpsd本身有关-我认为是后者,尽管我不确定原因。
发布于 2021-10-26 18:51:12
将gpsd更新到3.22 (在buster-backports repo中)似乎已经解决了这个问题。
https://stackoverflow.com/questions/69295087
复制相似问题