Metadata-Version: 2.1
Name: simple-snmp-collector
Version: 1.0.0
Summary: SNMP collector through an asyncio loop
Home-page: https://github.com/agn-7/simple-snmp-collector
Author: agn-7
Author-email: benyaminjmf@gmail.com
License: MIT
Download-URL: https://github.com/agn-7/simple-snmp-collector/archive/1.0.0.zip
Keywords: snmp,snmp-collector,asyncio,python3,python,docker,docker-compose
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.6
Requires-Dist: pyserial
Requires-Dist: easydict
Requires-Dist: pysnmp (==4.4.9)
Requires-Dist: async-timeout


SNMP collector through an Asyncio event loop
============================================

Setup using docker
------------------

Up and build docker container:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

   docker-compose up --build -d

Without docker:
---------------

Install requirements:
^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

   pip install -r requirements.txt

Run by downloading or cloning the repository:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

   python __main__.py

Config your desire OID(s) and metrics:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

   nano config/cofig.json

Setup through ``pip``
-------------------------

.. code-block:: bash

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

Configuration
^^^^^^^^^^^^^

Create a json config file with the following format:

.. code-block::

   [
     {
       "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
^^^

.. code-block:: bash

   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.


