External script for Zabbix made with Python to get a full backup for your network devices group by groupID from zabbix and using macro to retreive SSH credentials stored in zabbix This tool is for Zabbix like Oxidized from LibreNMS
- Python3
- pip
- netmiko
- ping3
- mysql.connector
- coloredlogs
- Zabbix >=6
pip install -r requirements.txtThis PHP inside your Zabbix UI is used to get content file
nano /usr/share/zabbix/get_files.php
cd /usr/share/zabbix/modules/backup-networking/
views/my.address.php
actions/MyAddress.php
Directorio cron (external script)
cd /usr/lib/zabbix/externalscripts/
nano backup.py
Example output Script
- Need Python3 and PIP installed
- download python script and paste in: /usr/lib/zabbix/externalscripts/
- make cron with your interval time (every 24hours)
0 23 * * * python3 /usr/lib/zabbix/externalscripts/backup.py >/dev/null 2>&1 - Install module in zabbix (Admin > General > Modules > Sync modules) a. Put module folder inside /usr/share/zabbix/modules
- Set your variables in the script
- Put your SSH credentials in zabbix > Administration > macro ({$SSH_USER}, {$SSH_PWD}) if you use multiple vendors ({$SSH_HUAWEI_USER}, {$SSH_vendor_PWD}) **Remember your macro pattern is your "key" in config (backup.py) **
- make a cron to execute python3 backup.py
- Have fun 😁
- Add multiple vendors based on description macro
- Notification on error connection (save log)
- Create trigger in zabbix to check fail connection in log
For support telegram me.

