Skip to main content

SNMP collector through an asyncio loop

Project description

Setup using docker

Up and build docker container:

docker-compose up --build -d

Without docker:

Install requirements:

pip install -r requirements.txt

Run by downloading or cloning the repository:

python __main__.py

Config your desire OID(s) and metrics:

nano config/cofig.json

Setup through pip

pip install simple-snmp-collector pyserial easydict pysnmp==4.4.9 async-timeout uvloop

Configuration

Create a json config file with the following format:

[
  {
    "isEnable": true,
    "name": "snmp-model-1",
    "address": "192.168.1.120",
    "port": 161,
    "timeout": 1,
    "retries": 3,
    "version": 2,
    "sleep_time": 5,
    "community": "public",
    "metrics": [
      {
        "isEnable": true,
        "tag_name": "a-sample",
        "oid": "1.3.6.13.4.1.3.1112"
      }
    ],
    "meta_data": [{'key': 'value'}]
  }
]

Run

python -m snmp_collector --config=<path-to-your-config-file.json>

[NOTE]:

  • If you are a Windows user and you don’t want to use docker, comment out the uvloop package form requirements.txt

  • The value of -8555 means a problem is occurred during reading data over SNMP or in connection.

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

simple_snmp_collector-1.0.0.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

simple_snmp_collector-1.0.0-py2.py3-none-any.whl (10.2 kB view hashes)

Uploaded Python 2 Python 3

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