batchscanner-siklu


Namebatchscanner-siklu JSON
Version 0.1.7 PyPI version JSON
download
home_page
SummaryA script to batch-scan/query/configure multiple Siklu radios
upload_time2023-09-12 11:25:37
maintainer
docs_urlNone
author
requires_python>=3.11
licenseMIT License Copyright (c) 2023 Daniel Ephraty Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords cli batch siklu siklu radios
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            *************
Batchscanner
*************

**Note: Project still under development.**

Batchscanner is a script to batch-scan and/or query and/or configure multiple Siklu radios
via their CLI (SSH) interface.
It operates over a user-defined range of IP addresses and/or networks, executes some action,
and writes the results to csv/txt files.

**Note**: This program is a personal initiative and contribution.
Although it is designed for managing radios by `Siklu Communications <https://www.siklu.com>`_, no use
has been made of any company resources, nor any intellectual proprietary nor
confidential information.

Batchscanner supports the following *actions*:

 - **scan**: For each IP address, identify if the device is a Siklu radio, and if so what kind.
   Information is extracted from the SSH banner (if one exists) and/or from the CLI prompt.
 -  **show**: executes CLI 'show' commands to extract key metrics from each radios (e.g., link up/down).
 - **script**: executes a sequence of commands read from text file.
 - **set_tod**: configure the date and time of the radios based on that of the computer.

Actions can be applied to specific types of radios, according to the following classification:

 - **EH**: Etherhaul radios
 - **BU**: Classic MultiHaul base units (BUs)
 - **TU**: Classic MultiHul terminal units (TUs)
 - **TG**: MultiHaul TG radios. For these radios, there is a further option for batchscanner to action
   over remote CNs (which may not have unique IP addresses).

Installation
=============

As a standalone (executable) script
------------------------------------

This option does not require a Python environment set up.

#. Download one of the following zip files based on your OS:

   - Windows 64bit:
     `download link <https://github.com/DanielEphraty/batchscanner/releases/latest/download/batchscanner-x64-0.1.3.zip>`_

#. Extract the zip file to your local drive

As a Python script
--------------------

.. code-block:: shell

   $ pip install batchscanner-siklu

Note: you might like to copy the files: *config.toml*, *sikssh_config.toml*, and *network.txt*
from the *Lib/site-packages/batchscanner* directory (in your Python environment) to
your working directory - as templates, then edit them as required.

Usage
======

#. Use a standard text editor to edit the default `network file <Network file_>`_ ``network.txt`` to specify
   the range of IP addresses, and log-in credentials to the radio.
   Alternatively, create a new file and refer to it with the -c option (below).
#. If required, use a standard text editor to edit the default program
   `configuration file <Config file_>`_ ``config.toml``.
   Alternatively, create a new file and refer to it with the -p option (below).
#. Run the script:

    .. code-block:: none

        Usage: batchscanner [-h] [-a {scan,show,script,set_tod}] [-n NETWORK_FILENAME] [-c CONFIG_FILENAME]

        options:
          -h, --help            Show this help message and exit
          -a {scan,show,script,set_tod}
                    Action for batchscanner to take (default: show). One of:
                        scan: scan the network and identify which IP address is a Siklu radio;
                        show: extract key metrics from radios (parsed outputs of 'show' commands);
                        script: execute a script: send list of commands read from text file;
                        set_tod: set date and time.
          -n NETWORK_FILENAME   Mandatory filename specifying the Network (range of IP addresses to scan and login credentials.
                    Default: 'network.txt'
          -c CONFIG_FILENAME    Optional configuration file for overriding default program parameters.
                    Default: 'config.toml'



Network file
--------------

The range of IP addresses is specified as a text file, with the following format:

 * Username and password to log into the radios
 * A range of IP addresses, described by any number of the following (which can be mixed and matched):

    - A single IP address
    - A range of IP addresses: start and end addresses, separated by a hyphen
    - A subnet with a forward slash denoting the number of subnet bits.

Example content of network file defining a total of 1 + 200 + 252 IP addresses:

.. code-block:: shell

   username = admin
   password = admin
   192.168.0.1
   10.11.12.1 - 10.11.12.200
   10.10.10.0/24


Config file
--------------

The configuration file (simple `TOML <https://toml.io/en/>`_  format) may be used to override
the default program parameters. For a list of these parameters and their respective
meanings, refer to the *Parameters* section of the documentation for the
`run_batch function <https://batchscanner.readthedocs.io/en/latest/batchscan.html#function-information>`_.

Example content of configuration file:

.. code-block:: shell

    batch_size = 1000                     # Number of IP addresses in single batch (results saved after each batch)
    script_filename = 'script.txt'        # filename containing list of commands to send to radio (applicable only if action='script')
    include_eh = true                     # If true, action EtherHaul radios
    include_bu = true                     # If true, action MultiHaul BU radios
    include_tu = true                     # If true, action MultiHaul TU radios
    include_tg = true                     # If true, action MultiHaul TG radios
    include_tg_remote_cns = false         # If true, action all remote CNs (applicable only to TG DNs)
    multiprocessing_flag = true           # If true, Run concurrently (much faster running time)
    multiprocessing_num_processes = 50    # Number of processes to run concurrently
    output_directory = 'output'           # Results are written to this directory
    save_show_tg_per_radio = false        # If true, save also parsed 'show' output per radio (applicable only to TG)
    save_show_tg_per_radio_raw = false    # If true, save aso the raw (unparsed) 'show' output per radio (applicable only to TG)
    time_shift = 0                        # Number of hours to add to computer time when configuring date/time (applicable only if action='set_tod')


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "batchscanner-siklu",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "cli,batch,siklu,siklu radios",
    "author": "",
    "author_email": "Daniel Ephraty <daniel@ephraty.com>",
    "download_url": "https://files.pythonhosted.org/packages/3f/df/48bbd3427c226e410a30ed7aba8d2b16479e0417bba51f1be79abd0d3ac5/batchscanner-siklu-0.1.7.tar.gz",
    "platform": null,
    "description": "*************\r\nBatchscanner\r\n*************\r\n\r\n**Note: Project still under development.**\r\n\r\nBatchscanner is a script to batch-scan and/or query and/or configure multiple Siklu radios\r\nvia their CLI (SSH) interface.\r\nIt operates over a user-defined range of IP addresses and/or networks, executes some action,\r\nand writes the results to csv/txt files.\r\n\r\n**Note**: This program is a personal initiative and contribution.\r\nAlthough it is designed for managing radios by `Siklu Communications <https://www.siklu.com>`_, no use\r\nhas been made of any company resources, nor any intellectual proprietary nor\r\nconfidential information.\r\n\r\nBatchscanner supports the following *actions*:\r\n\r\n - **scan**: For each IP address, identify if the device is a Siklu radio, and if so what kind.\r\n   Information is extracted from the SSH banner (if one exists) and/or from the CLI prompt.\r\n -  **show**: executes CLI 'show' commands to extract key metrics from each radios (e.g., link up/down).\r\n - **script**: executes a sequence of commands read from text file.\r\n - **set_tod**: configure the date and time of the radios based on that of the computer.\r\n\r\nActions can be applied to specific types of radios, according to the following classification:\r\n\r\n - **EH**: Etherhaul radios\r\n - **BU**: Classic MultiHaul base units (BUs)\r\n - **TU**: Classic MultiHul terminal units (TUs)\r\n - **TG**: MultiHaul TG radios. For these radios, there is a further option for batchscanner to action\r\n   over remote CNs (which may not have unique IP addresses).\r\n\r\nInstallation\r\n=============\r\n\r\nAs a standalone (executable) script\r\n------------------------------------\r\n\r\nThis option does not require a Python environment set up.\r\n\r\n#. Download one of the following zip files based on your OS:\r\n\r\n   - Windows 64bit:\r\n     `download link <https://github.com/DanielEphraty/batchscanner/releases/latest/download/batchscanner-x64-0.1.3.zip>`_\r\n\r\n#. Extract the zip file to your local drive\r\n\r\nAs a Python script\r\n--------------------\r\n\r\n.. code-block:: shell\r\n\r\n   $ pip install batchscanner-siklu\r\n\r\nNote: you might like to copy the files: *config.toml*, *sikssh_config.toml*, and *network.txt*\r\nfrom the *Lib/site-packages/batchscanner* directory (in your Python environment) to\r\nyour working directory - as templates, then edit them as required.\r\n\r\nUsage\r\n======\r\n\r\n#. Use a standard text editor to edit the default `network file <Network file_>`_ ``network.txt`` to specify\r\n   the range of IP addresses, and log-in credentials to the radio.\r\n   Alternatively, create a new file and refer to it with the -c option (below).\r\n#. If required, use a standard text editor to edit the default program\r\n   `configuration file <Config file_>`_ ``config.toml``.\r\n   Alternatively, create a new file and refer to it with the -p option (below).\r\n#. Run the script:\r\n\r\n    .. code-block:: none\r\n\r\n        Usage: batchscanner [-h] [-a {scan,show,script,set_tod}] [-n NETWORK_FILENAME] [-c CONFIG_FILENAME]\r\n\r\n        options:\r\n          -h, --help            Show this help message and exit\r\n          -a {scan,show,script,set_tod}\r\n                    Action for batchscanner to take (default: show). One of:\r\n                        scan: scan the network and identify which IP address is a Siklu radio;\r\n                        show: extract key metrics from radios (parsed outputs of 'show' commands);\r\n                        script: execute a script: send list of commands read from text file;\r\n                        set_tod: set date and time.\r\n          -n NETWORK_FILENAME   Mandatory filename specifying the Network (range of IP addresses to scan and login credentials.\r\n                    Default: 'network.txt'\r\n          -c CONFIG_FILENAME    Optional configuration file for overriding default program parameters.\r\n                    Default: 'config.toml'\r\n\r\n\r\n\r\nNetwork file\r\n--------------\r\n\r\nThe range of IP addresses is specified as a text file, with the following format:\r\n\r\n * Username and password to log into the radios\r\n * A range of IP addresses, described by any number of the following (which can be mixed and matched):\r\n\r\n    - A single IP address\r\n    - A range of IP addresses: start and end addresses, separated by a hyphen\r\n    - A subnet with a forward slash denoting the number of subnet bits.\r\n\r\nExample content of network file defining a total of 1 + 200 + 252 IP addresses:\r\n\r\n.. code-block:: shell\r\n\r\n   username = admin\r\n   password = admin\r\n   192.168.0.1\r\n   10.11.12.1 - 10.11.12.200\r\n   10.10.10.0/24\r\n\r\n\r\nConfig file\r\n--------------\r\n\r\nThe configuration file (simple `TOML <https://toml.io/en/>`_  format) may be used to override\r\nthe default program parameters. For a list of these parameters and their respective\r\nmeanings, refer to the *Parameters* section of the documentation for the\r\n`run_batch function <https://batchscanner.readthedocs.io/en/latest/batchscan.html#function-information>`_.\r\n\r\nExample content of configuration file:\r\n\r\n.. code-block:: shell\r\n\r\n    batch_size = 1000                     # Number of IP addresses in single batch (results saved after each batch)\r\n    script_filename = 'script.txt'        # filename containing list of commands to send to radio (applicable only if action='script')\r\n    include_eh = true                     # If true, action EtherHaul radios\r\n    include_bu = true                     # If true, action MultiHaul BU radios\r\n    include_tu = true                     # If true, action MultiHaul TU radios\r\n    include_tg = true                     # If true, action MultiHaul TG radios\r\n    include_tg_remote_cns = false         # If true, action all remote CNs (applicable only to TG DNs)\r\n    multiprocessing_flag = true           # If true, Run concurrently (much faster running time)\r\n    multiprocessing_num_processes = 50    # Number of processes to run concurrently\r\n    output_directory = 'output'           # Results are written to this directory\r\n    save_show_tg_per_radio = false        # If true, save also parsed 'show' output per radio (applicable only to TG)\r\n    save_show_tg_per_radio_raw = false    # If true, save aso the raw (unparsed) 'show' output per radio (applicable only to TG)\r\n    time_shift = 0                        # Number of hours to add to computer time when configuring date/time (applicable only if action='set_tod')\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Daniel Ephraty  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A script to batch-scan/query/configure multiple Siklu radios",
    "version": "0.1.7",
    "project_urls": {
        "documentation": "https://batchscanner.readthedocs.io/en/latest/",
        "repository": "https://github.com/DanielEphraty/batchscanner"
    },
    "split_keywords": [
        "cli",
        "batch",
        "siklu",
        "siklu radios"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b3a71ec0f8ac69b9b698a04220862922445ec1cba1ebb10ccfa2c3d328adbd8",
                "md5": "144a3c096b13ab351cfa06109c2ceef4",
                "sha256": "3645965d3be7f592ff79a141642b51eb20b31b03cbf4335604f45e89840544e2"
            },
            "downloads": -1,
            "filename": "batchscanner_siklu-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "144a3c096b13ab351cfa06109c2ceef4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 39665,
            "upload_time": "2023-09-12T11:25:35",
            "upload_time_iso_8601": "2023-09-12T11:25:35.251509Z",
            "url": "https://files.pythonhosted.org/packages/8b/3a/71ec0f8ac69b9b698a04220862922445ec1cba1ebb10ccfa2c3d328adbd8/batchscanner_siklu-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3fdf48bbd3427c226e410a30ed7aba8d2b16479e0417bba51f1be79abd0d3ac5",
                "md5": "b3eb7ec32f3c0345afd8a416830481b7",
                "sha256": "ff74faa572d1002e3a7c2659188074b3ee72c96547e7066f9823a4aca58d46e7"
            },
            "downloads": -1,
            "filename": "batchscanner-siklu-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "b3eb7ec32f3c0345afd8a416830481b7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 38362,
            "upload_time": "2023-09-12T11:25:37",
            "upload_time_iso_8601": "2023-09-12T11:25:37.715737Z",
            "url": "https://files.pythonhosted.org/packages/3f/df/48bbd3427c226e410a30ed7aba8d2b16479e0417bba51f1be79abd0d3ac5/batchscanner-siklu-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-12 11:25:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DanielEphraty",
    "github_project": "batchscanner",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "batchscanner-siklu"
}
        
Elapsed time: 0.11179s