(ip)
return
获取主机trigger
获取主机trigger
获取主机trigger
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
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