Collectd Plugin #13
Loading…
Reference in a new issue
No description provided.
Delete branch "cfr34k/sem6000:collectd"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This aims to create a plugin for collectd that can read data from multiple SEM6000 devices.
Current progress:
Not working very well yet:
Just minor nitpicks, definitely happy to have this PR :)
What is your opinion of using the mac to submit values?
@ -10,0 +25,4 @@
```shell
# mkdir -p /usr/local/lib/collectd/python
# cp collectd/collectd_sem6000.py /usr/local/lib/collectd/python
did you want to indicate root rights for these commands (because of the preceding
#
)? If not, I'd prefer$
as shell indicator :)Yes, the
#
should indicate required root access.@ -0,0 +7,4 @@
import collectd
from sem6000 import SEMSocket
import bluepy
maybe just import the exception here? I don't know if it makes any performance difference but at least it would be less confusing why bluepy is needed in here.
Sounds reasonable. I'll do that!
@ -0,0 +97,4 @@
inst['lastsuccess'] = time.time()
val = collectd.Values(plugin = 'sem6000-{}'.format(config['socketname']))
I'd prefer to use the BT mac instead of a string as plugin name here. There's a good chance we can read the name of the socket over BT and expose it later with this plugin which would allow a mapping even if the name changes.
Are you sure that the name is actually stored on the socket? My feeling is that that’s only a mapping in the app.
I prefer to have a string in the plugin name, because it indicates the purpose of the measurements (which can change as devices are reused). If you don't like it, just copy the address into
SocketName
😉 in the collectd config.WIP: Collectd Pluginto Collectd PluginI hereby declare this ready for an initial integration, as I don't have a great solution for the reconnect duration right now.