def login(self): ''' 进行认证 返回 api 接口 ''' zapi = ZabbixServerProxy(url) zapi.user.login(user=usr, password=pwd) print('success', zapi) return zapi
def __init__(self): self.zb = ZabbixServerProxy("http://192.168.203.91") self.zb.user.login(user="******", password="******")
def __init__(self, data): self.zb = ZabbixServerProxy(data['zabbix_url']) self.zb.user.login(user=data['zabbix_user'], password=data['zabbix_password'])
def __init__(self): self.s = ZabbixServerProxy(settings.ZABBIX_URL) self.s.user.login(user=settings.ZABBIX_USER, password=settings.ZABBIX_PASS)
def _login(self): self.zb = ZabbixServerProxy(self.url) self.zb.user.login(user=self.username, password=self.password)
from zabbix_client import ZabbixServerProxy s = ZabbixServerProxy('http://139.129.10.243/zabbix') s.user.login(user='******', password='******') def info_zabbix(): host = s.host.get(output=['hostid', 'host']) hostinterface = s.hostinterface.get(output=['hostid', 'ip']) for ss in host: v = {} for si in hostinterface: if ss['hostid'] == si['hostid']: v['hostid'] = ss['hostid'] v['host'] = ss['host'] v['ip'] = si['ip'] return v print info_zabbix()
def __init__(self): self.zb = ZabbixServerProxy("http://192.168.10.143/zabbix") self.zb.user.login(user="******", password="******") #auth
def __init__(self): self.zb = ZabbixServerProxy(zabbix_url) self.zb.user.login(user=zabbix_user, password=zabbix_pass)
def __init__(self): self.zb = ZabbixServerProxy(ZABBIX_URL) self.zb.user.login(user=ZABBIX_USER, password=ZABBIX_PASS)
def __init__(self): self.zb = ZabbixServerProxy(settings.ZABBIX_API) self.zb.user.login(user=settings.ZABBIX_USER, password=settings.ZABBIX_USERPASS)