Hello, everyone. This script allows to automate comparing hosts from two zabbix servers and creation Excel report.
Complete Excel report made using this script should consist of two worksheets: information about all hosts from the first Zabbix Server and information about all hosts from the second Zabbix Server.
python3 modules: sys os json pyzabbix getpass3 openpyxl platform subprocess time datetime collections progress
How to? To executing the script and get report you should run this and follow promts from python terminal:
Add full 1 Zabbix API path, such as: https://zabbixaddress/api_jsonrpc.php or https://zabbixaddress/zabbix/api_jsonrpc.php
Type Zabbix API username and Zabbix API user password
Then, set 2 Zabbix API path, such as: https://zabbixaddress2/api_jsonrpc.php or https://zabbixaddress2/zabbix/api_jsonrpc.php
Add 2 Zabbix API username and 2 Zabbix API user password
Finally, choose timeframes (from and till datetime in the format: 01/01/2000 00:00) for getting SLA info via hosts ICMP ping history or press 'Enter' to set default values (30 days ago from the moment of script running)
Output data:
Folder: Excel
- Zabbix_compare.xlsx <-- Excel report with two sheets
- new.json <-- JSON file with information from the first Zabbix server
- old.json <-- JSON file with information from the second Zabbix server
Good luck! :)