Advertisement
Guest User

Untitled

a guest
Jan 11th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. def tr_get(config,alarm,section,not_work):
  2.     try:
  3.         zabbix_server = config.get(section, 'server')
  4.         username = config.get(section, 'user')
  5.         password = config.get(section, 'pass')
  6.  
  7.         zapi = ZabbixAPI(zabbix_server)
  8.  
  9.         zapi.session.auth = (username, password)
  10.         zapi.session.verify = False
  11.         zapi.timeout = 5.1
  12.  
  13.         zapi.login(username, password)
  14.  
  15.         ...
  16.  
  17.         zapi.session.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement