Another common use of the API facility is to automate some operations that you can perform from the web frontend, but they may be cumbersome or prone to errors. Things such as adding many users or updating the host IP addresses after merging two different networks fall under this category. The following fragments will assume that you already have a Zabbix API handle just as shown in the previous paragraphs. In other words, from now on, it will be assumed that your code will start with something like the following (remember that the Zabbix URL and user credentials here are just examples! Use your own URL and credentials):
#!/usr/bin/python from pyzabbix import ZabbixAPI user='Admin' pwd='password' url = 'https://127.0.0.1/zabbix/' ...
No credit card required