Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error message humanization #40

Open
532910 opened this issue Aug 14, 2019 · 2 comments
Open

error message humanization #40

532910 opened this issue Aug 14, 2019 · 2 comments

Comments

@532910
Copy link

532910 commented Aug 14, 2019

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.
@Self-Perfection
Copy link
Contributor

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/*

@532910 532910 changed the title could not convert string to float error message humanization Sep 5, 2019
@532910
Copy link
Author

532910 commented Sep 5, 2019

Sory for late response. co2mond has never been runned. Issue updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants