ZMON's Python worker is doing the heavy lifting of executing tasks against entities, and evaluating all alerts assigned to check. Tasks are picked up from Redis and the resulting check values plus alert state changes are written back to Redis.
Start Redis on localhost:6379:
$ docker run -p 6379:6379 -it redisInstall the required development libraries:
Ubuntu/Debian:
$ sudo apt-get install build-essential python2.7-dev libpq-dev libldap2-dev libsasl2-dev libsnappy-dev
$ sudo pip2 install -r requirements.txtmacOS:
$ brew install python snappy
$ sudo pip install -r requirements.txtStart the ZMON worker process:
$ python2 -m zmon_worker_monitorYou can query the worker monitor via the REST API:
$ curl http://localhost:8080/statusYou can also query the worker monitor via RPC:
$ python2 -m zmon_worker_monitor.rpc_client http://localhost:23500/zmon_rpc list_statsRun tests via Tox.
$ toxYou can also pass args to pytest via tox, for instance to run specific test case:
$ tox tests/test_kairosdb.py::test_kairosdb_queryAlternative way of running unit tests within Docker:
$ export WORKER_IMAGE=registry.opensource.zalan.do/stups/zmon-worker:cd166
$ docker run -it -u $(id -u) -v $(pwd):/workdir -w /workdir $WORKER_IMAGE python setup.py flake8
$ docker run -it -u $(id -u) -v $(pwd):/workdir -w /workdir $WORKER_IMAGE python setup.py test$ sudo pip3 install -U scm-source
$ scm-source
$ docker build -t zmon-worker .
$ docker run -it zmon-workerThe Docker image supports many configuration options via environment variables. Configuration options are explained in the ZMON Documentation.