zabbix.py
def trigger_info(zapi, trigger):
    """Retrieves the description, hostname, prevvalue and trigger_id for a
    given trigger.

    :param zapi: reference to the ZabbixAPI
    :type zapi: ZabbixAPI
    :param trigger: dictionary of retrieved trigger
    :type trigger: dict
    :return: description, hostname, prevvalue, trigger_id
    """
    trigger_id = trigger['triggerid']
    priority = PRIORITY[int(trigger['priority'])]
    item = zapi.item.get(triggerids=trigger_id)[0]
    hostid = item['hostid']
    prevvalue = item['prevvalue']
    hostname = zapi.host.get(hostids=hostid)[0]['name']
    description = re.sub('({HOST.HOST}|{HOST.NAME})',
                         hostname,
                         trigger['description'])
    logging.debug('%s: %s, previous value: %s (trigger id: %s)',
                  hostname, description, prevvalue, trigger_id)
    return {'hostname': hostname,
            'description': description,
            'priority': priority,
            'prevvalue': prevvalue,
            'trigger_id': trigger_id}
Retrieves the description, hostname, prevvalue and trigger_id for a
    given trigger.

    :param zapi: reference to the ZabbixAPI
    :type zapi: ZabbixAPI
    :param trigger: dictionary of retrieved trigger
    :type trigger: dict
    :return: description, hostname, prevvalue, trigger_id
    
Retrieves the description, hostname, prevvalue and trigger_id for a
given trigger.
Retrieves the description hostname prevvalue and trigger_id for a given trigger .
def trigger_info(zapi, trigger):
    trigger_id = trigger['triggerid']
    priority = PRIORITY[int(trigger['priority'])]
    item = zapi.item.get(triggerids=trigger_id)[0]
    hostid = item['hostid']
    prevvalue = item['prevvalue']
    hostname = zapi.host.get(hostids=hostid)[0]['name']
    description = re.sub('({HOST.HOST}|{HOST.NAME})',
                         hostname,
                         trigger['description'])
    logging.debug('%s: %s, previous value: %s (trigger id: %s)',
                  hostname, description, prevvalue, trigger_id)
    return {'hostname': hostname,
            'description': description,
            'priority': priority,
            'prevvalue': prevvalue,
            'trigger_id': trigger_id}
def trigger_info ( zapi , trigger ) : trigger_id = trigger [ 'triggerid' ] priority = PRIORITY [ int ( trigger [ 'priority' ] ) ] item = zapi . item . get ( triggerids = trigger_id ) [ 0 ] hostid = item [ 'hostid' ] prevvalue = item [ 'prevvalue' ] hostname = zapi . host . get ( hostids = hostid ) [ 0 ] [ 'name' ] description = re . sub ( '({HOST.HOST}|{HOST.NAME})' , hostname , trigger [ 'description' ] ) logging . debug ( '%s: %s, previous value: %s (trigger id: %s)' , hostname , description , prevvalue , trigger_id ) return { 'hostname' : hostname , 'description' : description , 'priority' : priority , 'prevvalue' : prevvalue , 'trigger_id' : trigger_id }
Retrieves the description, hostname, prevvalue and trigger_id for a
given trigger.
Retrieves the description hostname prevvalue and trigger_id for a given trigger .
"""Retrieves the description, hostname, prevvalue and trigger_id for a
    given trigger.

    :param zapi: reference to the ZabbixAPI
    :type zapi: ZabbixAPI
    :param trigger: dictionary of retrieved trigger
    :type trigger: dict
    :return: description, hostname, prevvalue, trigger_id
    """
description, hostname, prevvalue, trigger_id
description hostname prevvalue trigger_id
zapi
reference to the ZabbixAPI
reference to the ZabbixAPI
trigger
dictionary of retrieved trigger
dictionary of retrieved trigger