Package: hp-procurvearuba
hp_procurvearubaFor easy management of hp procurve and aruba switchesExplore the docs »Report Bug·Request FeatureTable of ContentsAbout The ProjectInstallationPrerequisitesGetting StartedUsageContributingLicenseContactAcknowledgmentsAbout hp_procurvearubaThe hp_procurvearuba project was created with the aim of simplifying the management of
HP procurve and aruba switches. The project provides a wrapper around the netmiko HPProcurveSSH
class consisting of a composite class called HP with custom functions to manage HP procurve and aruba switches.The project consists of functions that will find and display only the information requested such as the
find_switch_serial_number function which displays the serial number of the switch;-------------------------HOSTNAMESERIAL_NUMBER
-------------------------HP_1SG59FLX6CK
-------------------------There are many other practical functions in the hp_procurvearuba library such as functions for backing up configuration files, uploading configuration files and loading firmware with tftp and sftp.To view the full list of functions and docstrings inclued in the library see the procurvearuba modulehere(back to top)InstallationThe hp_procurvearuba package can be installed with pip as follows;pipinstallhp_procurvearubaPrerequisitesExternal dependencies for the package will be installed with pip. To see the full list of dependencies see requirements.txthereThe hp_procurvearuba project uses textfsm from the ntc-templates library for many functions. Set the environment variable NET_TEXTFSM to point to the index file in ntc-templates as below;exportNET_TEXTFSM=/path/to/ntc-templates/ntc_templates/templatesGetting StartedCreate a dictionary with your device details. Here is a list of devices displayed in yaml format;devices:
-device_type:hp_procurveip:192.168.1.1hostname:HP_1password:passwordusername:username
-device_type:hp_procurveip:192.168.1.2hostname:HP_2password:passwordusername:usernameImport the HP class with the following line;fromhp_procurvearubaimportHPCreate an instance of the HP class;withopen('devices.yml','r')asf:device_data=yaml.safe_load(f)device_data=device_data.pop('devices')device_data=device_datafordeviceindevice_data:hp_obj=HP(**device)Invoke the function you require;hp_obj.sftp_backup_config('192.168.1.3')(back to top)UsageFor an example of a useable script and a devices inventory file please refer to the example_script.py and devices.yaml files inexamplesIncluded in the package is a set of unit tests. Pytest can be run against any of the functions. The full list of test functions can be found in the test_funcs.py filehere(back to top)ContributingContributions to the project are welcome. Any contributions you make aregreatly appreciated. Please fork the repository and create a pull request. Run the tox program inside the root folder hp_procurvearuba when testing your changes. If you are adding a new function to the project, please add an accompanying unit test to the test_funcs.py filehere(back to top)LicenseDistributed under the MIT License. SeeLICENSE.txtfor more information.(back to top)ContactAdeel Rauf -adraf2000@gmail.comProject Link:https://github.com/adraf82/hp_procurvearuba(back to top)AcknowledgmentsCredit goes to the creators and maintainers of the following projects;netmikontc-templates(back to top)