Skip to main content

A script to batch-scan/query/configure multiple Siklu radios

Project description

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, 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.

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

  2. Extract the zip file to your local drive

As a Python script

$ 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

  1. Use a standard text editor to edit the default 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).

  2. If required, use a standard text editor to edit the default program configuration file config.toml. Alternatively, create a new file and refer to it with the -p option (below).

  3. Run the script:

    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:

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 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.

Example content of configuration file:

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')

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

batchscanner-siklu-0.1.6.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

batchscanner_siklu-0.1.6-py3-none-any.whl (45.2 kB view details)

Uploaded Python 3

File details

Details for the file batchscanner-siklu-0.1.6.tar.gz.

File metadata

  • Download URL: batchscanner-siklu-0.1.6.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for batchscanner-siklu-0.1.6.tar.gz
Algorithm Hash digest
SHA256 37fa9cf918ff0efbdbbe663fcb8811701c1d8320435fd7a0140473857846d8f6
MD5 19edb330af5d21a1812b6ca870a7d293
BLAKE2b-256 6a162aa31734fb773c787035979218550ce6427cf57eb75ca830eeb219f5bb4b

See more details on using hashes here.

File details

Details for the file batchscanner_siklu-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for batchscanner_siklu-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b563aa097504bf11d581a63ed83acd0a86d4a43ad29d3ff43d924019a4e8543f
MD5 9ee98c2a4b0774f2d3ed6c55ffda5c01
BLAKE2b-256 1534a04f6e4b832c3babffebafbb883bce61cd341951403b0be85355ccef790a

See more details on using hashes here.

Supported by

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