Skip to main content

Tools to manage devices via Swinburne Cisco SmartRack

Project description

Swinburne SmartRack

Programs and Libraries to manage Cisco devices accessible via SmartRack at Swinburne University.

Installation

You can install the wheel file using:

pip install swinburne_smartrack-x.y.z-none-whl

Testing Installation

The Swinburne SmartRack package comes with four test scripts to evaluate that the installed code works properly

Create smartrack.toml file

The SmartRack package uses a system configuration file to know how to access the SmartRack system and what to do to manage the connected devices. You will need to create a file on your system.

################################################################################
## Definition of SmartRack Servers and how to connect to them
##
## smartrack_servers.ROOM - Shortname "ROOM" for the server
## description            - Text description for server to display on UI
## url                    - URL to access the get_all.php page on the server
################################################################################
[smartrack_servers]

[smartrack_servers.ATC328]
description = "Cisco Devices in ATC328"
url = "https://ictencsvr2.ict.swin.edu.au/agent/get_all.php"

[smartrack_servers.ATC329]
description = "Cisco Devices in ATC329"
url = "https://ictencsvr6.ict.swin.edu.au/agent/get_all.php"

[smartrack_servers.ATC330]
description = "Cisco Devices in ATC330"
url = "https://ictencsvr11.ict.swin.edu.au/agent/get_all.php"

################################################################################
## Properties to manage a SmartRack device
##
## manage.DEVICE - Device type (router, switch, asa)
## collect       - List of commands to capture output for when collecting student work for this device
## erase         - List of commands to send to device to clean all stored configuration
## restart       - List of commands to send to device to reload the device
################################################################################
[manage]

# Commands to collect/erase-config/restart a router
[manage.router]
collect = [ "sh run", "sh ip int brief", "sh ip route" , "sh access-lists", "sh ip dhcp binding", "sh ip dhcp pool", "sh ip ospf neighbour", "sh ip ospf" ]
erase = [ "erase startup-config" ]
restart = [ "reload", "no" ]

# Commands to collect/erase-config/restart a switch
[manage.switch]
collect = [ "sh run", "sh ip int brief", "sh vlan brief", "sh int trunk", "sh vlan brief", "sh port-security", "sh spanning-tree" ]
erase = [ "erase startup-config", "delete vlan.dat" ]
restart = [ "reload", "no" ]

# Commands to collect/erase-config/restart an ASA firewall
[manage.asa]
collect = [ "sh run", "sh ip int brief" ]
erase = [ "write erase" ]
restart = [ "reload", "no" ]

Accessing Tests

Execute:

python -m swinburne_smartrack -h

Compiling library

python -m build

Programs

Not developed yet....

Developers

If you wish to develop your own applications using the swinburne_smartrack package, you will find that all the library files and classes are fully documented and can be accessed via the Python help() function.

The classes that can be imported via import swinburne_smartrack are:

  1. Configuration - Singleton class to read SmartRack configuration toml file and make parameters available.
  2. SmartRack - Class to download booked device connection information from SmartRack and to filter devices for selection.
  3. SmartRackTUI - Text-based User Interface to query User for SmartRack information, and then return a SmartRack device with booked devices.
  4. CiscoDevice - Class to manage connection and control of a remotely connected (via ssh) Cisco Device.
  5. DeviceManager - Implements a multiprocessing sub-process to manage a Cisco Device to perform a set of registered tasks.
  6. MultiDeviceManager - Manage multiple DeviceManager classes running in parallel along with a console display to update progress.

Testing

python -m swinburne_smartrack.smartrack

The application will:

  1. Open a dialog asking you to select the SmartRack servers (need VPN if doing from home)
  2. Open a dialog asking you to enter username and password for SmartRack
  3. Download all currently booked devices
  4. Display login details for all devices in a table

The above command line has one optional parameter where you can set the logging level to display more detailed information while the program is running

python -m swinburne_smartrack.smartrack -h
usage: smartrack.py [-h] [-d {DEBUG,INFO,WARNING,ERROR,CRITICAL}]

SmartRack Test Suite

options:
  -h, --help            show this help message and exit
  -d {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --debug {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set logging level (default: INFO)

Usage

To be developed...

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

swinburne_smartrack-0.0.9.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

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

swinburne_smartrack-0.0.9-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file swinburne_smartrack-0.0.9.tar.gz.

File metadata

  • Download URL: swinburne_smartrack-0.0.9.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for swinburne_smartrack-0.0.9.tar.gz
Algorithm Hash digest
SHA256 b1e4ab4d622f27dead81d4e80c71273dce6b4ba7112adf1ed4cfbe9d9ac0c780
MD5 a9171721429ffdc7e5024936b284e13a
BLAKE2b-256 a6579fd7f6c59bc34555ed0d41a83d535b227d56506173a030c1f5bc6749d893

See more details on using hashes here.

Provenance

The following attestation bundles were made for swinburne_smartrack-0.0.9.tar.gz:

Publisher: python-publish.yml on jason-but/swinburne_smartrack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file swinburne_smartrack-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for swinburne_smartrack-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 333283d0ca98fde964c71f415f0d1b33d773fbf46966e04c43a173349660e23d
MD5 a3aad3d196b1dd65d2b458b6817fa7e8
BLAKE2b-256 f183b53daed1e07222746a18bc20d19e4c2402542544ded88015289b15810124

See more details on using hashes here.

Provenance

The following attestation bundles were made for swinburne_smartrack-0.0.9-py3-none-any.whl:

Publisher: python-publish.yml on jason-but/swinburne_smartrack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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