Giter VIP home page Giter VIP logo

watcheye-collector's Introduction

Travis (.com)

Collector

Collector is a Django application to collect monitoring data samples through HTTP or SNMP GET interface. Collected data might be then visualized using e.g. Grafana.

Dependencies

Collector uses InfluxDB time series database for storing monitoring data samples and django supported database for storing configuration and Redis broker.

Quick start

Assuming InfluxDB is properly configured (setting up authentication is recommended) and so is Redis broker just a few steps are required.

  1. Install watcheye-collector:

    $ pip install watcheye-collector
  2. Add collector application to INSTALLED_APPS setting.

    INSTALLED_APPS = [
        ...
        'collector',
    ]
  3. Integrate Celery with your django project (see Celery documentation for further reference).

  4. Add InfluxDB connection and Celery configuration in settings.py file:

    INFLUXDB_HOST = 'my_host'
    INFLUXDB_USERNAME = 'user'
    INFLUXDB_PASSWORD = 'secret'
    
    CELERY_BEAT_SCHEDULE = {
        'snmp-scheduler': {
            'task': 'collector.tasks.snmp_scheduler',
            'schedule': crontab(minute='*')
        }
    }
    CELERY_RESULT_BACKEND = 'redis://my_broker_host/0'
    CELERY_BROKER_URL = 'redis://my_broker_host/1'
    
    # to use non-default values configure also:
    INFLUXDB_PORT = 1234
    INFLUXDB_DATABASE = 'my_database'
    INFLUXDB_RETENTION_POLICY = 'my_policy'
    INFLUXDB_DURATION = '30d'
  5. To set InfluxDB instance up run:

    python manage.py setupinfluxdb --username <admin_username>
  6. To create the collector models run:

    python manage.py migrate
  7. Include the collector URLconf in your project urls.py:

    path('collector/', include('collector.urls')),
  8. Start the development server and visit http://127.0.0.1:8000/admin/ to create a collector configuration (the Admin application must also be enabled).

  9. Run Celery worker with:

    celery --beat --app <my_project> worker
  10. POST some samples:

    $ curl -i -X POST \
    -H "Content-Type: application/json" \
    -d '{"host":"test", "timestamp": 1500000000,
    "samples": [{"parameter":"CPU", "value": 10}]}' \
    http://127.0.0.1:8000/collector/

watcheye-collector's People

Contributors

amateja avatar

Stargazers

Jarad Olson avatar  avatar Luiz Sales avatar blacksun avatar Michał Szpadzik avatar

Watchers

James Cloos avatar Michał Szpadzik avatar  avatar  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.