Collectd Plugin #13

Merged
sqozz merged 3 commits from cfr34k/sem6000:collectd into master 2020-05-02 19:26:20 +02:00
Contributor

This aims to create a plugin for collectd that can read data from multiple SEM6000 devices.

Current progress:

  • Status monitoring works
  • Multiple devices can be read out
  • README updated with some documentation

Not working very well yet:

  • If a configured socket is unreachable, samples are lost for all devices because all devices are queried sequentially and the connect timeout is about 30 seconds ➡️ maybe use one thread per device?
This aims to create a plugin for collectd that can read data from multiple SEM6000 devices. Current progress: - Status monitoring works - Multiple devices can be read out - README updated with some documentation Not working very well yet: - If a configured socket is unreachable, samples are lost for all devices because all devices are queried sequentially and the connect timeout is about 30 seconds :arrow_right: maybe use one thread per device?
sqozz approved these changes 2020-01-21 09:25:08 +01:00
sqozz left a comment
Owner

Just minor nitpicks, definitely happy to have this PR :)
What is your opinion of using the mac to submit values?

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
Owner

did you want to indicate root rights for these commands (because of the preceding #)? If not, I'd prefer $ as shell indicator :)

did you want to indicate root rights for these commands (because of the preceding `#`)? If not, I'd prefer `$` as shell indicator :)
Author
Contributor

Yes, the # should indicate required root access.

Yes, the `#` should indicate required root access.
@ -0,0 +7,4 @@
import collectd
from sem6000 import SEMSocket
import bluepy
Owner

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.

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.
Author
Contributor

Sounds reasonable. I'll do that!

Sounds reasonable. I'll do that!
@ -0,0 +97,4 @@
inst['lastsuccess'] = time.time()
val = collectd.Values(plugin = 'sem6000-{}'.format(config['socketname']))
Owner

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.

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.
Author
Contributor

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.

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` :wink: in the collectd config.
cfr34k changed title from WIP: Collectd Plugin to Collectd Plugin 2020-01-22 21:17:18 +01:00
Author
Contributor

I hereby declare this ready for an initial integration, as I don't have a great solution for the reconnect duration right now.

I hereby declare this ready for an initial integration, as I don't have a great solution for the reconnect duration right now.
sqozz closed this pull request 2020-05-02 19:26:20 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: sqozz/sem6000#13
No description provided.