co2mon
co2mon copied to clipboard
error message humanization
If co2mond has never beed runned and CntR/Tamb are absent it gives could not convert string to float
instead of clean error message:
% cat /etc/collectd/collectd.conf.d/co2mon.conf
LoadPlugin python
<Plugin python>
ModulePath "/home/sergio/co2mon/graph/collectd"
LogTraces true
Interactive false
Import "co2mon"
</Plugin>
collectd: Unhandled python exception in read callback: ValueError: could not convert string to float:
collectd: Traceback (most recent call last):
collectd: File "/home/sergio/co2mon/graph/collectd/co2mon.py", line 26, in read_callback#012 co2 = [read_metric('CntR')]
collectd: File "/home/sergio/co2mon/graph/collectd/co2mon.py", line 12, in read_metric#012 return float(v)
collectd: ValueError: could not convert string to float:
collectd: read-function of plugin `python.co2mon' failed. Will suspend it for 40.000 seconds.
collectd: Unhandled python exception in read callback: ValueError: could not convert string to float:
collectd: Traceback (most recent call last):
collectd: File "/home/sergio/co2mon/graph/collectd/co2mon.py", line 26, in read_callback#012 co2 = [read_metric('CntR')]
collectd: File "/home/sergio/co2mon/graph/collectd/co2mon.py", line 12, in read_metric#012 return float(v)
collectd: ValueError: could not convert string to float:
collectd: read-function of plugin `python.co2mon' failed. Will suspend it for 80.000 seconds.
Hi
With this config co2mon.py should try to read values from /var/lib/co2mon/CntR
and /var/lib/co2mon/Tamb
. That is the default location where co2mond stores current readings. What do you have in this files? Pls show head /var/lib/co2mon/*
Sory for late response. co2mond has never been runned. Issue updated.