zabbix_bot.py
def _zabbix_all_triggers(zabbix_config):
    """Retrieves the all triggers from zabbix regardless of their
    status.

    :param zabbix_config: zabbix configuration
    :type zabbix_config: dict
    :return: messages to return to matrix
    """
    messages = []
    triggers = zabbix.get_triggers(zabbix_config)
    color_config = {}
    for key, value in matrix.read_config(config['config'], 'Colors').items():
        if key.startswith('zabbix'):
            key = key.replace('zabbix_', '')
            color_config[key] = value

    for trigger in triggers:
        message = ("{prio} {name} {desc}: {value} "
                   "({triggerid})").format(
            prio=trigger['priority'],
            name=trigger['hostname'],
            desc=trigger['description'],
            value=trigger['prevvalue'],
            triggerid=trigger['trigger_id'])
        formatted_message = matrix_alert.colorize(
            color_config, message)
        messages.append(formatted_message)

    return "<br />".join(messages)
Retrieves the all triggers from zabbix regardless of their
    status.

    :param zabbix_config: zabbix configuration
    :type zabbix_config: dict
    :return: messages to return to matrix
    
Retrieves the all triggers from zabbix regardless of their
status.
Retrieves the all triggers from zabbix regardless of their status .
def _zabbix_all_triggers(zabbix_config):
    messages = []
    triggers = zabbix.get_triggers(zabbix_config)
    color_config = {}
    for key, value in matrix.read_config(config['config'], 'Colors').items():
        if key.startswith('zabbix'):
            key = key.replace('zabbix_', '')
            color_config[key] = value
    for trigger in triggers:
        message = ("{prio} {name} {desc}: {value} "
                   "({triggerid})").format(
            prio=trigger['priority'],
            name=trigger['hostname'],
            desc=trigger['description'],
            value=trigger['prevvalue'],
            triggerid=trigger['trigger_id'])
        formatted_message = matrix_alert.colorize(
            color_config, message)
        messages.append(formatted_message)
    return "<br />".join(messages)
def _zabbix_all_triggers ( zabbix_config ) : messages = [ ] triggers = zabbix . get_triggers ( zabbix_config ) color_config = { } for key , value in matrix . read_config ( config [ 'config' ] , 'Colors' ) . items ( ) : if key . startswith ( 'zabbix' ) : key = key . replace ( 'zabbix_' , '' ) color_config [ key ] = value for trigger in triggers : message = ( "{prio} {name} {desc}: {value} " "({triggerid})" ) . format ( prio = trigger [ 'priority' ] , name = trigger [ 'hostname' ] , desc = trigger [ 'description' ] , value = trigger [ 'prevvalue' ] , triggerid = trigger [ 'trigger_id' ] ) formatted_message = matrix_alert . colorize ( color_config , message ) messages . append ( formatted_message ) return "<br />" . join ( messages )
Retrieves the all triggers from zabbix regardless of their
status.
Retrieves the all triggers from zabbix regardless of their status .
"""Retrieves the all triggers from zabbix regardless of their
    status.

    :param zabbix_config: zabbix configuration
    :type zabbix_config: dict
    :return: messages to return to matrix
    """
messages to return to matrix
messages to return to matrix
zabbix_config
None