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