This repository automates firmware upgrades for APC Network Management Cards (NMCs) over SFTP using Python and Paramiko.
- update_firmware.py
Main script: discovers firmware binaries, reads device list, and uploads AOS and SUMX images with concurrency. - credentials.example.json
Copy tocredentials.jsonand fill with your SFTP credentials. - device_list.csv
One IP address per line under headerIP. - .gitignore
Excludescredentials.jsonand the firmware directory.
Note: The firmware directory (
apc_hw05_aos720_sumx720_bootmon109/) and its contents are not included in this repo.
- Python 3.x
- Paramiko (
pip install paramiko)
-
Copy
credentials.example.jsontocredentials.json:{ "sftp_username": "your_username", "sftp_password": "your_password", "sftp_port": 22 } -
Populate
device_list.csv:IP 192.168.1.100 192.168.1.101 -
Ensure your firmware binaries are in a local folder (e.g.,
.../Bins) matching file patterns*aos*.binand*sumx*.bin.
Run the script with:
python update_firmware.py --fw-dir /path/to/apc_hw05_aos720_sumx720_bootmon109/BinsThe script will:
- Read SFTP credentials and device IPs
- Locate AOS and SUMX binary files
- Upload AOS to each device, wait for reboot, then upload SUMX
- Process 5–10 devices concurrently
- Uses a thread pool with a minimum of 5 and maximum of 10 workers.
- Uses Python’s
loggingmodule to output timestamps, log levels, and device-specific messages to the console.
This project is licensed under the MIT License. See the LICENSE file for details.