This Python script is designed to rediscover and re-import devices on a BIG-IQ system. It ensures that no conflicting tasks are running before proceeding with device operations. The script supports logging for both console output and file output, making it easy to monitor and troubleshoot.
Copy the Script to the BIG-IQ Server:
Copy the Python script to the /shared/scripts/
directory on your BIG-IQ server. This can be done using scp
or any other file transfer method.
scp reconcile.py your_username@your_bigiq:/shared/scripts/
Install Required Python Packages:
Make sure that the required Python packages (requests, urllib3) are installed on your BIG-IQ system. If not, install them using pip.
pip install -r requirements.txt
To execute the script, you can use the following command:
python /shared/scripts/reconcile.py --username YOUR_USERNAME --password YOUR_PASSWORD --hostname YOUR_BIGIQ_HOSTNAME --debug
Command Line Arguments:
--username (Required): The BIG-IQ username. Defaults to admin if not provided.
--password (Required): The password for the BIG-IQ user.
--hostname (Optional): The hostname or IP address of the BIG-IQ server. Defaults to localhost.
--target (Optional): Specific BIG-IP devices to re-import. Provide multiple hostnames separated by spaces.
--targetfile (Optional): Path to a plain text file containing a list of BIG-IP hostnames to re-import. One hostname per line.
--debug (Optional): Enable debug logging for more detailed output.
python /shared/scripts/reconcile.py --username admin --password my_password --hostname bigiq.example.com --target device1.example.com device2.example.com --debug
Console Logging: All operations and debug information are output to the console in real-time.
File Logging: A detailed log is also maintained at /var/log/reconcile.log on the BIG-IQ server. This log file contains timestamps, log levels, and messages for all script operations, making it easy to review what occurred during the script execution.
Log File Location
The script writes logs to the following file:
/var/log/reconcile.log
This file includes all important operations, errors, and debug information.
If the script encounters an error, it will log the error message and exit. Check the log file at /var/log/reconcile.log for more details on what caused the issue.
Password Handling: Avoid hardcoding passwords in the script or command line. Consider using environment variables or other secure methods to manage passwords.
File Permissions: Ensure that the script and log files are only accessible to authorized users on the BIG-IQ system.
For more details on BIG-IQ and device management, refer to the official BIG-IQ documentation.
This script is provided "as is," without any warranties or guarantees. Use it at your own risk.