e3FMxn3k
2017-01-12 00:38:02

def tr_get(config,alarm,section,not_work):

try:
zabbix_server = config.get(section, 'server')
username = config.get(section, 'user')
password = config.get(section, 'pass')

zapi = ZabbixAPI(zabbix_server)

zapi.session.auth = (username, password)
zapi.session.verify = False
zapi.timeout = 5.1

zapi.login(username, password)

...

zapi.session.close()