Ejemplo n.º 1
0
 def login(self):
     '''
     进行认证
     返回 api 接口
     '''
     zapi = ZabbixServerProxy(url)
     zapi.user.login(user=usr, password=pwd)
     print('success', zapi)
     return zapi
Ejemplo n.º 2
0
 def __init__(self):
     self.zb = ZabbixServerProxy("http://192.168.203.91")
     self.zb.user.login(user="******", password="******")
Ejemplo n.º 3
0
 def __init__(self, data):
     self.zb = ZabbixServerProxy(data['zabbix_url'])
     self.zb.user.login(user=data['zabbix_user'],
                        password=data['zabbix_password'])
Ejemplo n.º 4
0
 def __init__(self):
     self.s = ZabbixServerProxy(settings.ZABBIX_URL)
     self.s.user.login(user=settings.ZABBIX_USER,
                       password=settings.ZABBIX_PASS)
Ejemplo n.º 5
0
 def _login(self):
     self.zb = ZabbixServerProxy(self.url)
     self.zb.user.login(user=self.username, password=self.password)
Ejemplo n.º 6
0
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()
Ejemplo n.º 7
0
 def __init__(self):
     self.zb = ZabbixServerProxy("http://192.168.10.143/zabbix")
     self.zb.user.login(user="******", password="******")  #auth
Ejemplo n.º 8
0
 def __init__(self):
     self.zb = ZabbixServerProxy(zabbix_url)
     self.zb.user.login(user=zabbix_user, password=zabbix_pass)
Ejemplo n.º 9
0
 def __init__(self):
     self.zb = ZabbixServerProxy(ZABBIX_URL)
     self.zb.user.login(user=ZABBIX_USER, password=ZABBIX_PASS)
Ejemplo n.º 10
0
 def __init__(self):
     self.zb = ZabbixServerProxy(settings.ZABBIX_API)
     self.zb.user.login(user=settings.ZABBIX_USER, password=settings.ZABBIX_USERPASS)