Giter Site home page Giter Site logo

zmon-worker's Introduction

ZMON Worker

Build Status

Coverage Status

Latest PyPI version

OpenTracing enabled

License

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.

Local Development

Start Redis on localhost:6379:

$ docker run -p 6379:6379 -it redis

Install the required development libraries:

Ubuntu/Debian:

$ sudo apt-get install build-essential python2.7-dev libpq-dev libldap2-dev libsasl2-dev libsnappy-dev libev4 libev-dev freetds-dev
$ sudo pip2 install -r requirements.txt

macOS:

$ brew install python snappy
$ sudo pip install -r requirements.txt

Start the ZMON worker process:

$ python2 -m zmon_worker_monitor

You can query the worker monitor via the REST API:

$ curl http://localhost:8080/status

You can also query the worker monitor via RPC:

$ python2 -m zmon_worker_monitor.rpc_client http://localhost:23500/zmon_rpc list_stats

Running Unit Tests

Run tests via Tox.

$ tox

You can also pass args to pytest via tox, for instance to run specific test case:

$ tox tests/test_kairosdb.py::test_kairosdb_query

Alternative 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

Building the Docker Image

$ docker build -t zmon-worker .
$ docker run -it zmon-worker

Running the Docker image

The Docker image supports many configuration options via environment variables. Configuration options are explained in the ZMON Documentation.

zmon-worker's People

Contributors

jan-m avatar hjacobs avatar mohabusama avatar vetinari avatar twz123 avatar drummerwolli avatar prayerslayer avatar a1exsh avatar avaczi avatar olevchyk avatar whiskeysierra avatar mroderick avatar losbossos avatar pitr avatar porrl avatar lorenzhawkes avatar gargravarr avatar bkecskemeti avatar szuecs avatar alexeyklyukin avatar mtesseract avatar cvirus avatar tuxlife avatar imduffy15 avatar gamsd avatar dakar91 avatar danielrohe avatar anton-ryzhov avatar andgem avatar avb1989 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.