Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This script allows you to scan a set of devices and ensure their node IDs are unique.

This resolves an issue where UAM cannot reach all devices if some of them were cloned after their initial configuration.

For more information on how to execute scripts in different environments, view the “Client Scripts” page.

Contents of Package

This script is composed of two Python files:

  • ApiClient.py: ApiClient can be used to interface with the Edge Node’s API but will do nothing if run directly.

  • DuplicateNodeScript.py: DuplicateNodeScript must be run in the same folder with ApiClient.

The “Examples” folder contains a CSV that can be used as an example of formatting.

Usage

This script will scan all listed devices for duplicate node IDs, log the detected duplicates, and rename all required devices.

python DuplicateNodeScript.py

Or, on a system with both Python 2 and 3 installed:

python3 DuplicateNodeScript.py

When first run, it will create a Node folder. To detect and correct duplicates, place an appropriately formatted CSV file in the Node folder. Execute the command again and the devices will be scanned and modified as required.

The devices whose Node IDs are changed will have the Edge Manager restarted.

CSV Formatting

The top row of the CSV file must include the following headers:

Site Name,Edge Device IP,reachable,eACM username,eACM password,OS username,OS password

Each column's meaning is detailed below

Site Name

The unique name for the site which 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 of the Edge device; this is the IP we will attempt to contact. By default, the IP address will be preceded with “http://” and the port used will be 8080, e.g. “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, e.g. “https://192.168.0.10:8181”. Each Edge Device IP must be unique within the CSV.

reachable

Enter the lower case letter x in this field to signify the script should attempt to connect to and configure the device. If any other value is entered, or it is left blank, this row will be skipped.

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

OS username

The operating system username

OS password

The operating system password

Output

While the script is running, files will be collected from the Import folder and moved into the Process folder. After running the script, the files will be moved into one of these:

  • Complete - The script has successfully run on at least one of the devices in the CSV file. Consult the log for details.

  • Error - Either the script did not recognize the formatting of the CSV file or one of the devices in the CSV file did not recognize the formatting of the JSon file. Check the log for details.

  • Unrecognized - Files that are not CSV or JSon, as well as CSV and JSon files without matching names, will be moved here.

Any files that remain in the Process folder when the program is done indicate an unexpected exception. Check the log for further details and contact support if necessary.

Logs

This script will generate its logs in NodeScript.log. It can be checked for further details if an error appears in the Complete report.

  • No labels