Skip to main content

A Django application to collect monitoring data samples through HTTP or SNMP GET interface.

Project description

Travis (.com) https://img.shields.io/coveralls/github/watcheye/watcheye-collector.svg https://img.shields.io/pypi/v/watcheye-collector.svg https://img.shields.io/pypi/format/watcheye-collector.svg https://img.shields.io/pypi/djversions/watcheye-collector.svg https://img.shields.io/pypi/pyversions/watcheye-collector.svg https://img.shields.io/pypi/status/watcheye-collector.svg https://img.shields.io/github/license/watcheye/watcheye-collector.svg

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/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

watcheye-collector-2.0.0.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

watcheye_collector-2.0.0-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file watcheye-collector-2.0.0.tar.gz.

File metadata

  • Download URL: watcheye-collector-2.0.0.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for watcheye-collector-2.0.0.tar.gz
Algorithm Hash digest
SHA256 2ebe7a105dce429ebe9c9d0589d59682bd6d3efc9f82c6d743f526ed2010c8c0
MD5 9ee1e015140dd6095cbe17c2ad008228
BLAKE2b-256 bacb974af5731a6b0c077d088ede0418c167f9c8296e7e7e96a2a14e7438db26

See more details on using hashes here.

File details

Details for the file watcheye_collector-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: watcheye_collector-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for watcheye_collector-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5a9f2e62b7b3fcd9bd2ec3ee86067099b490e8e475cf988d760fa5a4ce0486b
MD5 29a6b25692cdd6b8ce588d05868db5a6
BLAKE2b-256 a4b6dae78197bab842b4880740b9860426740295cd4f15d9eb0c3511712fe43d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page