parameters: (ip)
return_statement: return
docstring: 获取主机trigger
docstring_summary: 获取主机trigger
docstring_tokens: 获取主机trigger
function: def zabbix_get_trigger_count(ip):
      """ 获取主机trigger """
      i = 0
      if zabbix_on:
          host = zapi.host.get(filter=({'host': ip}))
          if not host:
              return False
          hostid = host[0]['hostid']
          host_info = {'hostid': hostid, 'output': 'extend'}
          host_trigger = zapi.trigger.get(filter=host_info)
          for trigger in host_trigger:
              t_value = int(trigger.get('value'))
              if t_value == 1:
                  i += 1
  
          return i
      return
function_tokens: def zabbix_get_trigger_count ( ip ) : i = 0 if zabbix_on : host = zapi . host . get ( filter = ( { 'host' : ip } ) ) if not host : return False hostid = host [ 0 ] [ 'hostid' ] host_info = { 'hostid' : hostid , 'output' : 'extend' } host_trigger = zapi . trigger . get ( filter = host_info ) for trigger in host_trigger : t_value = int ( trigger . get ( 'value' ) ) if t_value == 1 : i += 1 return i return