This script allows you to collect the complete zipped logs from multiple Edge ACM systems.
Contents of Package
This scripts is composed of 2 python files:
ApiClient.py
LogRetrievalScript.py
ApiClient.py can be used to interface with the Edge Node’s API but will do nothing if run directly.
LogRetrievalScript.py must be run in the same folder with ApiClient.
Usage
This script will collect zipped log files from every listed device. The script can be run from the command line as follows after navigating to its folder:
python LogRetrivalScript.py
Or, if on a system with both python 2 and 3 installed:
python3 LogRetrivalScript.py
It will create a subfolder “LogRetrieval” when first run. If a csv list of devices is placed in that folder, the next time the script is run it will collect the complete zipped logs from every specified device and place them in the LogRetrieval/Complete folder.
CSV Formatting
The CSV file’s top row must include the following headers:
Site Name,Edge Device IP,eACM username,eACM password
Each column's meaning is detailed below
Site Name | The unique name for the site, this will be assigned to the to level Node of the edge device. Each Site Name must be unique within the CSV. |
Edge Device IP | The IP address or url the edge device; this is the IP we will attempt to contact. Unless otherwise specified, it will be assumped an IP or url is of the format, Eg “192.168.0.10” will be read as “http://192.168.0.10:8080”. If a different port is expected, or the node is configured for https, that must be included, eg “https://192.168.0.10:8181”. Each Edge Device IP must be unique within the CSV. |
eACM username | The web interface username used to connect to the Edge Manager website and API. Default: admin |
eACM password | The web interface password used to connect to the Edge Manager website and API. Default: admin |
Output
Depending on the results of running the script, the files will be moved as follows. The files will end up in one of four subfolders of Imports:
Complete - The script has run succesfully on at least one of the devices in the csv. All of the log files will appear in this folder once collected.
Error - Either the script did not recognize the formatting of the csv or one of the devices in the csv did not recognize the formatting of the json file. Check log for details.
Process - Files should only be here while the script is running; they will be collected from Import, moved to Process, then sent to Error or Complete. Any files that remain here when the program is done indicate an unexpected exception. Check log for further details and contact support if necessary.
Unrecognized - Files that don’t have the .csv extension in the LogRetrieval folder will be moved here
Logs
This script will generate its logs in LogRetrieval.log. It can be consulted after the script is run to see why any expected .zip file is missing.