[ ] in role zabbix_server de rol backup aanmaken (zie zabbix) en de gebruiker backup
[ ] script van hieronder uitrollen in zabbix_server role
#!/usr/bin/env python3
from pyzabbix import ZabbixAPI
from pprint import pprint
from sys import exit
zapi = ZabbixAPI(server="https://zabbix.sram.surf.nl/")
zapi.login(user="backup", password="s3cr1t")
# first fetch list of all templates
result = zapi.do_request('template.get', { "output": ["templateid","name" ] } )
# then dump the templates to stdout
template_ids = [t['templateid'] for t in result['result']]
result= zapi.do_request('configuration.export', {
"options": {"templates": template_ids},
"format": "yaml"
})
print(result["result"])
exit(0)
zabbix_server
de rol backup aanmaken (zie zabbix) en de gebruiker backupzabbix_server
role