Netdata Community

ZoneMinder netdata collector

Hi

I made a collector to capture and monitor ZoneMinder data. ZoneMinder is an open source video surveillance software. I did the collector as I had the need to monitor my cameras.

Code can be found here: https://github.com/pepe386/netdata-zoneminder

I wish to do a pull request, but before I have some questions:

The zoneminder python collector uses a couple of external libraries (requests and PyJWT). Is this acceptable for a pull request? I can include the libraries in the python_modules directory for the PR.

I originally wanted to use UrlService, but I need to do both post and get http requests, so I went with the “requests” library for easiness. I guess I can remove this dependency and use urllib3 which is already included in the python_modules directory. Will this be needed? Or more in general, is it preferred or needed to avoid having external dependencies?

Hope this is the right place to discuss this, but I can also open a github issue if needed.

@ilyam8 thanks for your response. I’ll add the optional imports and will submit pull request. Maybe later I can change it to golang as well.

Ok, i think the easiest way is to add it as is - with optional requests and PyJWT packages. If there is interest in that module we rewrite it in golang so we get rid of dependencies.

I originally wanted to use UrlService, but I need to do both post and get http requests

just noticed it, let me see

Hi.

requests

we have urllib3 vendored, i suggest to use it, there is UrlService base class.

https://github.com/netdata/netdata/tree/master/collectors/python.d.plugin#urlservice
https://github.com/netdata/netdata/blob/f47b430780b812b37b5bba241982c4741dc934b7/collectors/python.d.plugin/python_modules/bases/FrameworkServices/UrlService.py#L37-L56

PyJWT

No need to include it, make it optional like

https://github.com/netdata/netdata/blob/f47b430780b812b37b5bba241982c4741dc934b7/collectors/python.d.plugin/isc_dhcpd/isc_dhcpd.chart.py#L195-L198