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:
Configuration- Singleton class to read SmartRack configuration toml file and make parameters available.SmartRack- Class to download booked device connection information from SmartRack and to filter devices for selection.SmartRackTUI- Text-based User Interface to query User for SmartRack information, and then return a SmartRack device with booked devices.CiscoDevice- Class to manage connection and control of a remotely connected (via ssh) Cisco Device.DeviceManager- Implements a multiprocessing sub-process to manage a Cisco Device to perform a set of registered tasks.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:
- Open a dialog asking you to select the SmartRack servers (need VPN if doing from home)
- Open a dialog asking you to enter username and password for SmartRack
- Download all currently booked devices
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1e4ab4d622f27dead81d4e80c71273dce6b4ba7112adf1ed4cfbe9d9ac0c780
|
|
| MD5 |
a9171721429ffdc7e5024936b284e13a
|
|
| BLAKE2b-256 |
a6579fd7f6c59bc34555ed0d41a83d535b227d56506173a030c1f5bc6749d893
|
Provenance
The following attestation bundles were made for swinburne_smartrack-0.0.9.tar.gz:
Publisher:
python-publish.yml on jason-but/swinburne_smartrack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
swinburne_smartrack-0.0.9.tar.gz -
Subject digest:
b1e4ab4d622f27dead81d4e80c71273dce6b4ba7112adf1ed4cfbe9d9ac0c780 - Sigstore transparency entry: 702343124
- Sigstore integration time:
-
Permalink:
jason-but/swinburne_smartrack@2f37130d0034272e844bc051c433b6646154cd85 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/jason-but
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2f37130d0034272e844bc051c433b6646154cd85 -
Trigger Event:
release
-
Statement type:
File details
Details for the file swinburne_smartrack-0.0.9-py3-none-any.whl.
File metadata
- Download URL: swinburne_smartrack-0.0.9-py3-none-any.whl
- Upload date:
- Size: 47.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
333283d0ca98fde964c71f415f0d1b33d773fbf46966e04c43a173349660e23d
|
|
| MD5 |
a3aad3d196b1dd65d2b458b6817fa7e8
|
|
| BLAKE2b-256 |
f183b53daed1e07222746a18bc20d19e4c2402542544ded88015289b15810124
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
swinburne_smartrack-0.0.9-py3-none-any.whl -
Subject digest:
333283d0ca98fde964c71f415f0d1b33d773fbf46966e04c43a173349660e23d - Sigstore transparency entry: 702343125
- Sigstore integration time:
-
Permalink:
jason-but/swinburne_smartrack@2f37130d0034272e844bc051c433b6646154cd85 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/jason-but
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2f37130d0034272e844bc051c433b6646154cd85 -
Trigger Event:
release
-
Statement type: