Zabbix is so popular now that personal feelings have a lot to do with Zabbix's powerful APIs, and using APIs can help us accomplish many things:
1, get related groups, host information.
2, for example, someone like to get the historical data back out of the picture.
3, add delete host, bind delete template.
4. Add Delete maintenance cycle
Here I use the pipy provided by the Zabbix_client module, so that we do not have to write the login function, as long as the module began to specify the username password can be:
1, installation zabbix_client:
Pip Install Zabbxi_client
2, the API management script, replaces the user name password to be able to:
1 2 3 4 5 6 7 8 9 10 11 12 13 14-15 16 |
#coding: Utf-8 import time from zabbix_client import Zabbixserverproxy class Zabbix (): Def __init__ (self): Self. ZB = Zabbixserverproxy ("Http://192.168.10.100/zabbix") |