locationlabs / influxdb-nagios-plugin

InfluxDB Nagios Plugin
Apache License 2.0
6 stars 9 forks source link

Update to Python3 and minor updates #6

Open paulboot opened 4 years ago

paulboot commented 4 years ago

Dear Vince,

I needed a nagios plugin to monitor some values in influx so I played around with 'influxdb-nagios-plugin'. I updated the code to Python3 and tested on Python3.5.2. I think it is OK. Tweaked the documentation and added two examples to the README.

However I could not get the tests running, Pytest throws an error, I do not why because hamcrest is installed in my env.

$ pytest
Test session starts (platform: linux, Python 3.5.2, pytest 5.0.0, pytest-sugar 0.9.2)
rootdir: /home/paulb/dev/influxdb-nagios-plugin-paulb/influxdb-nagios-plugin
plugins: mock-1.10.4, sugar-0.9.2, dash-1.0.0
collecting ...
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― influxdbnagiosplugin/tests/test_query.py ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
ImportError while importing test module '/home/paulb/dev/influxdb-nagios-plugin-paulb/influxdb-nagios-plugin/influxdbnagiosplugin/tests/test_query.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test_query.py:4: in <module>
    from hamcrest import assert_that, is_, equal_to
E   ImportError: No module named 'hamcrest'

Could you review my PR and do a suggestion how to fix pytest.

With kind regards,

Paul Boot.