START TRANSACTION;
INSERT INTO users (userid,alias,name,surname,passwd,url,autologin,autologout,lang,refresh,type,theme,rows_per_page) values ('1','Admin','Zabbix','Administrator','$2y$10$92nDno4n0Zm7Ej7Jfsz8WukBfgSS/U0QkIuu8WkJPihXBb2A1UrEK','','1','0','en_GB','30s','3','default','50');
INSERT INTO users (userid,alias,name,surname,passwd,url,autologin,autologout,lang,refresh,type,theme,rows_per_page) values ('2','guest','','','$2y$10$89otZrRNmde97rIyzclecuk6LwKAsHN0BcvoOKGjbT.BwMBfm7G06','','0','15m','en_GB','30s','1','default','50');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('1','Templates','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('2','Linux servers','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('4','Zabbix servers','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('5','Discovered hosts','1','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('6','Virtual machines','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('7','Hypervisors','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('8','Templates/Modules','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('9','Templates/Network devices','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('10','Templates/Operating systems','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('11','Templates/Server hardware','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('12','Templates/Applications','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('13','Templates/Databases','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('14','Templates/Virtualization','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('15','Templates/Telephony','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('16','Templates/SAN','0','0');
INSERT INTO hstgrp (groupid,name,internal,flags) values ('17','Templates/Power','0','0');
INSERT INTO drules (druleid,proxy_hostid,name,iprange,delay,status) values ('2',NULL,'Local network','192.168.0.1-254','1h','1');
INSERT INTO dchecks (dcheckid,druleid,type,key_,snmp_community,ports,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,uniq,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,host_source,name_source) values ('2','2','9','system.uname','','10050','','0','','','0','0','0','','1','0');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('1','0','Email','mail.example.com','example.com','zabbix@example.com','','','','','0','25','0','0','0','0','','1','3','10s','0','','30s','0','0','','','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('3','2','SMS','','','','','/dev/ttyS0','','','0','25','0','0','0','0','','1','3','10s','1','','30s','0','0','','','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('4','0','Email (HTML)','mail.example.com','example.com','zabbix@example.com','','','','','0','25','0','0','0','0','','1','3','10s','1','','30s','0','0','','','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('5','4','Mattermost','','','','','','','','0','25','0','0','0','0','','1','1','10s','1',E'var SEVERITY_COLORS = [
    ''#97AAB3'', ''#7499FF'', ''#FFC859'',
    ''#FFA059'', ''#E97659'', ''#E45959''
];

var RESOLVE_COLOR = ''#009900'';

var SEND_MODE_HANDLERS = {
    alarm: handlerAlarm,
    event: handlerEvent
};

if (!String.prototype.format) {
    String.prototype.format = function() {
        var args = arguments;

        return this.replace(/{(\\d+)}/g, function(match, number) {
            return number in args
                ? args[number]
                : match
            ;
        });
    };
}

function isEventProblem(params) {
    return params.event_value == 1
        && params.event_update_status == 0
    ;
}

function isEventUpdate(params) {
    return params.event_value == 1
        && params.event_update_status == 1
    ;
}

function isEventResolve(params) {
    return params.event_value == 0;
}

function getPermalink(mattermost_url, team_name, postid) {
    return ''{0}/{1}/pl/{2}''.format(
        mattermost_url.replace(/\\/+$/, ''''),
        team_name,
        postid
    );
}

function getChannel(send_to) {
    switch (true) {
        case /.+\\/#.+/.test(send_to):
            return getChannelByName(send_to);

        case /@.+/.test(send_to):
            return getDirectChannel(send_to);

        default:
            return getChannelByID(send_to);
    }
}

function getChannelByName(send_to) {
    var team_chan = send_to
        .trim()
        .split(''/#'');

    var resp = JSON.parse(req.Get(
        Mattermost.channel_byname.format(team_chan[0], team_chan[1]),
        JSON.stringify(fields)
    )
    );

    if (req.Status() != 200) {
        throw ''[{0}] {1}''.format(resp.status_code, resp.message);
    }

    return resp;
}

function getDirectChannel(send_to) {
    Zabbix.Log(5, ''[ Mattermost Webhook ] Call {0}({1})''.format(
        arguments.callee.name,
        JSON.stringify(arguments)
    ));

    var teamUser = send_to
            .trim()
            .split(''/@''),
        bot = getBotUser(),
        user = getUserByName(teamUser[1]);

    var resp = JSON.parse(req.Post(
        Mattermost.direct_channel,
        JSON.stringify([bot.id, user.id])
    )
    );

    Zabbix.Log(5, ''[ Mattermost Webhook ] Result {0}: {1}''.format(
        arguments.callee.name,
        JSON.stringify(resp)
    ));

    if (req.Status() != 201) {
        throw ''[{0}] {1}''.format(resp.status_code, resp.message);
    }

    resp.team_name = teamUser[0];

    return resp;
}

function getChannelByID(channelID) {
    Zabbix.Log(5, ''[ Mattermost Webhook ] Call {0}({1})''.format(
        arguments.callee.name,
        JSON.stringify(arguments)
    ));

    var resp = JSON.parse(req.Get(
        Mattermost.get_channel.format(channelID),
        JSON.stringify(fields)
    )
    );

    Zabbix.Log(5, ''[ Mattermost Webhook ] Result {0}: {1}''.format(
        arguments.callee.name,
        JSON.stringify(resp)
    ));

    if (req.Status() != 200) {
        throw ''[{0}] {1}''.format(resp.status_code, resp.message);
    }

    return resp;
}

function getBotUser() {
    Zabbix.Log(5, ''[ Mattermost Webhook ] Call {0}({1})''.format(
        arguments.callee.name,
        JSON.stringify(arguments)
    ));

    var resp = JSON.parse(req.Get(
        Mattermost.bot_user,
        JSON.stringify(fields)
    )
    );

    Zabbix.Log(5, ''[ Mattermost Webhook ] Result {0}: {1}''.format(
        arguments.callee.name,
        JSON.stringify(resp)
    ));

    if (req.Status() != 200) {
        throw ''[{0}] {1}''.format(resp.status_code, resp.message);
    }

    return resp;
}

function getUserByName(userName) {
    Zabbix.Log(5, ''[ Mattermost Webhook ] Call {0}({1})''.format(
        arguments.callee.name,
        JSON.stringify(arguments)
    ));

    var resp = JSON.parse(req.Get(
        Mattermost.user_byname.format(userName),
        JSON.stringify(fields)
    )
    );

    Zabbix.Log(5, ''[ Mattermost Webhook ] Result {0}: {1}''.format(
        arguments.callee.name,
        JSON.stringify(resp)
    ));

    if (req.Status() != 200) {
        throw ''[{0}] {1}''.format(resp.status_code, resp.message);
    }

    return resp;
}

function getTeamByID(teamID) {
    Zabbix.Log(5, ''[ Mattermost Webhook ] Call {0}({1})''.format(
        arguments.callee.name,
        JSON.stringify(arguments)
    ));

    var resp = JSON.parse(req.Get(
        Mattermost.get_team.format(teamID),
        JSON.stringify(fields)
    )
    );

    Zabbix.Log(5, ''[ Mattermost Webhook ] Result {0}: {1}''.format(
        arguments.callee.name,
        JSON.stringify(resp)
    ));

    if (req.Status() != 200) {
        throw ''[{0}] {1}''.format(resp.status_code, resp.message);
    }

    return resp;
}

function createProblemURL(zabbix_url, triggerid, eventid, event_source) {
    var problem_url = '''';
    if (event_source === ''0'') {
        problem_url = ''{0}/tr_events.php?triggerid={1}&eventid={2}''
            .format(
                zabbix_url,
                triggerid,
                eventid
            );
    }
    else {
        problem_url = zabbix_url;
    }

    return problem_url;
}

function getTagValue(event_tags, key) {
    var pattern = new RegExp(''('' + key + '':.+)'');
    var tagValue = event_tags
        .split('','')
        .filter(function (v) {
            return v.match(pattern);
        })
        .map(function (v) {
            return v.split('':'')[1];
        })[0]
        || 0;

    return tagValue;
}

function handlerAlarm(req, params) {
    var channel = getChannel(params.send_to);
    var fields = {
        channel_id: channel.id,
        props: {}
    };

    if (isEventProblem(params)) {
        var team_name = channel.team_name
            ? channel.team_name
            : getTeamByID(channel.team_id).name;

        fields.props.attachments = [
            createMessage(
                SEVERITY_COLORS[params.event_nseverity] || 0,
                params.event_date,
                params.event_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source)
            )
        ];

        var resp = JSON.parse(req.Post(
            Mattermost.post_message,
            JSON.stringify(fields)
        )
        );

        if (req.Status() != 201) {
            throw ''[{0}] {1}''.format(resp.status_code, resp.message);
        }

        result.tags.__mattermost_post_id = resp.id;
        result.tags.__mattermost_channel_id = channel.id;
        result.tags.__mattermost_channel_name = channel.name;
        result.tags.__mattermost_message_link = getPermalink(
            params.mattermost_url,
            team_name,
            resp.id
        );

    }
    else if (isEventUpdate(params)) {
        fields.root_id = getTagValue(params.event_tags, ''mattermost_post_id'');

        if (params.event_source === ''0'') {}
        fields.props.attachments = [
            createMessage(
                SEVERITY_COLORS[params.event_nseverity] || 0,
                params.event_update_date,
                params.event_update_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source),
                true
            )
        ];

        resp = JSON.parse(req.Post(
            Mattermost.post_message, JSON.stringify(fields)
        )
        );

        if (req.Status() != 201) {
            throw ''[{0}] {1}''.format(resp.status_code, resp.message);
        }

    }
    else if (isEventResolve(params)) {
        fields.channel_id = getTagValue(params.event_tags, ''mattermost_channel_id'');
        fields.id = getTagValue(params.event_tags, ''mattermost_post_id'');
        fields.props.attachments = [
            createMessage(
                RESOLVE_COLOR,
                params.event_date,
                params.event_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source)
            )
        ];

        var post_id = getTagValue(params.event_tags, ''mattermost_post_id'');

        resp = JSON.parse(req.Put(
            Mattermost.chat_update.format(post_id),
            JSON.stringify(fields)
        )
        );

        if (req.Status() != 200) {
            throw ''[{0}] {1}''.format(resp.status_code, resp.message);
        }
    }
}

function handlerEvent(req, params) {
    var channel = getChannel(params.send_to);
    var fields = {
        channel_id: channel.id,
        props: {}
    };

    if (isEventProblem(params)) {
        var team_name = channel.team_name
            ? channel.team_name
            : getTeamByID(channel.team_id).name;

        fields.props.attachments = [
            createMessage(
                SEVERITY_COLORS[params.event_nseverity] || 0,
                params.event_date,
                params.event_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source)
            )
        ];

        var resp = JSON.parse(req.Post(Mattermost.post_message, JSON.stringify(fields)));

        if (req.Status() != 201) {
            throw ''[{0}] {1}''.format(resp.status_code, resp.message);
        }

        result.tags.__mattermost_channel_name = channel.name;
        result.tags.__mattermost_message_link = getPermalink(
            params.mattermost_url,
            team_name,
            resp.id
        );

    }
    else if (isEventUpdate(params)) {
        fields.props.attachments = [
            createMessage(
                SEVERITY_COLORS[params.event_nseverity] || 0,
                params.event_update_date,
                params.event_update_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source),
                false
            )
        ];

        resp = JSON.parse(req.Post(Mattermost.post_message, JSON.stringify(fields)));

        if (req.Status() != 201) {
            throw ''[{0}] {1}''.format(resp.status_code, resp.message);
        }

    }
    else if (isEventResolve(params)) {
        fields.props.attachments = [
            createMessage(
                RESOLVE_COLOR,
                params.event_recovery_date,
                params.event_recovery_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source)
            )
        ];

        resp = JSON.parse(req.Post(Mattermost.post_message, JSON.stringify(fields)));

        if (req.Status() != 201) {
            throw ''[{0}] {1}''.format(resp.status_code, resp.message);
        }
    }
}

function createMessage(
    event_severity_color,
    event_date,
    event_time,
    problem_url,
    isShort
) {
    var message = {
        fallbac: params.alert_subject,
        title: params.alert_subject,
        color: event_severity_color,
        title_link: problem_url,
        footer: problem_url,

        fields: [
            {
                title: ''Host'',
                value: ''{0} [{1}]''.format(params.host_name, params.host_ip),
                short: true
            },
            {
                title: ''Event time'',
                value: ''{0} {1}''.format(event_date, event_time),
                short: true
            }
        ],
    };

    
    if (params.event_source === ''0'') {
        message.fields.push(
            {
                title: ''Severity'',
                value: params.event_severity,
                short: true
            },
            {
                title: ''Opdata'',
                value: params.event_opdata,
                short: true
            }
        );
    }

    if (!isShort && params.event_source === ''0'') {
        message.fields.push(
            {
                title: ''Event tags'',
                value: ''`{0}`''.format(params.event_tags.replace(/__.+?:(.+?,|.+)/g, '''') || ''None''),
                short: true
            },
            {
                title: ''Trigger description'',
                value: params.trigger_description,
                short: true
            }
        );
    }

    if (params.event_source !== ''0'' || params.event_update_status === ''1'') {
        message.fields.push(
            {
                title: ''Details'',
                value: params.alert_message,
                short: false
            }
        );
    }

    return message;
}

function validateParams(params) {
    if (typeof params.bot_token !== ''string'' || params.bot_token.trim() === '''') {
        throw ''Field "bot_token" cannot be empty'';
    }

    if (isNaN(params.event_id)) {
        throw ''Field "event_id" is not a number'';
    }

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: "'' + params.event_source + ''".\\nMust be 0-3.'';
    }

    if (params.event_source !== ''0'') {
        params.event_nseverity = ''0'';
        params.event_severity = ''Not classified'';
        params.event_update_status = ''0'';
        params.send_mode = ''event'';
    }

    if (params.event_source === ''1'' || params.event_source === ''2'') {
        params.event_value = ''1'';
    }

    if (params.event_source === ''1'') {
        params.host_name = params.discovery_host_dns;
        params.host_ip = params.discovery_host_ip;
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        throw ''Incorrect "event_nseverity" parameter given: '' + params.event_nseverity + ''\\nMust be 0-5.'';
    }

    if (typeof params.event_severity !== ''string'' || params.event_severity.trim() === '''') {
        throw ''Field "event_severity" cannot be empty'';
    }

    if (params.event_update_status !== ''0'' && params.event_update_status !== ''1'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    if (params.event_value !== ''0'' && params.event_value !== ''1'') {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    if (typeof params.host_ip !== ''string'' || params.host_ip.trim() === '''') {
        throw ''Field "host_ip" cannot be empty'';
    }

    if (typeof params.host_name !== ''string'' || params.host_name.trim() === '''') {
        throw ''Field "host_name" cannot be empty'';
    }

    if (typeof params.mattermost_url !== ''string'' || params.mattermost_url.trim() === '''') {
        throw ''Field "mattermost_url" cannot be empty'';
    }

    if (!/^(http|https):\\/\\/.+/.test(params.mattermost_url)) {
        throw ''Field "mattermost_url" must contain a schema'';
    }

    if ([''alarm'', ''event''].indexOf(params.send_mode) === -1) {
        throw ''Incorrect "send_mode" parameter given: '' + params.send_mode + ''\\nMust be "alarm" or "event".'';
    }

    if (typeof params.send_to !== ''string'' || params.send_to.trim() === '''') {
        throw ''Field "send_to" cannot be empty'';
    }

    if (isNaN(params.trigger_id) && params.event_source === ''0'') {
        throw ''field "trigger_id" is not a number'';
    }

    if (typeof params.zabbix_url !== ''string'' || params.zabbix_url.trim() === '''') {
        throw ''Field "zabbix_url" cannot be empty'';
    }

    if (!/^(http|https):\\/\\/.+/.test(params.zabbix_url)) {
        throw ''Field "zabbix_url" must contain a schema'';
    }

}

try {
    var params = JSON.parse(value);

    validateParams(params);

    var req = new CurlHttpRequest(),
        fields = {},
        result = {tags: {}};

    if (typeof params.HTTPProxy === ''string'' && params.HTTPProxy.trim() !== '''') {
        req.SetProxy(params.HTTPProxy);
    }

    req.AddHeader(''Content-Type: application/json; charset=utf-8'');
    req.AddHeader(''Authorization: Bearer '' + params.bot_token);

    params.mattermost_url = params.mattermost_url.replace(/\\/+$/, '''');
    params.zabbix_url = params.zabbix_url.replace(/\\/+$/, '''');

    var APIEndpoint = params.mattermost_url + ''/api/v4/'';

    var Mattermost = {
        post_message: APIEndpoint + ''posts'',
        get_channel: APIEndpoint + ''channels/{0}'',
        get_team: APIEndpoint + ''teams/{0}'',
        chat_update: APIEndpoint + ''posts/{0}'',
        direct_channel: APIEndpoint + ''channels/direct'',
        channel_byname: APIEndpoint + ''teams/name/{0}/channels/name/{1}'',
        user_byname: APIEndpoint + ''users/username/{0}'',
        bot_user: APIEndpoint + ''users/me''

    };

    params.send_mode = params.send_mode.toLowerCase();
    params.send_mode = params.send_mode in SEND_MODE_HANDLERS
        ? params.send_mode
        : ''alarm'';

    SEND_MODE_HANDLERS[params.send_mode](req, params);

    if (params.event_source === ''0'') {
        return JSON.stringify(result);
    }
    else {
        return ''OK'';
    }
}
catch (error) {
    Zabbix.Log(4, ''[ Mattermost Webhook ] Mattermost notification failed: '' + error);
    throw ''Mattermost notification failed: '' + error;
}','30s','1','1','{EVENT.TAGS.__mattermost_message_link}','Open in Mattermost: {EVENT.TAGS.__mattermost_channel_name}','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('6','4','Opsgenie','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var Media = {
    params: {},
    name: '''',
    labels: [],
    HTTPProxy: '''',

    setParams: function (params) {
        if (typeof params !== ''object'') {
            return;
        }

        Media.params = params;
        Media.params.api += Media.params.api.endsWith(''/'') ? '''' : ''/'';
        Media.params.web += Media.params.web.endsWith(''/'') ? '''' : ''/'';
    },

    setProxy: function (HTTPProxy) {
        if (typeof HTTPProxy !== ''undefined'' && HTTPProxy.trim() !== '''') {
            Media.HTTPProxy = HTTPProxy;
        }
    },

    setTags: function(event_tags_json) {
        if (typeof event_tags_json !== ''undefined'' && event_tags_json !== ''''
                && event_tags_json !== ''{EVENT.TAGSJSON}'') {

            try {
                var tags = JSON.parse(event_tags_json),
                    label;

                tags.forEach(function (tag) {
                    if (typeof tag.tag === ''string'') {
                        label = (tag.tag + (typeof tag.value !== ''undefined''
                                && tag.value !== '''' ? ('':'' + tag.value) : '''')).replace(/\\s/g, ''_'');
                        Media.labels.push(label);
                    }
                });
            }
            catch (error) {
                Zabbix.Log(4, ''[ '' + Media.name + '' Webhook ] Failed to parse "event_tags_json" param'');
            }
        }
    },

    request: function (method, query, data, allow_404) {
        if (typeof(allow_404) === ''undefined'') {
            allow_404 = false;
        }

        [''api'', ''token''].forEach(function (field) {
            if (typeof Media.params !== ''object'' || typeof Media.params[field] === ''undefined''
                    || Media.params[field] === '''') {
                throw ''Required '' + Media.name + '' param is not set: "'' + field + ''".'';
            }
        });

        var response,
            url = Media.params.api + query,
            request = new CurlHttpRequest();

        request.AddHeader(''Content-Type: application/json'');
        request.AddHeader(''Authorization: '' + Media.params.token);
        request.SetProxy(Media.HTTPProxy);

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        Zabbix.Log(4, ''[ '' + Media.name + '' Webhook ] Sending request: '' +
            url + ((typeof data === ''string'') ? (''\\n'' + data) : ''''));

        switch (method) {
            case ''get'':
                response = request.Get(url, data);
                break;

            case ''post'':
                response = request.Post(url, data);
                break;

            case ''put'':
                response = request.Put(url, data);
                break;

            default:
                throw ''Unsupported HTTP request method: '' + method;
        }

        Zabbix.Log(4, ''[ '' + Media.name + '' Webhook ] Received response with status code '' +
            request.Status() + ''\\n'' + response);

        if (response !== null) {
            try {
                response = JSON.parse(response);
            }
            catch (error) {
                Zabbix.Log(4, ''[ '' + Media.name + '' Webhook ] Failed to parse response.'');
                response = null;
            }
        }

        if ((request.Status() < 200 || request.Status() >= 300)
                && (!allow_404 || request.Status() !== 404)) {
            var message = ''Request failed with status code '' + request.Status();

            if (response !== null) {
                if (typeof response.errors === ''object'' && Object.keys(response.errors).length > 0) {
                    message += '': '' + JSON.stringify(response.errors);
                }
                else if (typeof response.errorMessages === ''object'' && Object.keys(response.errorMessages).length > 0) {
                    message += '': '' + JSON.stringify(response.errorMessages);
                }
                else if (typeof response.message === ''string'') {
                    message += '': '' + response.message;
                }
            }

            throw message + '' Check debug log for more information.'';
        }

        return {
            status: request.Status(),
            response: response
        };
    },

    getAlertId: function (requestId) {
        do {
            resp = Media.request(''get'', ''requests/'' + requestId, undefined, true);
        }
        while (typeof resp.response !== ''object'' || typeof resp.response.data === ''undefined''
                || resp.response.data.success === false);

        if (typeof resp.response !== ''object'' || typeof resp.response.data === ''undefined'') {
            throw ''Cannot get '' + Media.name + '' issue ID. Check debug log for more information.'';
        }

        return resp;
    }
};

try {
    var result = {tags: {}},
        params = JSON.parse(value),
        media = {},
        fields = {},
        resp = {},
        responders = [],
        tags = [],
        required_params = [
            ''alert_subject'',
            ''alert_message'',
            ''event_id'',
            ''event_source'',
            ''event_value'',
            ''event_update_status'',
            ''opsgenie_api'',
            ''opsgenie_web'',
            ''opsgenie_token''
        ],
        severities = [
            ''not_classified'',
            ''information'',
            ''warning'',
            ''average'',
            ''high'',
            ''disaster'',
            ''resolved'',
            ''default''
        ],
        priority;

    Object.keys(params)
        .forEach(function (key) {
            if (required_params.indexOf(key) !== -1 && params[key].trim() === '''') {
                throw ''Parameter "'' + key + ''" cannot be empty.'';
            }
            if (key.startsWith(''opsgenie_'')) {
                media[key.substring(9)] = params[key];
            }
        });

    // Possible values of event_source:
    // 0 - Trigger, 1 - Discovery, 2 - Autoregistration, 3 - Internal.
    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: "'' + params.event_source + ''".\\nMust be 0-3.'';
    }

    // Check event_value for trigger-based and internal events.
    // Possible values: 1 for problem, 0 for recovering
    if (params.event_value !== ''0'' && params.event_value !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check event_update_status only for trigger-based events.
    // Possible values: 0 - Webhook was called because of problem/recovery event, 1 - Update operation.
    if (params.event_source === ''0'' && params.event_update_status !== ''0'' && params.event_update_status !== ''1'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    // Check event_id for a numeric value.
    if (isNaN(parseInt(params.event_id)) || params.event_id < 1) {
        throw ''Incorrect "event_id" parameter given: '' + params.event_id + ''\\nMust be a positive number.'';
    }

    if ((params.event_source === ''1'' || params.event_source === ''2'')  && params.event_value === ''0'') {
        throw ''Recovery operations are supported only for Trigger and Internal actions.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''7'';
    }

    if (params.event_value === ''0'') {
        params.event_nseverity = ''6'';
    }

    priority = params[''severity_'' + severities[params.event_nseverity]];
    params.zbxurl = params.zbxurl + (params.zbxurl.endsWith(''/'') ? '''' : ''/'');

    Media.name = ''Opsgenie'';
    Media.setParams(media);
    Media.params.token = ''GenieKey '' + Media.params.token;
    Media.setProxy(params.HTTPProxy);
    Media.setTags(params.event_tags_json); // Set Media.labels

    // Create an issue.
    // Numeric value of the event that triggered an action (1 for problem, 0 for recovering).
    // Numeric value of of the problem update status. Possible values:
    // 0 - Webhook was called because of problem/recovery event, 1 - Update operation.
    if ((params.event_source == 0 && params.event_value == 1 && params.event_update_status == 0)
            || (params.event_source == 3 && params.event_value == 1)
            || params.event_source == 1 || params.event_source == 2) {
        fields.message = params.alert_subject;
        fields.alias = params.event_id;
        fields.description = params.alert_message;
        fields.priority = priority;
        fields.source = ''Zabbix'';

        if (params.event_source === ''0'') {
            fields.details = {
                ''Zabbix server'': params.zbxurl,
                Problem: params.zbxurl + ''tr_events.php?triggerid='' + params.trigger_id + ''&eventid='' + params.event_id
            };
        }
        else {
            fields.details = {''Zabbix server'': params.zbxurl};
        }

        if (typeof params.opsgenie_teams === ''string'') {
            responders = params.opsgenie_teams.split('','');
            fields.responders = responders.map(function(team) {
                return {type: ''team'', name: team.trim()};
            });
        }

        fields.tags = Media.labels;
        if (typeof params.opsgenie_tags === ''string'') {
            tags = params.opsgenie_tags.split('','');
            tags.forEach(function(item) {
                fields.tags.push(item.trim());
            });
        }

        resp = Media.request(''post'', '''', fields);
        if (typeof resp.response !== ''object'' || typeof resp.response.result === ''undefined'') {
            throw ''Cannot create '' + Media.name + '' issue. Check debug log for more information.'';
        }

        if (resp.status === 202) {
            resp = Media.getAlertId(resp.response.requestId);
            if (params.event_source == 0 && params.event_value == 1 && params.event_update_status == 0) {
                result.tags.__zbx_ops_issuekey = resp.response.data.alertId;
                result.tags.__zbx_ops_issuelink = Media.params.web + ''alert/detail/'' + resp.response.data.alertId;
            }
        }
        else {
            throw Media.name + '' response code is unexpected. Check debug log for more information.'';
        }
    }
    // Update a created issue.
    else {
        fields.user = (params.event_value != 0) ? params.zbxuser : '''';
        fields.note = params.alert_message;

        resp = Media.request(''post'', params.event_id + ''/notes?identifierType=alias'', fields);
        if (typeof resp.response !== ''object'' || typeof resp.response.result === ''undefined'') {
            throw ''Cannot update '' + Media.name + '' issue. Check debug log for more information.'';
        }

        if (resp.status === 202) {
            resp = Media.getAlertId(resp.response.requestId);
        }
        else {
            throw Media.name + '' response code is unexpected. Check debug log for more information.'';
        }
    }

    return JSON.stringify(result);
}
catch (error) {
    Zabbix.Log(3, ''[ '' + Media.name + '' Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','1','1','{EVENT.TAGS.__zbx_ops_issuelink}','Opsgenie: {EVENT.TAGS.__zbx_ops_issuekey}','Please refer to https://docs.opsgenie.com/docs/alert-api and https://www.zabbix.com/documentation/5.0/manual/config/notifications/media/webhook#example_scripts.
  
Set global macro {$ZABBIX.URL} with your Zabbix server URL.
Add dedicated user with media type "Opsgenie".
Change the values of the variables opsgenie_api (https://api.opsgenie.com/v2/alerts or https://api.eu.opsgenie.com/v2/alerts),
opsgenie_web (for example, https://myzabbix.app.opsgenie.com), opsgenie_token.');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('7','4','PagerDuty','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'try {

    var params = JSON.parse(value),
        req = new CurlHttpRequest(),
        fields = {},
        resp = '''';

    // Correspondence between the PagerDuty and Zabbix severity level
    var severityMapping = [
        ''info'',    // Not classified
        ''info'',    // Information
        ''warning'', // Warning
        ''warning'', // Average
        ''error'',   // High
        ''critical'' // Disaster
    ];

    if (!severityMapping[params.severity]) {
        params.severity = ''0'';
    }

    if (typeof params.HTTPProxy === ''string'' && params.HTTPProxy.trim() !== '''') {
        req.SetProxy(params.HTTPProxy);
    }

    if (isNaN(parseInt(params.eventid)) || params.eventid < 1) {
        throw ''incorrect value for variable "eventid". The value must be a positive number.'';
    }
    if (params.eventname.length < 1) {
        throw ''incorrect value for variable "eventname". The value must be a non-empty string.'';
    }
    if (isNaN(parseInt(params.severity)) || (params.severity < 0 && params.severity > 5)) {
        throw ''incorrect value for variable "severity". The value must be a number 0..5.'';
    }

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: "'' + params.event_source + ''".\\nMust be 0-3.'';
    }
    // Check {EVENT.VALUE} for trigger-based and internal events.
    if (params.eventvalue !== ''0'' && params.eventvalue !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "eventvalue" parameter given: "'' + params.eventvalue + ''".\\nMust be 0 or 1.'';
    }

    if (params.event_source === ''0'') {
        if (params.hostname.length < 1) {
            throw ''incorrect value for variable "hostname". The value must be a non-empty string.'';
        }
        if (isNaN(parseInt(params.triggerid)) || params.triggerid < 1) {
            throw ''incorrect value for variable "triggerid". The value must be a positive number.'';
        }
        if (params.eventack != ''Yes'' && params.eventack != ''No'') {
            throw ''incorrect value for variable "eventack". The value must be Yes or No.'';
        }
        if (isNaN(parseInt(params.eventupdate)) || (params.eventupdate < 0 || params.eventupdate > 1)) {
            throw ''incorrect value for variable "eventupdate". The value must be 0 or 1.'';
        }
    }



    req.AddHeader(''Content-Type: application/json'');

    fields.routing_key = params.token;
    fields.dedup_key = params.eventid;

    if (((params.eventvalue == 1) && (params.eventupdate == 0)) || params.event_source !== ''0'') {
        fields.event_action = ''trigger'';
        fields.payload = {
            summary: params.eventname,
            source: (params.event_source === ''1'') ? ''Discovery'' : params.hostname + '' : '' + params.hostip,
            severity: severityMapping[params.severity],
        };
        
        if (params.event_source === ''0'') {
            fields.payload.custom_details = {
                ''Event date'': params.eventdate,
                ''Event time'': params.eventtime,
                ''Trigger description'': params.triggerdesc,
                ''Trigger opdata'': params.triggeropdata,
                ''Event tags'': params.eventtags,
                ''Event host'': params.hostname,
                ''Event host ip'': params.hostip
            };
            fields.links = [{
                href: params.url + ''/tr_events.php?triggerid='' + params.triggerid + ''&eventid='' + params.eventid,
                text: ''Event link''
            }];
        }
        else {
            fields.payload.custom_details = {
                ''Alert message'': params.alert_message
            };
        }

        fields.client = ''Zabbix'';
        fields.client_url = params.url;
    }
    else if ((params.eventvalue == 1) && (params.eventupdate == 1) && (params.eventack == ''Yes''))
        fields.event_action = ''acknowledge'';
    else if (params.eventvalue == 0)
        fields.event_action = ''resolve'';
    else
        throw ''incorrect values. Update message without ack will not be sent.'';

    Zabbix.Log(4, ''[PagerDuty Webhook] Sending request:'' + JSON.stringify(fields));
    resp = req.Post(''https://events.pagerduty.com/v2/enqueue'',
        JSON.stringify(fields)
    );
    Zabbix.Log(4, ''[PagerDuty Webhook] Receiving response:'' + resp);

    try {
        resp = JSON.parse(resp);
    }
    catch (error) {
        throw ''incorrect response. PagerDuty returned a non-JSON object.'';
    }

    if (req.Status() != 202) {
        if (typeof resp === ''object'' && typeof resp.errors === ''object'' && typeof resp.errors[0] === ''string'') {
            throw resp.errors[0];
        }
        else {
            throw ''Unknown error.'';
        }
    }

    if (resp.status != ''success'') {
        throw ''Unknown error.'';
    }

    return ''OK'';
}
catch (error) {
    Zabbix.Log(3, ''[PagerDuty Webhook] Notification failed : '' + error);
    throw ''PagerDuty notification failed : '' + error;
}','30s','0','0','','','Please refer to https://v2.developer.pagerduty.com/docs/send-an-event-events-api-v2 and https://www.zabbix.com/documentation/5.0/manual/config/notifications/media/webhook#example_scripts.
  
Set global macro {$ZABBIX.URL} with your Zabbix server URL.
Add a dedicated user with the media type "PagerDuty" and place the integration key in the "token" parameter to integrate into the service.');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('8','4','Pushover','','','','','','','','0','25','0','0','0','0','','0','3','10s','1',E'try {
    var params = JSON.parse(value),
        request = new CurlHttpRequest(),
        data,
        response,
        severities = [
            {name: ''not_classified'', color: ''#97AAB3''},
            {name: ''information'', color: ''#7499FF''},
            {name: ''warning'', color: ''#FFC859''},
            {name: ''average'', color: ''#FFA059''},
            {name: ''high'', color: ''#E97659''},
            {name: ''disaster'', color: ''#E45959''},
            {name: ''resolved'', color: ''#009900''},
            {name: ''default'', color: ''#000000''}
        ],
        priority;

    if (typeof params.HTTPProxy === ''string'' && params.HTTPProxy.trim() !== '''') {
        request.SetProxy(params.HTTPProxy);
    }

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: "'' + params.event_source + ''".\\nMust be 0-3.'';
    }

    if (params.event_value !== ''0'' && params.event_value !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''7'';
    }

    if (params.event_value === ''0'') {
        params.event_nseverity = ''6'';
    }

    priority = params[''priority_'' + severities[params.event_nseverity].name] || params.priority_default;

    if (isNaN(priority) || priority < -2 || priority > 2) {
        throw ''"priority" should be -2..2'';
    }

    if (params.event_source === ''0'' && isNaN(params.triggerid)) {
        throw ''field "triggerid" is not a number'';
    }

    if (isNaN(params.eventid)) {
        throw ''field "eventid" is not a number'';
    }

    if (typeof params.message !== ''string'' || params.message.trim() === '''') {
        throw ''field "message" cannot be empty'';
    }

    data = {
        token: params.token,
        user: params.user,
        title: params.title,
        message: params.message,
        url: (params.event_source === ''0'') 
            ? params.url + ''/tr_events.php?triggerid='' + params.triggerid + ''&eventid='' + params.eventid
            : params.url,
        url_title: params.url_title,
        priority: priority
    };

    if (priority == 2) {
        if (isNaN(params.retry) || params.retry < 30) {
            throw ''field "retry" should be a number with value of at least 30 if "priority" is set to 2'';
        }

        if (isNaN(params.expire) || params.expire > 10800) {
            throw ''field "expire" should be a number with value of at most 10800 if "priority" is set to 2'';
        }

        data.retry = params.retry;
        data.expire = params.expire;
    }

    data = JSON.stringify(data);
    Zabbix.Log(4, ''[ Pushover Webhook ] Sending request: '' + params.endpoint + ''\\n'' + data);

    request.AddHeader(''Content-Type: application/json'');
    response = request.Post(params.endpoint, data);

    Zabbix.Log(4, ''[ Pushover Webhook ] Received response with status code '' + request.Status() + ''\\n'' + response);

    if (response !== null) {
        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, ''[ Pushover Webhook ] Failed to parse response received from Pushover'');
            response = null;
        }
    }

    if (request.Status() != 200 || response === null || typeof response !== ''object'' || response.status !== 1) {
        if (response !== null && typeof response === ''object'' && typeof response.errors === ''object''
                && typeof response.errors[0] === ''string'') {
            throw response.errors[0];
        }
        else {
            throw ''Unknown error. Check debug log for more information.'';
        }
    }

    return ''OK'';
}
catch (error) {
    Zabbix.Log(4, ''[ Pushover Webhook ] Pushover notification failed: '' + error);
    throw ''Pushover notification failed: '' + error;
}','30s','0','0','','','Please refer to setup guide here: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media/pushover

Set token parameter with to your Pushover application key.
When assigning Pushover media to the Zabbix user - add user key into send to field.');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('9','4','Slack','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var SEVERITY_COLORS = [
    ''#97AAB3'', ''#7499FF'', ''#FFC859'',
    ''#FFA059'', ''#E97659'', ''#E45959''
];

var RESOLVE_COLOR = ''#009900'';

var SLACK_MODE_HANDLERS = {
    alarm: handlerAlarm,
    event: handlerEvent
};


if (!String.prototype.format) {
    String.prototype.format = function() {
        var args = arguments;

        return this.replace(/{(\\d+)}/g, function(match, number) {
            return number in args
                ? args[number]
                : match
            ;
        });
    };
}

function isEventProblem(params) {
    return params.event_value == 1
        && params.event_update_status == 0
    ;
}

function isEventUpdate(params) {
    return params.event_value == 1
        && params.event_update_status == 1
    ;
}

function isEventResolve(params) {
    return params.event_value == 0;
}

function getPermalink(channelId, messageTimestamp) {
    var req = new CurlHttpRequest();

    if (typeof params.HTTPProxy === ''string'' && params.HTTPProxy.trim() !== '''') {
        req.SetProxy(params.HTTPProxy);
    }

    req.AddHeader(''Content-Type: application/x-www-form-urlencoded; charset=utf-8'');
    req.AddHeader(''Authorization: Bearer '' + params.bot_token);

    var query = ''{0}?channel={1}&message_ts={2}''.format(
            Slack.getPermalink,
            encodeURIComponent(channelId),
            encodeURIComponent(messageTimestamp)),
        resp = JSON.parse(req.Get(query));

    if (req.Status() != 200 || !resp.ok || resp.ok === ''false'') {
        throw ''message was created, but getting message link was failed with reason "'' + resp.error + ''"'';
    }

    return resp.permalink;
}

function createProblemURL(zabbix_url, triggerid, eventid, event_source) {
    var problem_url = '''';
    if (event_source === ''0'') {
        problem_url = ''{0}/tr_events.php?triggerid={1}&eventid={2}''
            .format(
                zabbix_url,
                triggerid,
                eventid
            );
    }
    else {
        problem_url = zabbix_url;
    }

    return problem_url;
}

function handlerAlarm(params) {
    var fields = {
        channel: params.channel,
        as_user: params.slack_as_user,
    };

    if (isEventProblem(params)) {
        fields.attachments = [
            createMessage(
                SEVERITY_COLORS[params.event_nseverity] || 0,
                params.event_date,
                params.event_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source)
            )
        ];

        var resp = JSON.parse(req.Post(Slack.postMessage, JSON.stringify(fields)));

        if (req.Status() != 200 || !resp.ok || resp.ok === ''false'') {
            throw resp.error;
        }

        result.tags = {
            [''__message_ts_'' + params.channel]: resp.ts,
            [''__channel_id_'' + params.channel]: resp.channel,
            [''__message_link_'' + params.channel]: getPermalink(resp.channel, resp.ts),
        };

    }
    else if (isEventUpdate(params)) {
        try {
            var channel_event_tags = JSON.parse(params.event_tags);
        } catch (error) {
            throw ''Cannot process event tags: '' + error;
        }

        if (Array.isArray(channel_event_tags)) {
            for (i in channel_event_tags) {
                if (channel_event_tags[i].tag.includes(''__message_ts_'' + params.channel)) {
                    fields.thread_ts = channel_event_tags[i].value;
                    break;
                }
            }
        }

        fields.attachments = [
            createMessage(
                SEVERITY_COLORS[params.event_nseverity] || 0,
                params.event_update_date,
                params.event_update_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source),
                true
            )
        ];

        resp = JSON.parse(req.Post(Slack.postMessage, JSON.stringify(fields)));
        if (req.Status() != 200 || !resp.ok || resp.ok === ''false'') {
            throw resp.error;
        }

    }
    else if (isEventResolve(params)) {
        fields.text = '''';

        try {
            var channel_event_tags = JSON.parse(params.event_tags);
        } catch (error) {
            throw ''Cannot process event tags: '' + error;
        }

        if (Array.isArray(channel_event_tags)) {
            for (i in channel_event_tags) {
                if (channel_event_tags[i].tag.includes(''__channel_id_'' + params.channel)) {
                    fields.channel = channel_event_tags[i].value;
                    continue;
                }
                if (channel_event_tags[i].tag.includes(''__message_ts_'' + params.channel)) {
                    fields.ts = channel_event_tags[i].value;
                }
            }
        }

        fields.attachments = [
            createMessage(
                RESOLVE_COLOR,
                params.event_date,
                params.event_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source)
            )
        ];

        resp = JSON.parse(req.Post(Slack.chatUpdate, JSON.stringify(fields)));
        if (req.Status() != 200 || !resp.ok || resp.ok === ''false'') {
            throw resp.error;
        }
    }
}

function handlerEvent(params) {
    var fields = {
        channel: params.channel,
        as_user: params.slack_as_user
    };

    if (isEventProblem(params)) {
        fields.attachments = [
            createMessage(
                SEVERITY_COLORS[params.event_nseverity] || 0,
                params.event_date,
                params.event_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source)
            )
        ];

        var resp = JSON.parse(req.Post(Slack.postMessage, JSON.stringify(fields)));

        if (req.Status() != 200 || !resp.ok || resp.ok === ''false'') {
            throw resp.error;
        }

        result.tags = {
            [''__message_link_'' + params.channel]: getPermalink(resp.channel, resp.ts)
        }

    }
    else if (isEventUpdate(params)) {
        fields.attachments = [
            createMessage(
                SEVERITY_COLORS[params.event_nseverity] || 0,
                params.event_update_date,
                params.event_update_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source),
                false
            )
        ];

        resp = JSON.parse(req.Post(Slack.postMessage, JSON.stringify(fields)));

        if (req.Status() != 200 || !resp.ok || resp.ok === ''false'') {
            throw resp.error;
        }

    }
    else if (isEventResolve(params)) {
        fields.attachments = [
            createMessage(
                RESOLVE_COLOR,
                params.event_recovery_date,
                params.event_recovery_time,
                createProblemURL(params.zabbix_url, params.trigger_id, params.event_id, params.event_source)
            )
        ];

        resp = JSON.parse(req.Post(Slack.postMessage, JSON.stringify(fields)));

        if (req.Status() != 200 || !resp.ok || resp.ok === ''false'') {
            throw resp.error;
        }
    }
}

function createMessage(
    event_severity_color,
    event_date,
    event_time,
    problem_url,
    isShort,
    messageText
) {
    var message = {
        fallback: params.alert_subject,
        title: params.alert_subject,
        color: event_severity_color,
        title_link: problem_url,
        pretext: messageText || '''',

        fields: [
            {
                title: ''Host'',
                value: ''{0} [{1}]''.format(params.host_name, params.host_conn),
                short: true
            },
            {
                title: ''Event time'',
                value: ''{0} {1}''.format(event_date, event_time),
                short: true
            }
        ],
    };

    if (params.event_source === ''0'') {
        message.fields.push(
            {
                title: ''Severity'',
                value: params.event_severity,
                short: true
            },
            {
                title: ''Opdata'',
                value: params.event_opdata,
                short: true
            }
        );
    }

    if (!isShort  && params.event_source === ''0'') {
        message[''actions''] = [
            {
                type: ''button'',
                text: ''Open in Zabbix'',
                url: problem_url
            }
        ];

        message.fields.push(
            {
                title: ''Event tags'',
                value: JSON.parse(params.event_tags).filter(function (e) { return !e.tag.includes(''__'') }).map(function (e) { return e.tag + '': '' + e.value }).join(''\\n'') || ''None'',
                short: true
            },
            {
                title: ''Trigger description'',
                value: params.trigger_description,
                short: true
            }
        );
    }

    if (params.event_source !== ''0'' || params.event_update_status === ''1'') {
        message.fields.push(
            {
                title: ''Details'',
                value: params.alert_message,
                short: false
            }
        );
    }

    return message;
}

function validateParams(params) {
    if (typeof params.bot_token !== ''string'' || params.bot_token.trim() === '''') {
        throw ''Field "bot_token" cannot be empty'';
    }

    if (typeof params.channel !== ''string'' || params.channel.trim() === '''') {
        throw ''Field "channel" cannot be empty'';
    }

    if (isNaN(params.event_id)) {
        throw ''Field "event_id" is not a number'';
    }

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: "'' + params.event_source + ''".\\nMust be 0-3.'';
    }

    if (params.event_source !== ''0'') {
        params.event_nseverity = ''0'';
        params.event_severity = ''Not classified'';
        params.event_update_status = ''0'';
        params.slack_mode = ''event'';
    }

    if (params.event_source === ''1'' || params.event_source === ''2'') {
        params.event_value = ''1'';
    }

    if (params.event_source === ''1'') {
        params.host_name = params.discovery_host_dns;
        params.host_ip = params.discovery_host_ip;
    }

    if (!~[0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity))) {
        throw ''Incorrect "event_nseverity" parameter given: '' + params.event_nseverity + ''\\nMust be 0-5.'';
    }

    if (typeof params.event_severity !== ''string'' || params.event_severity.trim() === '''') {
        throw ''Field "event_severity" cannot be empty'';
    }

    if (params.event_update_status !== ''0'' && params.event_update_status !== ''1'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    if (params.event_value !== ''0'' && params.event_value !== ''1'') {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    if (typeof params.host_conn !== ''string'' || params.host_conn.trim() === '''') {
        throw ''Field "host_conn" cannot be empty'';
    }

    if (typeof params.host_name !== ''string'' || params.host_name.trim() === '''') {
        throw ''Field "host_name" cannot be empty'';
    }

    if (!~[''true'', ''false''].indexOf(params.slack_as_user.toLowerCase())) {
        throw ''Incorrect "slack_as_user" parameter given: '' + params.slack_as_user + ''\\nMust be "true" or "false".'';
    }

    if (!~[''alarm'', ''event''].indexOf(params.slack_mode)) {
        throw ''Incorrect "slack_mode" parameter given: '' + params.slack_mode + ''\\nMust be "alarm" or "event".'';
    }

    if (isNaN(params.trigger_id) && params.event_source === ''0'') {
        throw ''field "trigger_id" is not a number'';
    }

    if (typeof params.zabbix_url !== ''string'' || params.zabbix_url.trim() === '''') {
        throw ''Field "zabbix_url" cannot be empty'';
    }

    if (!/^(http|https):\\/\\/.+/.test(params.zabbix_url)) {
        throw ''Field "zabbix_url" must contain a schema'';
    }
}

try {
    var params = JSON.parse(value);

    validateParams(params);

    var req = new CurlHttpRequest(),
        result = {tags: {}};

    if (typeof params.HTTPProxy === ''string'' && params.HTTPProxy.trim() !== '''') {
        req.SetProxy(params.HTTPProxy);
    }

    req.AddHeader(''Content-Type: application/json; charset=utf-8'');
    req.AddHeader(''Authorization: Bearer '' + params.bot_token);

    var slack_endpoint = ''https://slack.com/api/'';

    var Slack = {
        postMessage: slack_endpoint + ''chat.postMessage'',
        getPermalink: slack_endpoint + ''chat.getPermalink'',
        chatUpdate: slack_endpoint + ''chat.update''
    };

    params.slack_mode = params.slack_mode.toLowerCase();
    params.slack_mode = params.slack_mode in SLACK_MODE_HANDLERS
        ? params.slack_mode
        : ''alarm'';

    SLACK_MODE_HANDLERS[params.slack_mode](params);

    if (params.event_source === ''0'') {
        return JSON.stringify(result);
    }
    else {
        return ''OK'';
    }
}
catch (error) {
    Zabbix.Log(4, ''[ Slack Webhook ] Slack notification failed : '' + error);
    throw ''Slack notification failed : '' + error;
}','30s','1','0','','','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('10','4','Discord','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var SEVERITY_COLORS = [
    ''#97AAB3'', // Not classified.
    ''#7499FF'', // Information.
    ''#FFC859'', // Warning.
    ''#FFA059'', // Average.
    ''#E97659'', // High.
    ''#E45959'', // Disaster.
    ''#009900''  // Resolved.
];

function stringTruncate(str, len) {
    return str.length > len ? str.substring(0, len - 3) + ''...'' : str;
}

try {
    Zabbix.Log(4, ''[ Discord Webhook ] Executed with params: '' + value);

    var params = JSON.parse(value);

    if (!params.discord_endpoint) {
        throw ''Cannot get discord_endpoint'';
    }
    else {
        params.discord_endpoint = params.discord_endpoint.replace(''/api/'', ''/api/v7/'') + ''?wait=True'';
    }

    params.zabbix_url = (params.zabbix_url.endsWith(''/''))
        ? params.zabbix_url.slice(0, -1) : params.zabbix_url;

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: "'' + params.event_source + ''".\\nMust be 0-3.'';
    }

    // Set params to true for non trigger-based events.
    if (params.event_source !== ''0'') {
        params.use_default_message = ''true'';
        params.event_nseverity = ''0'';
    }

    // Check {EVENT.VALUE} for trigger-based and internal events.
    if (params.event_value !== ''0'' && params.event_value !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: "'' + params.event_value + ''".\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    if (params.event_update_status !== ''0'' && params.event_update_status !== ''1'' && params.event_source === ''0'') {
        throw ''Incorrect "event_update_status" parameter given: "'' + params.event_update_status + ''".\\nMust be 0 or 1.'';
    }

    if (params.event_value == 0) {
        params.event_nseverity = ''6'';
    }

    if (!SEVERITY_COLORS[params.event_nseverity]) {
        throw ''Incorrect "event_nseverity" parameter given: '' + params.event_nseverity + ''\\nMust be 0-5.'';
    }

    var color = parseInt(SEVERITY_COLORS[params.event_nseverity].replace(''#'', ''''), 16),
        fields = [],
        body = {
            embeds: [
                {
                    color: color || 0,
                    url: (params.event_source === ''0'')
                        ? params.zabbix_url + ''/tr_events.php?triggerid='' + params.trigger_id +
                            ''&eventid='' + params.event_id
                        : params.zabbix_url
                }
            ]
        };

    // Default message from {ALERT.MESSAGE}.
    if (params.use_default_message.toLowerCase() == ''true'') {
        body.embeds[0].title = stringTruncate(params.alert_subject, 256);
        body.embeds[0].description = stringTruncate(params.alert_message, 2048);
    }
    else {
        fields.push(
            {
                name: ''Host'',
                value: params.host_name + '' ['' + params.host_ip + '']''
            }
        );

        // Resolved message.
        if (params.event_value == 0 && params.event_update_status == 0) {
            body.embeds[0].title = stringTruncate(''OK: '' + params.event_name, 256);
            fields.push(
                {
                    name: ''Recovery time'',
                    value: params.event_recovery_time + '' '' + params.event_recovery_date,
                    inline: ''True''
                }
            );
        }

        // Problem message.
        else if (params.event_value == 1 && params.event_update_status == 0) {
            body.embeds[0].title = stringTruncate(''PROBLEM: '' + params.event_name, 256);
            fields.push(
                {
                    name: ''Event time'',
                    value: params.event_time + '' '' + params.event_date,
                    inline: ''True''
                }
            );
        }

        // Update message.
        else if (params.event_update_status == 1) {
            body.embeds[0].title = stringTruncate(''UPDATE: '' + params.event_name, 256);
            body.embeds[0].description = params.event_update_user + '' '' + params.event_update_action + ''.'';

            if (params.event_update_message) {
                body.embeds[0].description += '' Comment:\\n>>> '' + params.event_update_message;
            }

            body.embeds[0].description = stringTruncate(body.embeds[0].description, 2048);

            fields.push(
                {
                    name: ''Event update time'',
                    value: params.event_update_time + '' '' + params.event_update_date,
                    inline: ''True''
                }
            );
        }

        fields.push(
            {
                name: ''Severity'',
                value: params.event_severity,
                inline: ''True''
            }
        );

        if (params.event_opdata) {
            fields.push(
                {
                    name: ''Operational data'',
                    value: stringTruncate(params.event_opdata, 1024),
                    inline: ''True''
                }
            );
        }

        if (params.event_value == 1 && params.event_update_status == 0 && params.trigger_description) {
            fields.push(
                {
                    name: ''Trigger description'',
                    value: stringTruncate(params.trigger_description, 1024)
                }
            );
        }

        body.embeds[0].footer = {
            text: ''Event ID: '' + params.event_id
        };

        if (params.event_tags) {
            body.embeds[0].footer.text += ''\\nEvent tags: '' + params.event_tags;
        }
        body.embeds[0].footer.text = stringTruncate(body.embeds[0].footer.text, 2048);
    }

    if (fields.length > 0) {
        body.embeds[0].fields = fields;
    }

    var req = new CurlHttpRequest();

    if (typeof params.HTTPProxy === ''string'' && params.HTTPProxy.trim() !== '''') {
        req.SetProxy(params.HTTPProxy);
    }

    req.AddHeader(''Content-Type: application/json'');

    var resp = req.Post(params.discord_endpoint, JSON.stringify(body)),
        data = JSON.parse(resp);

    Zabbix.Log(4, ''[ Discord Webhook ] JSON: '' + JSON.stringify(body));
    Zabbix.Log(4, ''[ Discord Webhook ] Response: '' + resp);

    if (data.id) {
        return resp;
    }
    else {
        var message = ((typeof data.message === ''string'') ? data.message : ''Unknown error'');

        Zabbix.Log(3, ''[ Discord Webhook ] FAILED with response: '' + resp);
        throw message + ''. For more details check zabbix server log.'';
    }
}
catch (error) {
    Zabbix.Log(3, ''[ Discord Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','0','0','','','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('11','4','SIGNL4','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'// SIGNL4 Webhook
try {
    var response,
        payload,
        params = JSON.parse(value),
        endpoint = ''https://connect.signl4.com/webhook/'',
        request = new CurlHttpRequest();

    if (typeof params.HTTPProxy === ''string'' && params.HTTPProxy.trim() !== '''') {
        request.SetProxy(params.HTTPProxy);
    }

    if (typeof params.teamsecret === ''string'' && params.teamsecret.trim() !== '''') {
        endpoint += params.teamsecret;
        delete params.teamsecret;
    }
    else {
        throw ''The team secret of your SIGNL4 team cannot be empty.'';
    }

    if (typeof params.Severity === ''string'' && params.Severity === ''{EVENT.SEVERITY}'') {
        params.Severity = ''Not classified'';
    }

if (typeof params.User === ''string'' && params.User === ''{USER.FULLNAME}'') {
        params.User = '''';
    }

if (typeof params.Event_Update_Action === ''string'' && params.Event_Update_Action === ''{EVENT.UPDATE.ACTION}'') {
        params.Event_Update_Action = '''';
    }

// Assemble X-S4-ExternalID for two-way integration
// Format: "ZabbixEventID: 222 ZabbixURL: https://your-zabbix-server/zabbix/"
params[''X-S4-ExternalID''] = ''ZabbixEventID: '' + params.Event_ID;
if (typeof params.Zabbix_URL === ''string'' && params.Zabbix_URL.indexOf(''http'') == 0) {
// Make sure the URL ends with ''/''
if (params.Zabbix_URL.charAt(params.Zabbix_URL.length - 1) != ''/'') {
params.Zabbix_URL = params.Zabbix_URL + ''/'';
}

params[''X-S4-ExternalID''] = params[''X-S4-ExternalID''] + '' ZabbixURL: '' +  params.Zabbix_URL;

// Add Link parameter
params[''Link''] = params.Zabbix_URL + "tr_events.php?triggerid="+params.Trigger_ID + "&eventid=" + params.Event_ID;
}

// Check if this is a new problem or a recovery
if (params.Trigger_Status == ''OK'') {
params[''X-S4-Status''] = ''resolved'';
}
else {
params[''X-S4-Status''] = ''new'';
}

    payload = JSON.stringify(params);
    Zabbix.Log(4, ''[ SIGNL4 Webhook ] Sending request: '' + payload);

    request.AddHeader(''Content-Type: application/json'');
    response = request.Post(endpoint, ''payload='' + payload);

    Zabbix.Log(4, ''[ SIGNL4 Webhook ] Received response with status code '' +
            request.Status() + ''\\n'' + response
    );

    if (request.Status() !== 201) {
        throw ''Request failed with status code '' + request.Status() +
                ''. Check debug log for more information.'';
    }

    return ''OK'';
}
catch (error) {
    Zabbix.Log(4, ''[ SIGNL4 Webhook ] ERROR: '' + error);

    throw ''Sending failed: '' + error;
}','30s','0','0','','','SIGNL4 is a mobile alert notification app for powerful alerting, alert management and mobile assignment of work items. It offers alerting via app push, SMS and voice calls including escalations, tracking, and duty scheduling.

Get the app at https://www.signl4.com.

Find out more including an integration video here: https://www.signl4.com/blog/portfolio_item/zabbix-mobile-alert-notification-duty-schedule-escalation/
');


INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('14','4','MS Teams','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var SEVERITY_COLORS = [
    ''#97AAB3'', // Not classified.
    ''#7499FF'', // Information.
    ''#FFC859'', // Warning.
    ''#FFA059'', // Average.
    ''#E97659'', // High.
    ''#E45959'', // Disaster.
    ''#009900'', // Resolved.
    ''#000000''  // Default.
];

try {
    var params = JSON.parse(value);

    if (typeof params.teams_endpoint !== ''string'' || params.teams_endpoint.trim() === '''') {
        throw ''Cannot get teams_endpoint'';
    }
    else if (!params.teams_endpoint.startsWith(''http'')) {
        throw ''Invalid MS Teams webhook URL: '' + params.teams_endpoint;
    }

    params.zabbix_url = (params.zabbix_url.endsWith(''/''))
        ? params.zabbix_url.slice(0, -1) : params.zabbix_url;

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: "'' + params.event_source + ''".\\nMust be 0-3.'';
    }

    // Set "use_default_message" to true for non trigger-based events.
    if (params.event_source !== ''0'') {
        params.use_default_message = ''true'';
    }

    // Check {EVENT.VALUE} for trigger-based and internal events.
    if (params.event_value !== ''0'' && params.event_value !== ''1''
            && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: "'' + params.event_value + ''".\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    if (params.event_update_status !== ''0'' && params.event_update_status !== ''1'' && params.event_source === ''0'') {
        throw ''Incorrect "event_update_status" parameter given: "'' + params.event_update_status + ''".\\nMust be 0 or 1.'';
    }

    if (params.event_value == 0) {
        params.event_nseverity = ''6'';
    }

    if (!SEVERITY_COLORS[params.event_nseverity]) {
        params.event_nseverity = ''7'';
    }

    var request = new CurlHttpRequest(),
        facts = [],
        body = {
            themeColor: SEVERITY_COLORS[params.event_nseverity].replace(''#'', ''''),
            summary: ''Zabbix'',
            sections: [
                {
                    markdown: ''false'',
                    activityTitle: params.alert_subject,
                    activitySubtitle: ''On '' + params.host_name + '' ['' + params.host_ip + '']'',
                    text: (params.use_default_message.toLowerCase() == ''true'')
                        ? params.alert_message
                        : params.trigger_description
                }
            ],
            potentialAction: [
                {
                    ''@type'': ''OpenUri'',
                    name: (params.event_source === ''0'')
                        ? ''Event Info''
                        : ''Zabbix Home'',
                    targets: [
                        {
                            os: ''default'',
                            uri: (params.event_source === ''0'')
                                ? params.zabbix_url + ''/tr_events.php?triggerid='' +
                                    params.trigger_id + ''&eventid='' + params.event_id
                                : params.zabbix_url
                        }
                    ]
                }
            ]
        };

    if (params.use_default_message.toLowerCase() !== ''true'') {
        // Problem message.
        if (params.event_value === ''1'' && params.event_update_status === ''0'') {
            facts.push({
                name: ''Event time'',
                value: params.event_time + '' '' + params.event_date
            });
        }
        // Update message.
        else if (params.event_update_status === ''1'') {
            body.sections[0].text = params.event_update_user + '' '' + params.event_update_action + ''.'';

            if (params.event_update_message) {
                body.sections[0].text += ''<br>Message:<br>'' + params.event_update_message;
            }

            facts.push({
                name: ''Event update time'',
                value: params.event_update_time + '' '' + params.event_update_date
            });
        }
        // Resolved message.
        else {
            facts.push({
                name: ''Recovery time'',
                value: params.event_recovery_time + '' '' + params.event_recovery_date
            });
        }

        if (params.event_severity && params.event_severity !== ''{EVENT.SEVERITY}'') {
            facts.push({
                name: ''Severity'',
                value: params.event_severity
            });
        }


        if (params.event_opdata && params.event_opdata !== ''{EVENT.OPDATA}'') {
            facts.push({
                name: ''Operational data'',
                value: params.event_opdata
            });
        }

        if (params.event_tags && params.event_tags !== ''{EVENT.TAGS}'') {
            facts.push({
                name: ''Event tags'',
                value: params.event_tags
            });
        }

        Object.keys(params)
            .forEach(function (key) {
                if (key.startsWith(''fact_'') && params[key] !== '''') {
                    facts.push({
                        name: key.substring(5),
                        value: params[key]
                    });
                }
                else if (key.startsWith(''openUri_'') && params[key] !== '''' && !params[key].startsWith(''{'')) {
                    body.potentialAction.push({
                        ''@type'': ''OpenUri'',
                        name: key.substring(8),
                        targets: [
                            {
                                os: ''default'',
                                uri: params[key]
                            }
                        ]
                    });
                }
            });
        body.sections[0].facts = facts;
    }

    body.sections[0].text = body.sections[0].text.replace(/(?:\\r\\n|\\r|\\n)/g, ''<br>'');

    request.AddHeader(''Content-Type: application/json'');

    if (typeof params.HTTPProxy === ''string'' && params.HTTPProxy !== '''') {
        request.SetProxy(params.HTTPProxy);
    }

    Zabbix.Log(4, ''[ MS Teams Webhook ] JSON: '' + JSON.stringify(body));

    var response = request.Post(params.teams_endpoint, JSON.stringify(body));

    Zabbix.Log(4, ''[ MS Teams Webhook ] Response: '' + response);

    if (response === ''1'') {
        return ''OK'';
    }
    else {
        Zabbix.Log(4, ''[ MS Teams Webhook ] FAILED with response: '' + response);
        throw response;
    }
}
catch (error) {
    Zabbix.Log(3, ''[ MS Teams Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','0','0','','','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('15','4','Redmine','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var Redmine = {
    params: {},

    setParams: function (params) {
        if (typeof params !== ''object'') {
            return;
        }

        Redmine.params = params;
        if (typeof Redmine.params.url === ''string'') {
            if (!Redmine.params.url.endsWith(''/'')) {
                Redmine.params.url += ''/'';
            }
        }
    },

    addCustomFields: function (data, fields) {
        if (typeof fields === ''object'' && Object.keys(fields).length) {
            var schema = Redmine.getSchema();

            if (schema) {
                data.issue.custom_fields = [];

                Object.keys(fields)
                    .forEach(function(field) {
                        for (var idx in schema.custom_fields) {
                            if (schema.custom_fields[idx].id != field) {
                                continue;
                            }

                            var field_value;

                            switch (schema.custom_fields[idx].field_format) {
                                case ''string'':
                                    field_value = fields[field];
                                    break;

                                case ''int'':
                                    field_value = parseInt(fields[field]);
                                    break;

                                case ''float'':
                                    field_value = parseFloat(fields[field]);
                                    break;

                                case ''date'':
                                    if (fields[field].match(/^\\d{4}[.-]\\d{2}[.-]\\d{2}$/)) {
                                        field_value = fields[field].replace(/\\./g, ''-'');
                                    }
                                    break;
                            }

                            if (field_value !== undefined) {
                                data.issue.custom_fields.push({id: field, value: field_value});
                            }
                        }
                    });
            }
            else {
                Zabbix.Log(4, ''[ Redmine Webhook ] Failed to retrieve field schema.'');
            }
        }

        return data;
    },

    request: function (method, query, data) {
        [''url'', ''access_key''].forEach(function (field) {
            if (typeof Redmine.params !== ''object'' || typeof Redmine.params[field] === ''undefined''
                || Redmine.params[field] === '''' ) {
                throw ''Required param is not set: "'' + field + ''".'';
            }
        });

        var response,
            url = Redmine.params.url + query,
            request = new CurlHttpRequest();

        if (typeof Redmine.HTTPProxy === ''string'' && Redmine.HTTPProxy.trim() !== '''') {
            request.SetProxy(Redmine.HTTPProxy);
        }

        request.AddHeader(''Content-Type: application/json'');
        request.AddHeader(''X-Redmine-API-Key: '' + Redmine.params.access_key);

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        Zabbix.Log(4, ''[ Redmine Webhook ] Sending request: '' +
            url + ((typeof data === ''string'') ? ('' '' + data) : ''''));

        switch (method) {
            case ''get'':
                response = request.Get(url, data);
                break;

            case ''post'':
                response = request.Post(url, data);
                break;

            case ''put'':
                response = request.Put(url, data);
                break;

            default:
                throw ''Unsupported HTTP request method: '' + method;
        }

        Zabbix.Log(4, ''[ Redmine Webhook ] Received response with status code '' + request.Status() + '': '' + response);

        if (response !== null) {
            try {
                response = JSON.parse(response);
            }
            catch (error) {
                Zabbix.Log(4, ''[ Redmine Webhook ] Failed to parse response received from Redmine'');
                response = null;
            }
        }

        if (request.Status() < 200 || request.Status() >= 300) {
            var message = ''Request failed with status code '' + request.Status();

            if (response !== null && typeof response.errors !== ''undefined''
                && Object.keys(response.errors).length > 0) {
                message += '': '' + JSON.stringify(response.errors);
            }
            else if (response !== null && typeof response.errorMessages !== ''undefined''
                && Object.keys(response.errorMessages).length > 0) {
                message += '': '' + JSON.stringify(response.errorMessages);
            }

            throw message + '' Check debug log for more information.'';
        }

        return {
            status: request.Status(),
            response: response
        };
    },

    getProjectID: function(name) {
        var result = Redmine.request(''get'', ''projects.json''),
            project_id;

        if (result.response) {
            var projects = result.response.projects || [];

            for (var i in projects) {
                if (projects[i].name === name) {
                    project_id = projects[i].id;
                    break;
                }
            }
        }
        else {
            Zabbix.Log(4, ''[ Redmine Webhook ] Failed to retrieve project data.'');
        }

        if (typeof project_id === ''undefined'') {
            throw ''Cannot find project with name: '' + name;
        }

        return project_id;
    },

    getSchema: function() {
        var result = Redmine.request(''get'', ''custom_fields.json'');

        return result.response;
    },

    createIssue: function(subject, description, priority, fields) {
        var project_id = /^\\d+$/.test(Redmine.params.project)
                ? Redmine.params.project
                : Redmine.getProjectID(Redmine.params.project),
            data = {
                issue: {
                    project_id: project_id,
                    tracker_id: Redmine.params.tracker_id,
                    subject: subject,
                    description: description
                }
            },
            result;

        if (priority) {
            data.issue.priority_id = priority;
        }

        result = Redmine.request(''post'', ''issues.json'', Redmine.addCustomFields(data, fields));

        if (typeof result.response !== ''object''
            || typeof result.response.issue.id === ''undefined''
            || result.status != 201) {
            throw ''Cannot create Redmine issue. Check debug log for more information.'';
        }

        return result.response.issue.id;
    },

    updateIssue: function(note, fields) {
        var data = {
            issue: {
                notes: note || ''''
            }
        };

        Redmine.request(''put'', ''issues/'' + Redmine.params.issue_key + ''.json'', Redmine.addCustomFields(data, fields));
    }
};

try {
    var params = JSON.parse(value),
        params_redmine = {},
        params_fields = {},
        params_update = {},
        result = {tags: {}},
        required_params = [
            ''alert_subject'', ''tracker_id'', ''project'',
            ''event_source'', ''event_value'',  ''event_update_status''
        ],
        severities = [
            {name: ''not_classified'', color: ''#97AAB3''},
            {name: ''information'', color: ''#7499FF''},
            {name: ''warning'', color: ''#FFC859''},
            {name: ''average'', color: ''#FFA059''},
            {name: ''high'', color: ''#E97659''},
            {name: ''disaster'', color: ''#E45959''},
            {name: ''resolved'', color: ''#009900''},
            {name: null, color: ''#000000''}
        ],
        priority;

    Object.keys(params)
        .forEach(function (key) {
            if (key.startsWith(''redmine_'')) {
                params_redmine[key.substring(8)] = params[key];
            }
            else if (key.startsWith(''customfield_'')) {
                params_fields[key.substring(12)] = params[key];
            }
            else if (key.startsWith(''event_update_'')) {
                params_update[key.substring(13)] = params[key];
            }
            else if (required_params.indexOf(key) !== -1 && params[key].trim() === '''') {
                throw ''Parameter "'' + key + ''" cannot be empty.'';
            }
        });

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: '' + params.event_source + ''\\nMust be 0-3.'';
    }

    // Check {EVENT.VALUE} for trigger-based and internal events.
    if (params.event_value !== ''0'' && params.event_value !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    if (params.event_source === ''0'' && params.event_update_status !== ''0'' && params.event_update_status !== ''1'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    if (params.event_source !== ''0'' && params.event_value === ''0'') {
        throw ''Recovery operations are supported only for trigger-based actions.'';
    }

    if (params.event_source === ''0''
        && ((params.event_value === ''1'' && params.event_update_status === ''1'')
            || (params.event_value === ''0''
                && (params.event_update_status === ''0'' || params.event_update_status === ''1'')))
        && (isNaN(parseInt(params.redmine_issue_key)) || parseInt(params.redmine_issue_key) < 1 )) {
        throw ''Incorrect "redmine_issue_key" parameter given: '' + params.redmine_issue_key +
            ''\\nMust be positive integer.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''7'';
    }

    if (params.event_value === ''0'') {
        params.event_nseverity = ''6'';
    }

    priority = params[''severity_'' + severities[params.event_nseverity].name];
    priority = priority && priority.trim() || severities[7].name;

    Redmine.setParams(params_redmine);
    Redmine.HTTPProxy = params.HTTPProxy;

    // Create issue for non trigger-based events.
    if (params.event_source !== ''0''
        && params.event_value !== ''0'') {
        Redmine.createIssue(params.alert_subject, params.alert_message, priority);
    }
    // Create issue for trigger-based events.
    else if (params.event_value === ''1'' && params_update.status === ''0'') {
        var issue_id = Redmine.createIssue(params.alert_subject,
            params.alert_subject + ''\\n'' + params.alert_message + ''\\n'' +
            params.zabbix_url + (params.zabbix_url.endsWith(''/'') ? '''' : ''/'') +
            ''tr_events.php?triggerid='' + params.trigger_id + ''&eventid='' + params.event_id + ''\\n'',
            priority,
            params_fields);

        result.tags.__zbx_redmine_issue_id = issue_id;
        result.tags.__zbx_redmine_issuelink = params.redmine_url +
            (params.redmine_url.endsWith(''/'') ? '''' : ''/'') + ''issues/'' + issue_id;
    }
    // Update created issue for trigger-based event.
    else {
        Redmine.updateIssue(params.alert_subject + ''\\n'' + params.alert_message, params_fields);
    }

    return JSON.stringify(result);
}
catch (error) {
    Zabbix.Log(3, ''[ Redmine Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','1','1','{EVENT.TAGS.__zbx_redmine_issuelink}','Redmine: issue #{EVENT.TAGS.__zbx_redmine_issue_id}','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('16','4','Telegram','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var Telegram = {
    token: null,
    to: null,
    message: null,
    proxy: null,
    parse_mode: null,

    escapeMarkup: function (str, mode) {
        switch (mode) {
            case ''markdown'':
                return str.replace(/([_*\\[`])/g, ''\\\\$&'');

            case ''markdownv2'':
                return str.replace(/([_*\\[\\]()~`>#+\\-=|{}.!])/g, ''\\\\$&'');

            default:
                return str;
        }
    },

    sendMessage: function () {
        var params = {
            chat_id: Telegram.to,
            text: Telegram.message,
            disable_web_page_preview: true,
            disable_notification: false
        },
        data,
        response,
        request = new CurlHttpRequest(),
        url = ''https://api.telegram.org/bot'' + Telegram.token + ''/sendMessage'';

        if (Telegram.parse_mode !== null) {
            params[''parse_mode''] = Telegram.parse_mode;
        }

        if (Telegram.proxy) {
            request.SetProxy(Telegram.proxy);
        }

        request.AddHeader(''Content-Type: application/json'');
        data = JSON.stringify(params);

        // Remove replace() function if you want to see the exposed token in the log file.
        Zabbix.Log(4, ''[Telegram Webhook] URL: '' + url.replace(Telegram.token, ''<TOKEN>''));
        Zabbix.Log(4, ''[Telegram Webhook] params: '' + data);
        response = request.Post(url, data);
        Zabbix.Log(4, ''[Telegram Webhook] HTTP code: '' + request.Status());

        try {
            response = JSON.parse(response);
        }
        catch (error) {
            response = null;
        }

        if (request.Status() !== 200 || typeof response.ok !== ''boolean'' || response.ok !== true) {
            if (typeof response.description === ''string'') {
                throw response.description;
            }
            else {
                throw ''Unknown error. Check debug log for more information.'';
            }
        }
    }
};

try {
    var params = JSON.parse(value);

    if (typeof params.Token === ''undefined'') {
        throw ''Incorrect value is given for parameter "Token": parameter is missing'';
    }

    Telegram.token = params.Token;

    if (params.HTTPProxy) {
        Telegram.proxy = params.HTTPProxy;
    } 

    params.ParseMode = params.ParseMode.toLowerCase();

    if ([''markdown'', ''html'', ''markdownv2''].indexOf(params.ParseMode) !== -1) {
        Telegram.parse_mode = params.ParseMode;
    }

    Telegram.to = params.To;
    Telegram.message = params.Subject + ''\\n'' + params.Message;

    if ([''markdown'', ''markdownv2''].indexOf(params.ParseMode) !== -1) {
        Telegram.message = Telegram.escapeMarkup(Telegram.message, params.ParseMode);
    }

    Telegram.sendMessage();

    return ''OK'';
}
catch (error) {
    Zabbix.Log(4, ''[Telegram Webhook] notification failed: '' + error);
    throw ''Sending failed: '' + error + ''.'';
}','10s','0','0','','','https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media/telegram

1. Register bot: send "/newbot" to @BotFather and follow instructions
2. Copy and paste the obtained token into the "Token" field above
3. If you want to send personal notifications, you need to get chat id of the user you want to send messages to:
    3.1. Send "/getid" to "@myidbot" in Telegram messenger
    3.2. Copy returned chat id and save it in the "Telegram Webhook" media for the user
    3.3. Ask the user to send "/start" to your bot (Telegram bot won''t send anything to the user without it)
4. If you want to send group notifications, you need to get group id of the group you want to send messages to:
    4.1. Add "@myidbot" to your group
    4.2. Send "/getgroupid@myidbot" in your group
    4.3. Copy returned group id save it in the "Telegram Webhook" media for the user you created for  group notifications
    4.4. Send "/start@your_bot_name_here" in your group (Telegram bot won''t send anything to the group without it)');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('17','4','Zendesk','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var Zendesk = {
    params: {},

    setParams: function (params) {
        if (typeof params !== ''object'') {
            return;
        }

        Zendesk.params = params;
        if (typeof Zendesk.params.url === ''string'') {
            if (!Zendesk.params.url.endsWith(''/'')) {
                Zendesk.params.url += ''/'';
            }
            Zendesk.params.url += ''api/v2/'';
        }
    },

    addCustomFields: function (data, fields) {
        if (typeof fields === ''object'' && Object.keys(fields).length) {
            var schema = Zendesk.getSchema(),
                arr = [],
                i,
                n;

            if (schema) {
                Object.keys(fields)
                    .forEach(function(field) {
                        for (i = 0, n = schema.ticket_fields.length; i < n; i++) {
                            if (schema.ticket_fields[i].id == field
                                && [''text'', ''integer'', ''date''].indexOf(schema.ticket_fields[i].type) !== -1){

                                switch (schema.ticket_fields[i].type) {
                                    case ''integer'':
                                        fields[field] = parseInt(fields[field]);
                                        break;
                                    case ''date'':
                                        if (fields[field].match(/^\\d{4}[.-]\\d{2}[.-]\\d{2}$/) !== null) {
                                            fields[field] = fields[field].replace(/\\./g, ''-'');
                                        }
                                        else {
                                            fields[field] = '''';
                                        }
                                        break;
                                }

                                arr.push({id: field, value: fields[field]});
                                break;
                            }
                        }
                    });

                if (arr.length) {
                    data.ticket[''custom_fields''] = arr;
                }
            }
            else {
                Zabbix.Log(4, ''[Zendesk Webhook] Failed to retrieve field schema.'');
            }
        }

        return data;
    },

    request: function (method, query, data) {
        [''url'', ''token'', ''type''].forEach(function (field) {
            if (typeof Zendesk.params !== ''object'' || typeof Zendesk.params[field] === ''undefined'') {
                throw ''Required Zendesk param is not set: '' + field + ''\\n'' + Zendesk.params[field];
            }
        });

        var response,
            url = Zendesk.params.url + query,
            request = new CurlHttpRequest();

        if (typeof Zendesk.HTTPProxy === ''string'' && Zendesk.HTTPProxy.trim() !== '''') {
            request.SetProxy(Zendesk.HTTPProxy);
        }

        request.AddHeader(''Content-Type: application/json'');
        request.AddHeader(''Authorization: Basic '' + btoa(Zendesk.params.token));

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        Zabbix.Log(4, ''[Zendesk Webhook] Sending request: '' + url + ((typeof data === ''string'') ? ('' '' + data) : ''''));

        switch (method) {
            case ''get'':
                response = request.Get(url, data);
                break;

            case ''post'':
                response = request.Post(url, data);
                break;

            case ''put'':
                response = request.Put(url, data);
                break;

            default:
                throw ''Unsupported HTTP request method: '' + method;
        }

        Zabbix.Log(4, ''[Zendesk Webhook] Received response with status code '' + request.Status() + ''. '' + response);

        if (response !== null) {
            try {
                response = JSON.parse(response);
            }
            catch (error) {
                Zabbix.Log(4, ''[Zendesk Webhook] Failed to parse response received from Zendesk.'');
            }
        }

        if (request.Status() < 200 || request.Status() >= 300) {
            var message = ''Request failed with status code '' + request.Status();

            if (response !== null && typeof response.error !== ''undefined''
                && Object.keys(response.error).length > 0) {
                message += '': '' + JSON.stringify(response.error);
            }
            else if (response !== null && typeof response.description !== ''undefined''
                && Object.keys(response.description).length > 0) {
                message += '': '' + JSON.stringify(response.description);
            }
            else {
                message += ''. '' + response;
            }
            throw message + ''. Check debug log for more information.'';
        }

        return {
            status: request.Status(),
            response: response
        };
    },

    getSchema: function() {
        var result = Zendesk.request(''get'', ''ticket_fields.json'');

        return result.response;
    },

    createIssue: function(data, fields) {
        var result = Zendesk.request(''post'', ''tickets.json'', Zendesk.addCustomFields(data, fields));

        if (typeof result.response !== ''object'' || typeof result.response.ticket.id === ''undefined''
            || result.status != 201) {
            throw ''Cannot create Zendesk issue. Check debug log for more information.'';
        }

        return result.response.ticket.id;
    },

    updateIssue: function(data, fields) {
        Zendesk.request(''put'', ''tickets/'' + Zendesk.params.issue_key + ''.json'', Zendesk.addCustomFields(data, fields));
    }
};

try {
    var params = JSON.parse(value),
        fields = {},
        zendesk = {},
        update = {},
        data = {},
        result = {tags: {}},
        required_params = [
            ''alert_subject'',
            ''alert_message'',
            ''event_id'',
            ''event_source'',
            ''event_value'',
            ''event_update_status''
        ],
        severities = [
            {name: ''not_classified'', color: ''#97AAB3''},
            {name: ''information'', color: ''#7499FF''},
            {name: ''warning'', color: ''#FFC859''},
            {name: ''average'', color: ''#FFA059''},
            {name: ''high'', color: ''#E97659''},
            {name: ''disaster'', color: ''#E45959''},
            {name: ''resolved'', color: ''#009900''},
            {name: ''default'', color: ''#000000''}
        ],
        priority;

    Object.keys(params)
        .forEach(function (key) {
            if (key.startsWith(''zendesk_'')) {
                zendesk[key.substring(8)] = params[key];
            }
            else if (key.startsWith(''customfield_'')) {
                fields[key.substring(12)] = params[key];
            }
            else if (key.startsWith(''event_update_'')) {
                update[key.substring(13)] = params[key];
            }
            else if (required_params.indexOf(key) !== -1 && params[key].trim() === '''') {
                throw ''Parameter '' + key + '' cannot be empty.'';
            }
        });

    // Possible values: question, incident, problems, task
    if ([''question'', ''incident'', ''problem'', ''task''].indexOf(params.zendesk_type) === -1) {
        throw ''Incorrect "zendesk_type" parameter given: '' + params.zendesk_type +
            ''\\nMust be one of question, incident, problem, task.'';
    }

    // Possible values: 0 - Trigger, 1 - Discovery, 2 - Autoregistration, 3 - Internal.
    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: '' + params.event_source + ''\\nMust be 0-3.'';
    }

    // Check {EVENT.VALUE} for trigger-based and internal events.
    // Possible values: 1 for problem, 0 for recovering
    if (params.event_value !== ''0'' && params.event_value !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    // Possible values: 0 - Webhook was called because of problem/recovery event, 1 - Update operation.
    if (params.event_source === ''0'' && params.event_update_status !== ''0'' && params.event_update_status !== ''1'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    if (params.event_source !== ''0'' && params.event_value === ''0'') {
        throw ''Recovery operations are supported only for trigger-based actions.'';
    }

    // Zendesk_issue_key must be a positive integer if an update action is being performed.
    if (params.event_source === ''0'' && ((params.event_value === ''1'' && params.event_update_status === ''1'')
        || (params.event_value === ''0'' && (params.event_update_status === ''0'' || params.event_update_status === ''1'')))
        && (isNaN(parseInt(params.zendesk_issue_key)) || parseInt(params.zendesk_issue_key) < 1 )) {
        throw ''Incorrect "zendesk_issue_key" parameter given: '' + params.zendesk_issue_key +
            ''\\nMust be positive integer.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''7'';
    }

    if (params.event_value === ''0'') {
        params.event_nseverity = ''6'';
    }

    priority = params[''severity_'' + severities[params.event_nseverity].name] || severities[7].name;

    Zendesk.setParams(zendesk);
    Zendesk.HTTPProxy = params.HTTPProxy;

    // Create issue for non trigger-based events.
    if (params.event_source !== ''0'' && params.event_value !== ''0'') {
        data = {
            ticket: {
                external_id: params.event_id,
                type: Zendesk.params.type,
                status: ''new'',
                subject: params.alert_subject,
                comment: {
                    body: params.alert_message,
                    public: ''false''
                },
                priority: priority,
                tags: params.event_tags
            }
        };

        Zendesk.createIssue(data, fields);
    }
    // Create issue for trigger-based events.
    else if (params.event_value === ''1'' && update.status === ''0'') {
        data = {
            ticket: {
                external_id: params.event_id,
                type: Zendesk.params.type,
                status: ''new'',
                subject: params.alert_subject,
                comment: {
                    body: params.zbxurl + (params.zbxurl.endsWith(''/'') ? '''' : ''/'') + ''tr_events.php?triggerid='' +
                        params.trigger_id + ''&eventid='' + params.event_id + ''\\n'' + params.alert_message,
                    public: ''false''
                },
                priority: priority,
                tags: params.event_tags
            }
        };
        var key = Zendesk.createIssue(data, fields);

        result.tags.__zbx_zdk_issuekey = key;
        result.tags.__zbx_zdk_issuelink = params.zendesk_url +
            (params.zendesk_url.endsWith(''/'') ? '''' : ''/'') + ''agent/tickets/'' + key;
    }
    // Update created issue for trigger-based event.
    else {
        data = {
            ticket: {
                type: Zendesk.params.type,
                subject: params.alert_subject,
                comment: {
                    body: params.alert_message,
                    public: ''false''
                }
            }
        };

        Zendesk.updateIssue(data, fields);
    }

    return JSON.stringify(result);
}
catch (error) {
    Zabbix.Log(3, ''[Zendesk Webhook] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','1','1','{EVENT.TAGS.__zbx_zdk_issuelink}','Zendesk: {EVENT.TAGS.__zbx_zdk_issuekey}','');

INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('19','4','Zammad','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var Zammad = {
    params: {},

    setParams: function (params) {
        if (typeof params !== ''object'') {
            return;
        }

        Zammad.params = params;
        if (typeof Zammad.params.url === ''string'') {
            if (!Zammad.params.url.endsWith(''/'')) {
                Zammad.params.url += ''/'';
            }
        }
    },

    request: function (method, query, data) {
        [''url'', ''access_token''].forEach(function (field) {
            if (typeof Zammad.params !== ''object'' || typeof Zammad.params[field] === ''undefined''
                || Zammad.params[field] === '''' ) {
                throw ''Required param is not set: "'' + field + ''".'';
            }
        });

        var response,
            url = Zammad.params.url + query,
            request = new CurlHttpRequest();

        if (typeof Zammad.HTTPProxy === ''string'' && Zammad.HTTPProxy.trim() !== '''') {
            request.SetProxy(Zammad.HTTPProxy);
        }

        request.AddHeader(''Content-Type: application/json'');
        request.AddHeader(''Authorization: Token token='' + Zammad.params.access_token);

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        Zabbix.Log(4, ''[ Zammad Webhook ] Sending request: '' +
            url + ((typeof data === ''string'') ? ('' '' + data) : ''''));

        switch (method) {
            case ''get'':
                response = request.Get(url, data);
                break;

            case ''post'':
                response = request.Post(url, data);
                break;

            case ''put'':
                response = request.Put(url, data);
                break;

            default:
                throw ''Unsupported HTTP request method: '' + method;
        }

        Zabbix.Log(4, ''[ Zammad Webhook ] Received response with status code '' + request.Status() + '': '' + response);

        if (response !== null) {
            try {
                response = JSON.parse(response);
            }
            catch (error) {
                Zabbix.Log(4, ''[ Zammad Webhook ] Failed to parse response received from Zammad'');
                response = null;
            }
        }

        if (request.Status() < 200 || request.Status() >= 300) {
            var message = ''Request failed with status code '' + request.Status();

            if (response !== null && typeof response.errors !== ''undefined''
                && Object.keys(response.errors).length > 0) {
                message += '': '' + JSON.stringify(response.errors);
            }
            else if (response !== null && typeof response.errorMessages !== ''undefined''
                && Object.keys(response.errorMessages).length > 0) {
                message += '': '' + JSON.stringify(response.errorMessages);
            }

            throw message + '' Check debug log for more information.'';
        }

        return {
            status: request.Status(),
            response: response
        };
    },

    setTicketTags: function(tags, ticket_id) {
        try {
            var tags_json = JSON.parse(tags),
                result;

            for (var i in tags_json) {
                result = Zammad.request(''get'',
                    ''/api/v1/tags/add?object=Ticket&o_id='' + ticket_id +
                    ''&item='' + tags_json[i].tag);

                if (typeof result.response !== ''object''
                    || result.status != 200) {
                    Zabbix.Log(4, ''[ Zammad Webhook ] Cannot add ticket tag:'' + tags_json[i].tag);
                }
            }
        }
        catch (error) {
            Zabbix.Log(4, ''[ Zammad Webhook ] Failed to add ticket tags:'' + error);
        }

        return;
    },

    createTicket: function(subject, message, priority) {
        var data = {
                title: subject,
                group: ''Users'',
                article: {
                    subject: subject,
                    body: message,
                    type: ''note'',
                    internal: false
                },
                customer: Zammad.params.customer
            },
            result;

        if (priority) {
            data.priority_id = priority;
        }

        result = Zammad.request(''post'', ''api/v1/tickets'', data);

        if (typeof result.response !== ''object''
            || typeof result.response.id === ''undefined''
            || result.status != 201) {
            throw ''Cannot create Zammad ticket. Check debug log for more information.'';
        }

        return result.response.id;
    },

    updateTicket: function(subject, message) {
        var data = {
            ticket_id: Zammad.params.ticket_id,
            subject: subject,
            body: message || '''',
            type: ''note'',
            internal: false
        };

        result = Zammad.request(''post'', ''api/v1/ticket_articles'', data);

        if (typeof result.response !== ''object''
            || typeof result.response.id === ''undefined''
            || result.status != 201) {
            throw ''Cannot update Zammad ticket. Check debug log for more information.'';
        }
    }
};

try {
    var params = JSON.parse(value),
        params_zammad = {},
        params_update = {},
        result = {tags: {}},
        required_params = [
            ''alert_subject'', ''customer'',
            ''event_source'', ''event_value'',
            ''event_update_status''
        ],
        severities = [
            {name: ''not_classified'', color: ''#97AAB3''},
            {name: ''information'', color: ''#7499FF''},
            {name: ''warning'', color: ''#FFC859''},
            {name: ''average'', color: ''#FFA059''},
            {name: ''high'', color: ''#E97659''},
            {name: ''disaster'', color: ''#E45959''},
            {name: ''resolved'', color: ''#009900''},
            {name: null, color: ''#000000''}
        ],
        priority;

    Object.keys(params)
        .forEach(function (key) {
            if (key.startsWith(''zammad_'')) {
                params_zammad[key.substring(7)] = params[key].trim();
            }
            else if (key.startsWith(''event_update_'')) {
                params_update[key.substring(13)] = params[key];
            }
            else if (required_params.indexOf(key) !== -1 && params[key].trim() === '''') {
                throw ''Parameter "'' + key + ''" cannot be empty.'';
            }
        });

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: '' + params.event_source + ''\\nMust be 0-3.'';
    }

    // Check {EVENT.VALUE} for trigger-based and internal events.
    if (params.event_value !== ''0'' && params.event_value !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    if (params.event_source === ''0'' && params.event_update_status !== ''0'' && params.event_update_status !== ''1'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    if (params.event_source !== ''0'' && params.event_value === ''0'') {
        throw ''Recovery operations are supported only for trigger-based actions.'';
    }

    if (params.event_source === ''0''
        && ((params.event_value === ''1'' && params.event_update_status === ''1'')
            || (params.event_value === ''0''
                && (params.event_update_status === ''0'' || params.event_update_status === ''1'')))
        && (isNaN(parseInt(params.zammad_ticket_id)) || parseInt(params.zammad_ticket_id) < 1 )) {
        throw ''Incorrect "zammad_ticket_id" parameter given: '' + params.zammad_ticket_id +
            ''\\nMust be positive integer.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''7'';
    }

    if (params.event_value === ''0'') {
        params.event_nseverity = ''6'';
    }

    priority = params[''severity_'' + severities[params.event_nseverity].name];
    priority = priority && priority.trim() || severities[7].name;

    Zammad.setParams(params_zammad);
    Zammad.HTTPProxy = params.HTTPProxy;

    // Create ticket for non trigger-based events.
    if (params.event_source !== ''0''
        && params.event_value !== ''0'') {
        Zammad.createTicket(params.alert_subject, params.alert_message, priority, params.event_tags);
    }
    // Create ticket for trigger-based events.
    else if (params.event_value === ''1'' && params_update.status === ''0'') {
        var ticket_id = Zammad.createTicket(params.alert_subject,
            params.alert_subject + ''\\n'' + params.alert_message + ''\\n'' +
            params.zabbix_url + (params.zabbix_url.endsWith(''/'') ? '''' : ''/'') +
            ''tr_events.php?triggerid='' + params.trigger_id + ''&eventid='' + params.event_id + ''\\n'',
            priority);

        result.tags.__zbx_zammad_ticket_id = ticket_id;
        result.tags.__zbx_zammad_ticketlink = params.zammad_url +
            (params.zammad_url.endsWith(''/'') ? '''' : ''/'') + ''#ticket/zoom/'' + ticket_id;

        if (Zammad.params.enable_tags.toLowerCase() === ''true'') {
            Zammad.setTicketTags(params.event_tags, ticket_id);
        }
    }
    // Update created ticket for trigger-based event.
    else {
        Zammad.updateTicket(params.alert_subject, params.alert_message);
    }

    return JSON.stringify(result);
}
catch (error) {
    Zabbix.Log(3, ''[ Zammad Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','1','1','{EVENT.TAGS.__zbx_zammad_ticketlink}','Zammad: ticket #{EVENT.TAGS.__zbx_zammad_ticket_id}','');


INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('22','4','iLert','','','','','','','','0','25','0','0','0','0','','1','3','10s','1','try {
    var result = { tags: {} },
        params = JSON.parse(value),
        req = new CurlHttpRequest(),
        resp = '''';

    if (typeof params.HTTPProxy === ''string'' && params.HTTPProxy.trim() !== '''') {
        req.SetProxy(params.HTTPProxy);
    }
    var alertSourceKey = params[''.ILERT.ALERT.SOURCE.KEY''];
    if (!alertSourceKey || (typeof alertSourceKey === ''string'' && alertSourceKey.trim() === '''')) {
        throw ''incorrect value for variable "ILERT.ALERT.SOURCE.KEY". The value must be a non-empty string.'';
    }
    delete params[''.ILERT.ALERT.SOURCE.KEY''];
    
    var ilertApiBaseURL = "https://api.ilert.com";
    var reqURL = encodeURI(ilertApiBaseURL + "/api/v1/events/zabbix-mt/" + alertSourceKey)

    var incidentKey = "zabbix-" + params[''EVENT.ID''];
    var incidentViewURL = ilertApiBaseURL + "/api/v1/incidents/resolve-ik/" + alertSourceKey + "/" + incidentKey;

    req.AddHeader(''Accept: application/json'');
    req.AddHeader(''Content-Type: application/json'');

    Zabbix.Log(4, ''[iLert Webhook] Sending request:'' + JSON.stringify(params));
    resp = req.Post(reqURL, JSON.stringify(params));
    Zabbix.Log(4, ''[iLert Webhook] Receiving response:'' + resp);

    try {
        resp = JSON.parse(resp);
    }
    catch (error) {
        throw ''incorrect response. iLert returned a non-JSON object.'';
    }

    if (req.Status() == 200) {
        result.tags.__ilert_incident_url = incidentViewURL;
        return JSON.stringify(result);
    }

    if (req.Status() == 400 && typeof resp === ''object'' && typeof resp.code === ''string'') {
        if (resp.code === ''NO_OPEN_INCIDENT_WITH_KEY'') {
          return JSON.stringify(result);
        }
        if (resp.code === ''INCIDENT_ALREADY_ACCEPTED'') {
          result.tags.__ilert_incident_url = incidentViewURL;
          return JSON.stringify(result);
        }
    }

    if (typeof resp === ''object'' && typeof resp.message === ''string'') {
        throw resp.message;
    }
    else {
        throw ''Unknown error.'';
    }
}
catch (error) {
    Zabbix.Log(3, ''[iLert Webhook] Notification failed : '' + error);
    throw ''iLert notification failed : '' + error;
}','30s','1','1','{EVENT.TAGS.__ilert_incident_url}','iLert incident','Please refer to https://docs.ilert.com/integrations/zabbix/native 
  
Set global macro {$ZABBIX.URL} with your Zabbix server URL.
Add a dedicated user with the media type "iLert". You can also rewrite the incident summary via ".ILERT.INCIDENT.SUMMARY" parameter or leave it empty to use the standard pattern.');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('23','4','SolarWinds Service Desk','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var SolarWinds = {
    params: {},

    setParams: function (params) {
        if (typeof params !== ''object'') {
            return;
        }

        SolarWinds.params = params;
        SolarWinds.params.endpoint = ''https://api.samanage.com/'';
    },

    setProxy: function (HTTPProxy) {
        SolarWinds.HTTPProxy = HTTPProxy;
    },

    addCustomFields: function (data, fields) {
        if (typeof data.incident === ''object'' && typeof fields === ''object'' && Object.keys(fields).length) {
            if (typeof fields.sw_fields === ''object'' && Object.keys(fields.sw_fields).length) {
                Object.keys(fields.sw_fields)
                    .forEach(function(field) {
                        try {
                            data.incident[field] = JSON.parse(fields.sw_fields[field]);
                        }
                        catch (error) {
                            data.incident[field] = fields.sw_fields[field];
                        }
                    });
            }

            if (typeof fields.sw_customfields === ''object'' && Object.keys(fields.sw_customfields).length) {
                data.incident.custom_fields_values = {custom_fields_value: []};
                Object.keys(fields.sw_customfields)
                    .forEach(function(field) {
                        data.incident.custom_fields_values.custom_fields_value.push({
                            name: field,
                            value: fields.sw_customfields[field]
                        });
                    });
            }
        }

        return data;
    },

    request: function (method, query, data) {
        [''token''].forEach(function (field) {
            if (typeof SolarWinds.params !== ''object'' || typeof SolarWinds.params[field] === ''undefined''
                || SolarWinds.params[field] === '''' ) {
                throw ''Required SolarWinds param is not set: "'' + field + ''".'';
            }
        });

        var response,
            url = SolarWinds.params.endpoint + query,
            request = new CurlHttpRequest();

        request.AddHeader(''Content-Type: application/json'');
        request.AddHeader(''X-Samanage-Authorization: Bearer '' + SolarWinds.params.token);
        request.AddHeader(''Accept: application/vnd.samanage.v2.1+json'');

        if (typeof SolarWinds.HTTPProxy !== ''undefined'' && SolarWinds.HTTPProxy !== '''') {
            request.SetProxy(SolarWinds.HTTPProxy);
        }

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        Zabbix.Log(4, ''[ SolarWinds SD Webhook ] Sending request: '' + url + ((typeof data === ''string'')
            ? (''\\n'' + data)
            : ''''));

        switch (method) {
            case ''get'':
                response = request.Get(url, data);
                break;

            case ''post'':
                response = request.Post(url, data);
                break;

            case ''put'':
                response = request.Put(url, data);
                break;

            default:
                throw ''Unsupported HTTP request method: '' + method;
        }

        Zabbix.Log(4, ''[ SolarWinds SD Webhook ] Received response with status code '' + request.Status() +
            ''\\n'' + response);

        if (response !== null) {
            try {
                response = JSON.parse(response);
            }
            catch (error) {
                Zabbix.Log(4, ''[ SolarWinds SD Webhook ] Failed to parse response received from SolarWinds'');
                response = null;
            }
        }

        if (request.Status() < 200 || request.Status() >= 300) {
            var message = ''Request failed with status code '' + request.Status();

            if (response !== null && typeof response.error !== ''undefined''
                && Object.keys(response.error).length > 0) {
                message += '': '' + JSON.stringify(response.error);
            }
            else if (response !== null && typeof response === ''object''
                && Object.keys(response).length > 0) {
                Object.keys(response)
                    .forEach(function(field) {
                        message += ''\\n'' + field + '': '' + response[field][0];
                    });
            }

            throw message + '' Check debug log for more information.'';
        }

        return {
            status: request.Status(),
            response: response
        };
    },

    createIncident: function(name, description, fields) {
        var data = {
            incident: {
                name: name,
                description: description,
                priority: SolarWinds.params.priority
            }
        };

        var result = SolarWinds.request(''post'', ''incidents.json'', SolarWinds.addCustomFields(data, fields));

        if (typeof result.response !== ''object'' || typeof result.response.id === ''undefined'') {
            throw ''Cannot create SolarWinds incident. Check debug log for more information.'';
        }

        return result.response.id;
    },

    updateIncident: function(name, fields, message) {
        var data = {
            incident: {
                name: name,
                priority: SolarWinds.params.priority
            }
        };

        SolarWinds.request(
            ''put'',
            ''incidents/'' + SolarWinds.params.incident_id + ''.json'',
            SolarWinds.addCustomFields(data, fields));

        SolarWinds.commenIncident(message);
    },

    commenIncident: function(message) {
        var data = {
            comment: {
                body: message
            }
        };

        SolarWinds.request(''post'', ''incidents/'' + SolarWinds.params.incident_id + ''/comments.json'', data);
    }
};

try {
    var params = JSON.parse(value),
        fields = {},
        samanage = {},
        result = {tags: {}},
        required_params = [''alert_subject'', ''event_recovery_value'', ''event_source'', ''event_value'', ''priority_default''],
        severities = [
            {name: ''not_classified''},
            {name: ''information''},
            {name: ''warning''},
            {name: ''average''},
            {name: ''high''},
            {name: ''disaster''},
            {name: ''resolved''},
            {name: ''default''}
        ];

    fields.sw_fields = {};
    fields.sw_customfields = {};

    Object.keys(params)
        .forEach(function (key) {
            if (key.startsWith(''samanage_'')) {
                samanage[key.substring(9)] = params[key];
            }
            else if (key.startsWith(''sw_field_'')) {
                fields.sw_fields[key.substring(9)] = params[key];
            }
            else if (key.startsWith(''sw_customfield_'')) {
                fields.sw_customfields[key.substring(15)] = params[key];
            }
            else if (required_params.indexOf(key) !== -1 && params[key] === '''') {
                throw ''Parameter "'' + key + ''" can\\''t be empty.'';
            }
        });

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: '' + params.event_source + ''\\nMust be 0-3.'';
    }

    // Check {EVENT.VALUE} for trigger-based and internal events.
    if (params.event_value !== ''0'' && params.event_value !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    if (params.event_update_status !== ''0'' && params.event_update_status !== ''1'' && params.event_source === ''0'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    if (params.event_source !== ''0'' && params.event_recovery_value === ''0'') {
        throw ''Recovery operations are supported only for trigger-based actions.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''7'';
    }

    if (params.event_value === ''0'') {
        params.event_nseverity = ''6'';
    }

    samanage.priority = params[''priority_'' + severities[params.event_nseverity].name] || params.priority_default;

    SolarWinds.setParams(samanage);
    SolarWinds.setProxy(params.HTTPProxy);

    // Create incident for non trigger-based events.
    if (params.event_source !== ''0'' && params.event_recovery_value !== ''0'') {
        SolarWinds.createIncident(params.alert_subject, params.alert_message);
    }
    // Create incident for trigger-based events.
    else if (params.event_value === ''1'' && params.event_update_status === ''0''
            && samanage.incident_id === ''{EVENT.TAGS.__zbx_solarwinds_inc_id}'') {
        var key = SolarWinds.createIncident(params.alert_subject, params.alert_message, fields);


        result.tags.__zbx_solarwinds_inc_id = key;
        result.tags.__zbx_solarwinds_inc_link = params.samanage_url +
            (params.samanage_url.endsWith(''/'') ? '''' : ''/'') + ''incidents/'' + key;
    }
    // Update created incident for trigger-based event.
    else {
        if (samanage.incident_id === ''{EVENT.TAGS.__zbx_solarwinds_inc_id}'' || samanage.incident_id === '''') {
            throw ''Incorrect incident key given: '' + samanage.incident_id;
        }
        if (!params.alert_message) {
            throw ''Parameter "alert_message" can\\''t be empty.'';
        }
        SolarWinds.updateIncident(params.alert_subject, fields, params.alert_message);
    }

    if (params.event_source === ''0'') {
        return JSON.stringify(result);
    }
    else {
        return ''OK'';
    }
}
catch (error) {
    Zabbix.Log(3, ''[ SolarWinds SD Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','1','1','{EVENT.TAGS.__zbx_solarwinds_inc_link}','SolarWinds incident ID: {EVENT.TAGS.__zbx_solarwinds_inc_id}','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('24','4','SysAid','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var SysAid = {
    params: {},

    setParams: function (params) {
        var required = [''url'', ''auth_user'', ''auth_password'', ''category_level_1'', ''category_level_2'',
            ''category_level_3'', ''incident_id'', ''template_id'', ''urgency_id'', ''incident_state'',
            ''default_priority_id''
        ];

        required.forEach(function (field) {
            if (typeof params !== ''object'' || typeof params[field] === ''undefined'' || params[field] === '''') {
                throw ''Required param is not set: "'' + field + ''".'';
            }
        });

        SysAid.params = params;
        if (typeof SysAid.params.url === ''string'' && !SysAid.params.url.endsWith(''/'')) {
            SysAid.params.url += ''/'';
        }
    },

    login: function () {
        var result = SysAid.request(''post'', ''api/v1/login'', {
            user_name: SysAid.params.auth_user,
            password: SysAid.params.auth_password
        });

        return result.response.user.id;
    },

    request: function (method, query, data) {
        var response,
            request = SysAid.req || (SysAid.req = new CurlHttpRequest()),
            url = SysAid.params.url + query;

        if (typeof SysAid.HTTPProxy !== ''undefined'' && SysAid.HTTPProxy.trim() !== '''') {
            request.SetProxy(SysAid.HTTPProxy);
        }

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        Zabbix.Log(4, ''[ SysAid Webhook ] Sending request: '' +
            url + ((typeof data === ''string'') ? ('' '' + data) : ''''));

        switch (method) {
            case ''get'':
                response = request.Get(url, data);
                break;

            case ''post'':
                response = request.Post(url, data);
                break;

            case ''put'':
                response = request.Put(url, data);
                break;

            default:
                throw ''Unsupported HTTP request method: '' + method;
        }

        Zabbix.Log(4, ''[ SysAid Webhook ] Received response with status code '' + request.Status() + '': '' + response);

        if (request.Status() !== 200) {
            var message = ''Request failed with status code '' + request.Status();

            message += '': '' + response;
            throw message + '' Check debug log for more information.'';
        }

        if (response !== null) {
            try {
                response = JSON.parse(response);
            }
            catch (error) {
                Zabbix.Log(4, ''[ SysAid Webhook ] Failed to parse response received from SysAid'');
                response = null;
            }
        }

        if (response === null || (typeof response.Error !== ''undefined'' && Object.keys(response.Error).length > 0)) {
            throw ''Request failed: '' + JSON.stringify(response.Error);
        }

        return {
            status: request.Status(),
            response: response
        };
    },

    createIncident: function(subject, message, priority) {
        var result = SysAid.request(''post'', ''api/v1/sr/?template='' + encodeURIComponent(SysAid.params.template_id), {
            info: [
                {
                    key: ''problem_type'',
                    value: [
                        SysAid.params.category_level_1,
                        SysAid.params.category_level_2,
                        SysAid.params.category_level_3
                    ].join(''_'')
                },
                {
                    key: ''title'',
                    value: subject
                },
                {
                    key: ''description'',
                    value: message
                },
                {
                    key: ''status'',
                    value: ''1''
                },
                {
                    key: ''urgency'',
                    value: SysAid.params.urgency_id
                },
                {
                    key: ''priority'',
                    value: priority || SysAid.params.default_priority_id,
                }
            ]
        });

        if (result.response.id === ''undefined'') {
            throw ''Cannot create SysAid incident. Check debug log for more information.'';
        }

        return result.response.id;
    },

    updateTicket: function(note) {
        var date = new Date().getTime();

        SysAid.request(''put'', ''api/v1/sr/'' + encodeURIComponent(SysAid.params.incident_id), {
            id: SysAid.params.incident_id,
            info: [
                {
                    key: ''update_time'',
                    value: date
                },
                {
                    key: ''notes'',
                    value: [
                        {
                            userName: ''Zabbix'',
                            createDate: date,
                            text: note
                        }
                    ]
                }
            ]
        });
    }
};

try {
    var params = JSON.parse(value),
        params_sysaid = {},
        params_update = {},
        result = {tags: {}},
        required_params = [''alert_subject'', ''event_source'', ''event_value'',  ''event_update_status''],
        severities = [
            {name: ''not_classified'', color: ''#97AAB3''},
            {name: ''information'', color: ''#7499FF''},
            {name: ''warning'', color: ''#FFC859''},
            {name: ''average'', color: ''#FFA059''},
            {name: ''high'', color: ''#E97659''},
            {name: ''disaster'', color: ''#E45959''},
            {name: ''resolved'', color: ''#009900''},
            {name: null, color: ''#000000''}
        ],
        priority;

    Object.keys(params)
        .forEach(function (key) {
            if (key.startsWith(''sysaid_'')) {
                params_sysaid[key.substring(7)] = params[key];
            }
            else if (key.startsWith(''event_update_'')) {
                params_update[key.substring(13)] = params[key];
            }
            else if (required_params.indexOf(key) !== -1 && params[key].trim() === '''') {
                throw ''Parameter "'' + key + ''" cannot be empty.'';
            }
        });

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: '' + params.event_source + ''\\nMust be 0-3.'';
    }

    // Check {EVENT.VALUE} for trigger-based and internal events.
    if (params.event_value !== ''0'' && params.event_value !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    if (params.event_source === ''0'' && params.event_update_status !== ''0'' && params.event_update_status !== ''1'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    if (params.event_source !== ''0'' && params.event_value === ''0'') {
        throw ''Recovery operations are supported only for trigger-based actions.'';
    }

    if (params.event_source === ''0'' && ((params.event_value === ''1'' && params.event_update_status === ''1'')
            || (params.event_value === ''0'' && (params.event_update_status === ''0'' || params.event_update_status === ''1'')))
            && (isNaN(parseInt(params.sysaid_incident_id)) || parseInt(params.sysaid_incident_id) < 1 )) {
        throw ''Incorrect "sysaid_incident_id" parameter given: '' + params.sysaid_incident_id + ''\\nMust be positive integer.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''7'';
    }

    if (params.event_value === ''0'') {
        params.event_nseverity = ''6'';
    }

    priority = params[''severity_'' + severities[params.event_nseverity].name];
    priority = priority && priority.trim() || severities[7].name;

    SysAid.setParams(params_sysaid);
    SysAid.HTTPProxy = params.HTTPProxy;
    SysAid.login();

    if (params.event_source !== ''0'' && params.event_value !== ''0'') {
        // Create ticket for non trigger-based events.
        SysAid.createIncident(params.alert_subject, params.alert_message, priority);
    }
    else if (params.event_value === ''1'' && params_update.status === ''0'') {
        // Create ticket for trigger-based events.
        var incident_id = SysAid.createIncident(params.alert_subject, params.alert_subject + ''\\n'' + params.alert_message +
                ''\\n'' + params.zabbix_url + (params.zabbix_url.endsWith(''/'') ? '''' : ''/'') + ''tr_events.php?triggerid='' +
                params.trigger_id + ''&eventid='' + params.event_id + ''\\n'', priority
        );

        result.tags.__zbx_sysaid_incident_id = incident_id;
        result.tags.__zbx_sysaid_incidentlink = params.sysaid_url +
            (params.sysaid_url.endsWith(''/'') ? '''' : ''/'') + ''SREdit.jsp?id='' + incident_id + ''&fromId=IncidentsList'';
    }
    else {
        // Update created ticket for trigger-based event.
        SysAid.updateTicket(params.alert_subject + ''\\n'' + params.alert_message);
    }

    return JSON.stringify(result);
}
catch (error) {
    Zabbix.Log(3, ''[ SysAid Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','1','1','{EVENT.TAGS.__zbx_sysaid_incidentlink}','SysAid: incident #{EVENT.TAGS.__zbx_sysaid_incident_id}','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('25','4','TOPdesk','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var Media = {
    params: {},
    name: '''',
    labels: [],
    HTTPProxy: '''',

    setParams: function (params) {
        if (typeof params !== ''object'') {
            return;
        }

        Media.params = params;
        Media.params.api += Media.params.api.endsWith(''/'') ? '''' : ''/'';
    },

    setProxy: function (HTTPProxy) {
        if (typeof HTTPProxy !== ''undefined'' && HTTPProxy.trim() !== '''') {
            Media.HTTPProxy = HTTPProxy;
        }
    },

    request: function (method, query, data) {
        [''api'', ''token''].forEach(function (field) {
            if (typeof Media.params !== ''object'' || typeof Media.params[field] === ''undefined''
                    || Media.params[field] === '''') {
                throw ''Required '' + Media.name + '' param is not set: "'' + field + ''".'';
            }
        });

        var response,
            url = Media.params.api + query,
            request = new CurlHttpRequest();

        request.AddHeader(''Content-Type: application/json'');
        request.AddHeader(''Accept: application/json'');
        request.AddHeader(''Authorization: '' + Media.params.token);
        request.SetProxy(Media.HTTPProxy);

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        Zabbix.Log(4, ''[ '' + Media.name + '' Webhook ] Sending request: '' +
            url + ((typeof data === ''string'') ? (''\\n'' + data) : ''''));

        switch (method) {
            case ''get'':
                response = request.Get(url, data);
                break;

            case ''post'':
                response = request.Post(url, data);
                break;

            case ''put'':
                response = request.Put(url, data);
                break;

            default:
                throw ''Unsupported HTTP request method: '' + method;
        }

        Zabbix.Log(4, ''[ '' + Media.name + '' Webhook ] Received response with status code '' +
            request.Status() + ''\\n'' + response);

        if (response !== null) {
            try {
                response = JSON.parse(response);
            }
            catch (error) {
                Zabbix.Log(4, ''[ '' + Media.name + '' Webhook ] Failed to parse response.'');
                response = null;
            }
        }

        if (request.Status() < 200 || request.Status() >= 300) {
            var message = ''Request failed with status code '' + request.Status();

            if (response !== null) {
                if (typeof response.errors === ''object'' && Object.keys(response.errors).length > 0) {
                    message += '': '' + JSON.stringify(response.errors);
                }
                else if (typeof response.errorMessages === ''object'' && Object.keys(response.errorMessages).length > 0) {
                    message += '': '' + JSON.stringify(response.errorMessages);
                }
                else if (typeof response.message === ''string'') {
                    message += '': '' + response.message;
                }
            }

            throw message + '' Check debug log for more information.'';
        }

        return {
            status: request.Status(),
            response: response
        };
    }
};

try {
    var result = {tags: {}},
        params = JSON.parse(value),
        media = {},
        fields = {},
        resp = {},
        required_params = [
            ''alert_subject'',
            ''alert_message'',
            ''event_id'',
            ''event_source'',
            ''event_value'',
            ''event_update_status'',
            ''topdesk_api'',
            ''topdesk_user'',
            ''topdesk_password''
        ],
        severities = [
            ''not_classified'',
            ''information'',
            ''warning'',
            ''average'',
            ''high'',
            ''disaster'',
            ''resolved'',
            ''default''
        ],
        priority;

    Object.keys(params)
        .forEach(function (key) {
            if (required_params.indexOf(key) !== -1 && params[key].trim() === '''') {
                throw ''Parameter "'' + key + ''" cannot be empty.'';
            }
            if (key.startsWith(''topdesk_'')) {
                media[key.substring(8)] = params[key];
            }
        });

    // Possible values of event_source:
    // 0 - Trigger, 1 - Discovery, 2 - Autoregistration, 3 - Internal.
    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: "'' + params.event_source + ''".\\nMust be 0-3.'';
    }

    // Check event_value for trigger-based and internal events.
    // Possible values: 1 for problem, 0 for recovering
    if (params.event_value !== ''0'' && params.event_value !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check event_update_status only for trigger-based events.
    // Possible values: 0 - Webhook was called because of problem/recovery event, 1 - Update operation.
    if (params.event_source === ''0'' && params.event_update_status !== ''0'' && params.event_update_status !== ''1'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    // Check event_id for a numeric value.
    if (isNaN(parseInt(params.event_id)) || params.event_id < 1) {
        throw ''Incorrect "event_id" parameter given: '' + params.event_id + ''\\nMust be a positive number.'';
    }

    if ((params.event_source === ''1'' || params.event_source === ''2'')  && params.event_value === ''0'') {
        throw ''Recovery operations are supported only for Trigger and Internal actions.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''7'';
    }

    if (params.event_value === ''0'') {
        params.event_nseverity = ''6'';
    }

    priority = params[''severity_'' + severities[params.event_nseverity]];
    params.zbxurl = params.zbxurl + (params.zbxurl.endsWith(''/'') ? '''' : ''/'');

    Media.name = ''TOPdesk'';
    Media.setParams(media);
    Media.params.token = ''Basic '' + btoa(Media.params.user + '':'' + Media.params.password);
    Media.setProxy(params.HTTPProxy);

    // Create an issue.
    // Numeric value of the event that triggered an action (1 for problem, 0 for recovering).
    // Numeric value of of the problem update status. Possible values:
    // 0 - Webhook was called because of problem/recovery event, 1 - Update operation.
    if ((params.event_source == 0 && params.event_value == 1 && params.event_update_status == 0)
            || (params.event_source == 3 && params.event_value == 1)
            || params.event_source == 1 || params.event_source == 2) {
        Zabbix.Log(4, ''[ '' + Media.name + '' Webhook ] Request of the ticket creating.'');
        fields.caller = {dynamicName: ''Zabbix''};
        fields.briefDescription = params.alert_subject;
        fields.request = params.alert_message.replace(/\\n/g, ''<br>'');
        fields.priority = {name: priority};
        fields.processingStatus = {name: Media.params.status};
        fields.externalNumber = params.event_id;
        fields.request += ''<br>'' + params.zbxurl;

        if (params.event_source === ''0'') {
            fields.request += ''tr_events.php?triggerid='' + params.trigger_id + ''&eventid='' + params.event_id;
        }

        resp = Media.request(''post'', ''tas/api/incidents'', fields);
        if (typeof resp.response !== ''object'' || typeof resp.response.id === ''undefined'') {
            throw ''Cannot create '' + Media.name + '' issue. Check debug log for more information.'';
        }

        if (params.event_source == 0 && params.event_value == 1 && params.event_update_status == 0) {
            result.tags.__zbx_tpd_issuekey = resp.response.number;
            result.tags.__zbx_tpd_issuelink = Media.params.api +
                ''tas/secure/incident?action=show&unid='' + resp.response.id;
        }
    }
    // Update a created issue.
    else {
        if (params.event_source == 3 && params.event_value == 0) {
            throw ''Internal event recovery actions are not supported.'';
        }

        Zabbix.Log(4, ''[ '' + Media.name + '' Webhook ] Request of the ticket updating.'');
        fields.action = params.alert_message.replace(/\\n/g, ''<br>'');

        resp = Media.request(''put'', ''tas/api/incidents/number/'' + Media.params.issue_key, fields);
        if (typeof resp.response !== ''object'' || typeof resp.response.id === ''undefined''
                || resp.response.number !== Media.params.issue_key) {
            throw ''Cannot update '' + Media.name + '' issue. Check debug log for more information.'';
        }
    }

    return JSON.stringify(result);
}
catch (error) {
    Zabbix.Log(3, ''[ '' + Media.name + '' Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','1','1','{EVENT.TAGS.__zbx_tpd_issuelink}','TOPdesk: {EVENT.TAGS.__zbx_tpd_issuekey}','Please refer to https://developers.topdesk.com/documentation/index.html and https://www.zabbix.com/documentation/5.0/manual/config/notifications/media/webhook#example_scripts.
  
Set global macro {$ZABBIX.URL} with your Zabbix server URL.
Add a dedicated user with the media type "TOPdesk".
Change the values of the variables topdesk_api (URL), topdesk_password, topdesk_user. The topdesk_status is the default status for creating a new TOPdesk ticket.');

INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('27','4','Rocket.Chat','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var RocketChat = {
    params: {},

    setParams: function (params) {
        if (typeof params !== ''object'') {
            return;
        }

        RocketChat.params = params;
        if (RocketChat.params.url && RocketChat.params.api_url) {
            if (!RocketChat.params.url.endsWith(''/'')) {
                RocketChat.params.url += ''/'';
            }
            if (!RocketChat.params.api_url.endsWith(''/'')) {
                RocketChat.params.api_url += ''/'';
            }
            if (RocketChat.params.api_url.startsWith(''/'')) {
                RocketChat.params.api_url = RocketChat.params.api_url.substring(1);
            }

            RocketChat.params.url += RocketChat.params.api_url;
        }
    },

    setProxy: function (HTTPProxy) {
        RocketChat.HTTPProxy = HTTPProxy;
    },

    addFields: function (fields) {
        var data = [];

        if (typeof fields === ''object'' && Object.keys(fields).length) {
            Object.keys(fields)
                .forEach(function(field) {
                    if (fields[field] === '''') {
                        Zabbix.Log(4, ''[ RocketChat Webhook ] Field "'' + field +
                            ''" can\\''t be empty. The field ignored.'');
                    }
                    else {
                        try {
                            var parts = field.split('':''),
                                prefix = parts[0].split(''_'');

                            if (typeof prefix[2] === ''undefined''
                                    || (prefix[2] === ''p'' && params.event_value === ''1'')
                                    || (prefix[2] === ''r'' && params.event_value === ''0'')) {
                                data.push({
                                    title: field.substring(field.indexOf('':'') + 1),
                                    value: fields[field],
                                    short: prefix[1] === ''short''
                                });
                            }
                        }
                        catch (error) {
                            Zabbix.Log(4, ''[ RocketChat Webhook ] Can\\''t parse field "'' + field +
                                ''". The field ignored.'');
                        }
                    }
                });
        }

        return data;
    },

    request: function (method, query, data) {
        [''url'', ''api_url'', ''user_id'', ''user_token'', ''send_to''].forEach(function (field) {
            if (typeof RocketChat.params !== ''object'' || typeof RocketChat.params[field] === ''undefined''
                    || RocketChat.params[field] === '''' ) {
                throw ''Required parameter is not set: "'' + field + ''".'';
            }
        });

        var response,
            url = RocketChat.params.url + query,
            request = new CurlHttpRequest();

        request.AddHeader(''Content-Type: application/json'');
        request.AddHeader(''X-Auth-Token:'' + RocketChat.params.user_token);
        request.AddHeader(''X-User-Id:'' + RocketChat.params.user_id);

        if (typeof RocketChat.HTTPProxy !== ''undefined'' && RocketChat.HTTPProxy !== '''') {
            request.SetProxy(RocketChat.HTTPProxy);
        }

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        Zabbix.Log(4, ''[ RocketChat Webhook ] Sending request: '' + url +
            ((typeof data === ''string'') ? (''\\n'' + data) : ''''));

        switch (method) {
            case ''get'':
                response = request.Get(url, data);
                break;

            case ''post'':
                response = request.Post(url, data);
                break;

            default:
                throw ''Unsupported HTTP request method: '' + method;
        }

        Zabbix.Log(4, ''[ RocketChat Webhook ] Received response with status code '' +
            request.Status() + ''\\n'' + response);

        if (response !== null) {
            try {
                response = JSON.parse(response);
            }
            catch (error) {
                Zabbix.Log(4, ''[ RocketChat Webhook ] Failed to parse response received from RocketChat'');
                response = null;
            }
        }

        if (request.Status() < 200 || request.Status() >= 300) {
            var message = ''Request failed with status code '' + request.Status();

            if (response !== null && typeof response.message !== ''undefined'') {
                message += '': '' + JSON.stringify(response.message);
            }
            else if (response !== null && typeof response.error !== ''undefined'') {
                message += '': '' + JSON.stringify(response.error);
            }

            throw message + ''. Check debug log for more information.'';
        }

        return {
            status: request.Status(),
            response: response
        };
    },

    postMessage: function(use_default_message, message, fields) {
        var data = {
            channel: RocketChat.params.send_to,
            attachments: [{
                collapsed: false,
                color: RocketChat.params.color,
                title: params.alert_subject
            }]
        };

        if (RocketChat.params.title_link) {
            data.attachments[0].title_link = RocketChat.params.title_link;
        }

        if (use_default_message) {
            data.attachments[0].text = message;
        }
        else {
            data.attachments[0].fields = RocketChat.addFields(fields);
        }

        var result = RocketChat.request(''post'', ''chat.postMessage'', data);

        if (typeof result.response !== ''object'' || typeof result.response.message._id === ''undefined'') {
            throw ''Cannot send RocketChat message. Check debug log for more information.'';
        }

        return {
            id: result.response.message._id,
            rid: result.response.message.rid,
            channel: result.response.channel
        };
    },

    sendMessage: function(update, fields) {

        var data = {
            message: {
                rid: RocketChat.params.room_id,
                tmid: RocketChat.params.msg_id,
                tshow: true
            }
        };

        if (update.status === ''0'') {
            data.message.attachments = [{
                collapsed: false,
                color: RocketChat.params.color,
                title: params.alert_subject,
                title_link: RocketChat.params.title_link,
                fields: RocketChat.addFields(fields)
            }];
        }
        else {
            data.message.alias = update.user;
            data.message.msg = update.action;
            if (update.message) {
                data.message.attachments = [{
                    color: RocketChat.params.color,
                    text: update.message
                }];
            }
        }

        RocketChat.request(''post'', ''chat.sendMessage'', data);
    },

    getMessageLink: function(rid, id) {
        var room = RocketChat.request(''get'', ''rooms.info?roomId='' + encodeURIComponent(rid)),
            link = params.rc_url +
                (params.rc_url.endsWith(''/'') ? '''' : ''/'');

        switch (room.response.room.t) {
            case ''c'':
                link += ''channel/'' + room.response.room.name + ''?msg='' + id;
                break;

            case ''p'':
                link += ''group/'' + room.response.room.name + ''?msg='' + id;
                break;

            case ''d'':
                link += ''direct/'' + rid + ''?msg='' + id;
                break;

            default:
                Zabbix.Log(4, ''[ RocketChat Webhook ] Can\\''t get room type. Link to message will not be added.'');
        }

        return link;
    }
};

try {
    var params = JSON.parse(value),
        response,
        fields = {},
        rc = {},
        update = {},
        result = {tags: {}},
        required_params = [''alert_subject'', ''alert_message'', ''event_source'', ''event_value''],
        severities = [
            {name: ''not_classified'', color: ''#97AAB3''},
            {name: ''information'', color: ''#7499FF''},
            {name: ''warning'', color: ''#FFC859''},
            {name: ''average'', color: ''#FFA059''},
            {name: ''high'', color: ''#E97659''},
            {name: ''disaster'', color: ''#E45959''},
            {name: ''resolved'', color: ''#009900''},
            {name: ''default'', color: ''#000000''}
        ];

    Object.keys(params)
        .forEach(function (key) {
            if (key.startsWith(''rc_'')) {
                rc[key.substring(3)] = params[key];
            }
            else if (key.startsWith(''field_'')) {
                fields[key.substring(6)] = params[key];
            }
            else if (key.startsWith(''event_update_'')) {
                update[key.substring(13)] = params[key];
            }
            else if (required_params.indexOf(key) !== -1 && params[key] === '''') {
                throw ''Parameter "'' + key + ''" can\\''t be empty.'';
            }
        });

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: '' + params.event_source + ''\\nMust be 0-3.'';
    }

    // Forcing parameters for non trigger-based events.
    if (params.event_source !== ''0'') {
        params.use_default_message = ''true'';
        params.event_nseverity = ''0'';
        params.rc_title_link = false;
    }

    // Check {EVENT.VALUE} for trigger-based and internal events.
    if (params.event_value !== ''0'' && params.event_value !== ''1''
            && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    if (params.event_update_status !== ''0'' && params.event_update_status !== ''1'' && params.event_source === ''0'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''7'';
    }

    if (params.event_value === ''0'') {
        params.event_nseverity = ''6'';
    }

    RocketChat.setParams(rc);
    RocketChat.setProxy(params.HTTPProxy);
    RocketChat.params.color = severities[params.event_nseverity].color;

    // Send default message if use_default_message === true.
    if (params.use_default_message.toLowerCase() === ''true'') {
        response = RocketChat.postMessage(true, params.alert_message);
        result.tags.__zbx_rc_id = response.id;
        result.tags.__zbx_rc_rid = response.rid;
        result.tags.__zbx_rc_msg_url = RocketChat.getMessageLink(response.rid, response.id);
    }
    // Send message for trigger-based events.
    else if (params.event_value === ''1'' && update.status === ''0'') {
        response = RocketChat.postMessage(false, params.alert_message, fields);
        result.tags.__zbx_rc_id = response.id;
        result.tags.__zbx_rc_rid = response.rid;
        result.tags.__zbx_rc_msg_url = RocketChat.getMessageLink(response.rid, response.id);
    }
    // Send thread message for trigger-based event.
    else {
        RocketChat.sendMessage(update, fields);
    }

    return JSON.stringify(result);
}
catch (error) {
    Zabbix.Log(3, ''[ RocketChat Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','1','1','{EVENT.TAGS.__zbx_rc_msg_url}','Rocket.Chat','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('28','4','VictorOps','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var VictorOps = {
    params: {},

    setParams: function (params) {
        if (typeof params !== ''object'') {
            return;
        }

        VictorOps.params = params;
        if (VictorOps.params.endpoint) {
            if (!VictorOps.params.endpoint.endsWith(''/'')) {
                VictorOps.params.endpoint += ''/'';
            }

            if (typeof VictorOps.params.routing_key !== ''undefined''
                    && VictorOps.params.routing_key !== ''{ALERT.SENDTO}''
                    && VictorOps.params.routing_key !== ''Default'') {
                VictorOps.params.endpoint += VictorOps.params.routing_key;
            }
        }
    },

    setProxy: function (HTTPProxy) {
        VictorOps.HTTPProxy = HTTPProxy;
    },

    addFields: function (fields) {
        var data = {};

        if (typeof fields === ''object'') {
            Object.keys(fields)
                .forEach(function(field) {
                    if (fields[field] === '''') {
                        Zabbix.Log(4, ''[ VictorOps Webhook ] Field "'' + field +
                            ''" can\\''t be empty. The field ignored.'');
                    }
                    else {
                        try {
                            var parts = field.split('':''),
                                prefix = parts[0].split(''_'');

                            if (typeof prefix[1] === ''undefined''
                                    || (prefix[1] === ''p'' && params.event_value === ''1''
                                        && (params.event_update_status === ''0''
                                            || params.event_update_status === ''{EVENT.UPDATE.STATUS}''))
                                    || (prefix[1] === ''r'' && params.event_value === ''0''
                                        && (params.event_update_status === ''0''
                                            || params.event_update_status === ''{EVENT.UPDATE.STATUS}''))
                                    || (prefix[1] === ''u'' && params.event_update_status === ''1'')) {
                                data[field.substring(field.indexOf('':'') + 1)] = fields[field];
                            }
                        }
                        catch (error) {
                            Zabbix.Log(4, ''[ VictorOps Webhook ] Can\\''t parse field "'' + field +
                                ''". The field ignored.'');
                        }
                    }
                });
        }

        return data;
    },

    request: function (data) {
        if (typeof VictorOps.params !== ''object'' || typeof VictorOps.params.endpoint === ''undefined''
                || VictorOps.params.endpoint === '''' ) {
            throw ''Required parameter is not set: "vops_endpoint".'';
        }

        var response,
            url = VictorOps.params.endpoint,
            request = new CurlHttpRequest();

        request.AddHeader(''Content-Type: application/json'');

        if (typeof VictorOps.HTTPProxy !== ''undefined'' && VictorOps.HTTPProxy !== '''') {
            request.SetProxy(VictorOps.HTTPProxy);
        }

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        Zabbix.Log(4, ''[ VictorOps Webhook ] Sending request: '' + url +
            ((typeof data === ''string'') ? (''\\n'' + data) : ''''));

        response = request.Post(url, data);

        Zabbix.Log(4, ''[ VictorOps Webhook ] Received response with status code '' +
            request.Status() + ''\\n'' + response);

        if (response !== null) {
            try {
                response = JSON.parse(response);
            }
            catch (error) {
                Zabbix.Log(4, ''[ VictorOps Webhook ] Failed to parse response received from VictorOps'');
                response = null;
            }
        }

        if (request.Status() < 200 || request.Status() >= 300) {
            var message = ''Request failed with status code '' + request.Status();

            if (response !== null && typeof response.messages !== ''undefined'') {
                message += '': '' + JSON.stringify(response.messages);
            }

            throw message + ''. Check debug log for more information.'';
        }

        return response;
    }
};

try {
    var params = JSON.parse(value),
        fields = {},
        vops = {},
        required_params = [''event_source'', ''event_value'', ''priority_update''],
        severities = [
            {name: ''not_classified'', color: ''#97AAB3''},
            {name: ''information'', color: ''#7499FF''},
            {name: ''warning'', color: ''#FFC859''},
            {name: ''average'', color: ''#FFA059''},
            {name: ''high'', color: ''#E97659''},
            {name: ''disaster'', color: ''#E45959''},
            {name: ''resolved'', color: ''#009900''},
            {name: ''default'', color: ''#000000''}
        ];

    Object.keys(params)
        .forEach(function (key) {
            if (key.startsWith(''vops_'')) {
                vops[key.substring(5)] = params[key];
            }
            else if (key.startsWith(''field'')) {
                fields[key.substring(5)] = params[key];
            }
            else if (required_params.indexOf(key) !== -1 && params[key] === '''') {
                throw ''Parameter "'' + key + ''" can\\''t be empty.'';
            }
        });

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: '' + params.event_source + ''\\nMust be 0-3.'';
    }

    // Check {EVENT.VALUE} for trigger-based and internal events.
    if (params.event_value !== ''0'' && params.event_value !== ''1''
            && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    if (params.event_update_status !== ''0'' && params.event_update_status !== ''1'' && params.event_source === ''0'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''7'';
    }

    if (params.event_value === ''0'') {
        params.event_nseverity = ''6'';
    }

    if (params.event_update_status === ''1'') {
        fields['':message_type''] = params.priority_update;
    }
    else {
        fields['':message_type''] = params[''priority_'' + severities[params.event_nseverity].name]
            || ''INFO'';
    }

    if (params.event_info && params.event_source === ''0'') {
        fields['':event_info''] = params.event_info;
    }

    VictorOps.setParams(vops);
    VictorOps.setProxy(params.HTTPProxy);
    VictorOps.request(VictorOps.addFields(fields));

    return ''OK'';
}
catch (error) {
    Zabbix.Log(3, ''[ VictorOps Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','0','0','','','');

INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('30','4','Express.ms','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var Express = {
    params: [],

    setParams: function (params) {
        if (typeof params !== ''object'') {
            return;
        }

        Express.params = params;

        if (typeof Express.params.url === ''string'' && !Express.params.url.endsWith(''/'')) {
            Express.params.url += ''/'';
        }
    },

    setProxy: function (HTTPProxy) {
        Express.HTTPProxy = HTTPProxy;
    },

    request: function (query, data) {
        var response,
            url = Express.params.url + query,
            request = new CurlHttpRequest();

        request.AddHeader(''Content-Type: application/json'');
        request.AddHeader(''Authorization: Bearer '' + Express.params.token);

        if (typeof Express.HTTPProxy !== ''undefined'' && Express.HTTPProxy !== '''') {
            request.SetProxy(Express.HTTPProxy);
        }

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        Zabbix.Log(4, ''[ Express Webhook ] Sending request: '' + url +
            ((typeof data === ''string'') ? (''\\n'' + data) : ''''));

        response = request.Post(url, data);

        Zabbix.Log(4, ''[ Express Webhook ] Received response with status code '' +
            request.Status() + ''\\n'' + response);

        if (response !== null) {
            try {
                response = JSON.parse(response);
            }
            catch (error) {
                Zabbix.Log(4, ''[ Express Webhook ] Failed to parse response received from Express'');
                response = {};
            }
        }

        if (response.status !== ''ok'') {
            var message = ''Request failed with status code '' + request.Status();

            if (typeof response.reason !== ''undefined'') {
                message += '': '' + JSON.stringify(response.reason);
            }

            throw message + ''. Check debug log for more information.'';
        }

        return response.result;
    },

    postMessage: function (is_problem) {
        var data,
            url,
            result = {tags: {}},
            response;

        if (is_problem) {
            data = {
                group_chat_id: Express.params.send_to,
                notification: {
                    status: ''ok'',
                    body: Express.params.message
                }
            };
            url = ''api/v3/botx/notification/callback/direct'';
        }
        else {
            data = {
                reply: {
                    status: ''ok'',
                    body: Express.params.message
                }
            };
            url = ''api/v3/botx/events/reply_event'';

            try {
                var tags = JSON.parse(Express.params.tags);
            }
            catch (error) {
                throw ''Value of "express_tags" is not JSON. Value: '' + Express.params.tags + ''.'';
            }

            tags.forEach(function(tag) {
                if (tag.tag === ''__zbx_ex_sync_id_'' + Express.params.send_to) {
                    data.source_sync_id = tag.value;
                }
            });

            if (!data.source_sync_id) {
                throw ''Cannot update data. sync_id for the provided sender is unknown.'';
            }
        }

        response = Express.request(url, data);

        if (is_problem && response.sync_id) {
            result.tags[''__zbx_ex_sync_id_'' + Express.params.send_to] = response.sync_id;

            return JSON.stringify(result);
        }
        else {
            return ''OK'';
        }
    }
};

try {
    var params = JSON.parse(value),
        express = {},
        required_params = [
            ''express_url'', ''express_send_to'', ''express_message'', ''express_tags'', ''express_token'',
            ''event_source'', ''event_value'', ''event_update_status''
        ];

    Object.keys(params)
        .forEach(function (key) {
            if (key.startsWith(''express_'')) {
                express[key.substring(8)] = params[key];
            }

            if (required_params.indexOf(key) !== -1
                    && (params[key].trim() === '''' || params[key] === ''{ALERT.SENDTO}'')) {
                throw ''Parameter "'' + key + ''" can\\''t be empty.'';
            }
        });

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: '' + params.event_source + ''\\nMust be 0-3.'';
    }

    // Forcing event_value and event_update_status for non trigger-based events.
    if (params.event_source !== ''0'' ) {
        params.event_value = ''1'';
        params.event_update_status = ''0'';
    }

    if (params.event_value !== ''0'' && params.event_value !== ''1'') {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    if (params.event_update_status !== ''0'' && params.event_update_status !== ''1'' && params.event_source === ''0'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    Express.setParams(express);
    Express.setProxy(params.HTTPProxy);

    return Express.postMessage(params.event_value === ''1'' && params.event_update_status === ''0'');
}
catch (error) {
    Zabbix.Log(3, ''[ Express Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','1','0','','','');
INSERT INTO media_type (mediatypeid,type,name,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd,status,smtp_port,smtp_security,smtp_verify_peer,smtp_verify_host,smtp_authentication,exec_params,maxsessions,maxattempts,attempt_interval,content_type,script,timeout,process_tags,show_event_menu,event_menu_url,event_menu_name,description) values ('31','4','ManageEngine ServiceDesk','','','','','','','','0','25','0','0','0','0','','1','3','10s','1',E'var MEngine = {
    params: {},

    setParams: function (params) {
        if (typeof params !== ''object'') {
            return;
        }

        MEngine.params = params;
        if (typeof MEngine.params.url === ''string'') {
            if (!MEngine.params.url.endsWith(''/'')) {
                MEngine.params.url += ''/'';
            }

            MEngine.params.url += ''api/v3/'';
        }

        if (MEngine.params.on_premise.toLowerCase() !== ''true''
                && typeof MEngine.params.on_demand_url_auth === ''string'') {
            if (!MEngine.params.on_demand_url_auth.endsWith(''/'')) {
                MEngine.params.on_demand_url_auth += ''/'';
            }

            MEngine.params.on_demand_url_auth += ''oauth/v2/token?'';
        }
    },

    setProxy: function (HTTPProxy) {
        MEngine.HTTPProxy = HTTPProxy;
    },

    createLink: function (id, url) {
        return url + (url.endsWith(''/'') ? '''' : ''/'') +
            ((MEngine.params.on_premise.toLowerCase() === ''true'')
                ? (''WorkOrder.do?woMode=viewWO&woID='' + id)
                : (''app/itdesk/ui/requests/'' + id + ''/details'')
            );
    },

    refreshAccessToken: function () {
        [
            ''on_demand_url_auth'',
            ''on_demand_refresh_token'',
            ''on_demand_client_id'',
            ''on_demand_client_secret''
        ].forEach(function (field) {
            if (typeof MEngine.params !== ''object'' || typeof MEngine.params[field] === ''undefined''
                    || MEngine.params[field].trim() === '''' ) {
                throw ''Required MEngine param is not set: "sd_'' + field + ''".'';
            }
        });

        var response,
            request = new CurlHttpRequest(),
            url = MEngine.params.on_demand_url_auth +
                ''refresh_token='' + encodeURIComponent(MEngine.params.on_demand_refresh_token) +
                ''&grant_type=refresh_token&client_id='' + encodeURIComponent(MEngine.params.on_demand_client_id) +
                ''&client_secret='' + encodeURIComponent(MEngine.params.on_demand_client_secret) +
                ''&redirect_uri=https://www.zoho.com&scope=SDPOnDemand.requests.ALL'';

        if (MEngine.HTTPProxy) {
            request.SetProxy(MEngine.HTTPProxy);
        }

        Zabbix.Log(4, ''[ ManageEngine Webhook ] Refreshing access token. Request: '' + url);

        response = request.Post(url);

        Zabbix.Log(4, ''[ ManageEngine Webhook ] Received response with status code '' +
        request.Status() + ''\\n'' + response);

        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, ''[ ManageEngine Webhook ] Failed to parse response received from Zoho Accounts'');
        }

        if ((request.Status() < 200 || request.Status() >= 300) && !response.access_token) {
            throw ''Access token refresh failed with HTTP status code '' + request.Status() +
                ''. Check debug log for more information.'';
        }
        else {
            MEngine.params.on_demand_auth_token = response.access_token;
        }
    },

    request: function (method, query, data) {
        var response,
            url = MEngine.params.url + query,
            input,
            request = new CurlHttpRequest(),
            message;

        if (MEngine.params.on_premise.toLowerCase() === ''true'') {
            request.AddHeader(''TECHNICIAN_KEY: '' + MEngine.params.on_premise_auth_token);
        }
        else {
            request.AddHeader(''Authorization: Zoho-oauthtoken '' + MEngine.params.on_demand_auth_token);
            request.AddHeader(''Accept: application/v3+json'');
        }

        if (MEngine.HTTPProxy) {
            request.SetProxy(MEngine.HTTPProxy);
        }

        if (typeof data !== ''undefined'') {
            data = JSON.stringify(data);
        }

        input = ''input_data='' + encodeURIComponent(data);
        Zabbix.Log(4, ''[ ManageEngine Webhook ] Sending request: '' + url + ''?'' + input);

        switch (method) {
            case ''post'':
                response = request.Post(url, input);
                break;

            case ''put'':
                response = request.Put(url, input);
                break;

            default:
                throw ''Unsupported HTTP request method: '' + method;
        }

        Zabbix.Log(4, ''[ ManageEngine Webhook ] Received response with status code '' +
            request.Status() + ''\\n'' + response);

        try {
            response = JSON.parse(response);
        }
        catch (error) {
            Zabbix.Log(4, ''[ ManageEngine Webhook ] Failed to parse response received from ManageEngine'');
        }

        if ((request.Status() < 200 || request.Status() >= 300)
                && typeof response.response_status !== ''object'') {
            throw ''Request failed with HTTP status code '' + request.Status() +
                ''. Check debug log for more information.'';
        }
        else if (typeof response.response_status === ''object'' && response.response_status.status === ''failed'') {
            message = ''Request failed with status_code '';

            if (typeof response.response_status.messages === ''object''
                    && response.response_status.messages[0]
                    && response.response_status.messages[0].message) {
                message += response.response_status.messages[0].status_code +
                    ''. Message: '' + response.response_status.messages[0].message;
            }
            else {
                message += response.response_status.status_code;
            }

            message += ''. Check debug log for more information.'';
            throw message;
        }
        else if (response.request) {
            return response.request.id;
        }
    },

    createPaylaod: function (fields, isNote) {
        var data = {},
            result;

        if (isNote) {
            data.description = fields[''field_string:description''].replace(/(?:\\r\\n|\\r|\\n)/g, ''<br>'');
            result = {request_note: data};
        }
        else {
            Object.keys(fields)
                .forEach(function(field) {
                    if (fields[field].trim() === '''') {
                        Zabbix.Log(4, ''[ ManageEngine Webhook ] Field "'' + field +
                            ''" can\\''t be empty. The field ignored.'');
                    }
                    else {
                        try {
                            var prefix = field.split('':'')[0],
                                root;

                            if  (prefix.startsWith(''udf_'') && !data.udf_fields) {
                                data.udf_fields = {};
                                root = data.udf_fields;
                            }
                            else if (prefix.startsWith(''udf_'')) {
                                root = data.udf_fields;
                            }
                            else {
                                root = data;
                            }

                            if (prefix.endsWith(''string'')) {
                                root[field.substring(field.indexOf('':'') + 1)
                                    .toLowerCase()] = fields[field];
                            }
                            else {
                                root[field.substring(field.indexOf('':'') + 1)
                                    .toLowerCase()] = {
                                    name: fields[field]
                                };
                            }
                        }
                        catch (error) {
                            Zabbix.Log(4, ''[ ManageEngine Webhook ] Can\\''t parse field "'' + field +
                                ''". The field ignored.'');
                        }
                    }
                });
            if (data.description) {
                data.description = data.description.replace(/(?:\\r\\n|\\r|\\n)/g, ''<br>'');
            }

            result = {request: data};
        }

        return result;
    }
};

try {
    var params = JSON.parse(value),
        fields = {},
        sd = {},
        result = {tags: {}},
        required_params = [
            ''sd_on_premise'', ''field_string:subject'', ''field_string:description'',
            ''event_recovery_value'', ''event_source'', ''event_value'', ''event_update_status''
        ],
        severities = [
            {name: ''not_classified'', color: ''#97AAB3''},
            {name: ''information'', color: ''#7499FF''},
            {name: ''warning'', color: ''#FFC859''},
            {name: ''average'', color: ''#FFA059''},
            {name: ''high'', color: ''#E97659''},
            {name: ''disaster'', color: ''#E45959''},
            {name: ''default'', color: ''#000000''}
        ];

    Object.keys(params)
        .forEach(function (key) {
            if (key.startsWith(''sd_'')) {
                sd[key.substring(3)] = params[key];
            }
            else if (key.startsWith(''field_'') || key.startsWith(''udf_field_'')) {
                fields[key] = params[key];
            }

            if (required_params.indexOf(key) !== -1 && params[key].trim() === '''') {
                throw ''Parameter "'' + key + ''" can\\''t be empty.'';
            }
        });

    if ([0, 1, 2, 3].indexOf(parseInt(params.event_source)) === -1) {
        throw ''Incorrect "event_source" parameter given: '' + params.event_source + ''\\nMust be 0-3.'';
    }

    // Check {EVENT.VALUE} for trigger-based and internal events.
    if (params.event_value !== ''0'' && params.event_value !== ''1''
        && (params.event_source === ''0'' || params.event_source === ''3'')) {
        throw ''Incorrect "event_value" parameter given: '' + params.event_value + ''\\nMust be 0 or 1.'';
    }

    // Check {EVENT.UPDATE.STATUS} only for trigger-based events.
    if (params.event_update_status !== ''0'' && params.event_update_status !== ''1'' && params.event_source === ''0'') {
        throw ''Incorrect "event_update_status" parameter given: '' + params.event_update_status + ''\\nMust be 0 or 1.'';
    }

    if (params.event_source !== ''0'' && params.event_recovery_value === ''0'') {
        throw ''Recovery operations are supported only for trigger-based actions.'';
    }

    if ([0, 1, 2, 3, 4, 5].indexOf(parseInt(params.event_nseverity)) === -1) {
        params.event_nseverity = ''6'';
    }

    if (params.event_update_status === ''1'' && (typeof params.sd_request_id === ''undefined''
            || params.sd_request_id.trim() === ''''
            || params.sd_request_id === ''{EVENT.TAGS.__zbx_sd_request_id}'')) {
        throw ''Parameter "sd_request_id" can\\''t be empty for update operation.'';
    }

    MEngine.setParams(sd);
    MEngine.setProxy(params.HTTPProxy);

    if (MEngine.params.on_premise.toLowerCase() !== ''true'') {
        MEngine.refreshAccessToken();
    }

    // Create issue for non trigger-based events.
    if (params.event_source !== ''0'' && params.event_recovery_value !== ''0'') {
        fields[''field_object:priority''] = params[''priority_'' + severities[params.event_nseverity].name]
        || ''Normal'';

        MEngine.request(''post'', ''requests'', MEngine.createPaylaod(fields));
    }
    // Create issue for trigger-based events.
    else if (params.event_value === ''1'' && params.event_update_status === ''0'') {
        fields[''field_object:priority''] = params[''priority_'' + severities[params.event_nseverity].name]
        || ''Normal'';

        var id = MEngine.request(''post'', ''requests'', MEngine.createPaylaod(fields));

        result.tags.__zbx_sd_request_id = id;
        result.tags.__zbx_sd_request_link = MEngine.createLink(id, params.sd_url);
    }
    // Update created issue for trigger-based event.
    else {
        if (params.event_update_status === ''1'') {
            MEngine.request(''post'', ''requests/'' + params.sd_request_id + ''/notes'',
                MEngine.createPaylaod(fields, true)
            );
        }
        delete fields[''field_string:description''];
        MEngine.request(''put'', ''requests/'' + params.sd_request_id, MEngine.createPaylaod(fields));
    }

    return JSON.stringify(result);
}
catch (error) {
    Zabbix.Log(3, ''[ ManageEngine Webhook ] ERROR: '' + error);
    throw ''Sending failed: '' + error;
}','30s','1','1','{EVENT.TAGS.__zbx_sd_request_link}','ManageEngine: {EVENT.TAGS.__zbx_sd_request_id}','');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('1','5','zabbix_url','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('2','5','bot_token','<YOUR BOT TOKEN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('3','5','mattermost_url','<YOUR MATTERMOST URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('4','5','send_mode','alarm');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('5','5','send_to','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('6','5','event_tags','{EVENT.TAGS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('8','5','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('10','5','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('11','5','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('12','5','event_date','{EVENT.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('13','5','event_time','{EVENT.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('14','5','event_severity','{EVENT.SEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('15','5','event_opdata','{EVENT.OPDATA}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('16','5','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('18','5','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('19','5','trigger_description','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('20','5','host_name','{HOST.HOST}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('21','5','host_ip','{HOST.IP}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('22','5','event_update_date','{EVENT.UPDATE.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('23','5','event_update_time','{EVENT.UPDATE.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('24','5','event_recovery_date','{EVENT.RECOVERY.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('25','5','event_recovery_time','{EVENT.RECOVERY.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('37','6','zbxurl','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('39','7','token','<put your key>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('40','7','eventid','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('41','7','eventname','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('42','7','hostname','{HOST.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('43','7','hostip','{HOST.IP}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('44','7','severity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('45','7','triggerdesc','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('46','7','triggeropdata','{EVENT.OPDATA}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('47','7','eventtags','{EVENT.TAGS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('48','7','triggerid','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('49','7','eventdate','{EVENT.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('50','7','eventtime','{EVENT.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('52','7','eventack','{EVENT.ACK.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('53','7','eventupdate','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('54','7','eventvalue','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('55','7','url','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('56','8','token','<PUSHOVER TOKEN HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('57','8','user','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('58','8','message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('59','8','title','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('60','8','url','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('61','8','url_title','Zabbix');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('63','8','eventid','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('64','8','triggerid','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('65','9','zabbix_url','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('66','9','bot_token','<PLACE YOUR KEY HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('67','9','channel','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('68','9','slack_mode','alarm');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('69','9','slack_as_user','true');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('71','9','event_tags','{EVENT.TAGSJSON}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('73','9','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('75','9','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('76','9','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('77','9','event_date','{EVENT.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('78','9','event_time','{EVENT.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('79','9','event_severity','{EVENT.SEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('80','9','event_opdata','{EVENT.OPDATA}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('81','9','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('83','9','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('84','9','trigger_description','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('85','9','host_name','{HOST.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('87','9','event_update_date','{EVENT.UPDATE.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('88','9','event_update_time','{EVENT.UPDATE.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('89','9','event_recovery_date','{EVENT.RECOVERY.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('90','9','event_recovery_time','{EVENT.RECOVERY.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('91','10','zabbix_url','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('92','10','discord_endpoint','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('93','10','use_default_message','false');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('94','10','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('95','10','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('96','10','event_name','{EVENT.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('97','10','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('98','10','event_severity','{EVENT.SEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('99','10','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('100','10','event_opdata','{EVENT.OPDATA}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('101','10','event_tags','{EVENT.TAGS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('102','10','event_time','{EVENT.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('103','10','event_date','{EVENT.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('104','10','event_recovery_date','{EVENT.RECOVERY.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('105','10','event_recovery_time','{EVENT.RECOVERY.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('106','10','event_update_date','{EVENT.UPDATE.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('107','10','event_update_time','{EVENT.UPDATE.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('108','10','event_update_action','{EVENT.UPDATE.ACTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('109','10','event_update_message','{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('110','10','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('111','10','event_update_user','{USER.FULLNAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('112','10','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('113','10','host_ip','{HOST.IP}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('114','10','host_name','{HOST.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('115','10','trigger_description','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('116','10','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('117','8','endpoint','https://api.pushover.net/1/messages.json');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('118','8','retry','60');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('119','8','expire','1200');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('120','11','teamsecret','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('121','11','Subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('122','11','Message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('123','11','Severity','{EVENT.SEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('125','11','Hostname','{HOST.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('127','12','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('128','12','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('129','12','event_recovery_value','{EVENT.RECOVERY.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('130','12','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('131','12','event_tags_json','{EVENT.TAGSJSON}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('132','12','event_update_action','{EVENT.UPDATE.ACTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('133','12','event_update_message','{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('134','12','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('135','12','event_update_user','{USER.FULLNAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('136','12','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('137','12','jira_issue_key','{EVENT.TAGS.__zbx_jira_issuekey}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('138','12','jira_issue_type','<PLACE ISSUETYPE NAME>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('139','12','jira_password','<PLACE PASSWORD OR TOKEN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('140','12','jira_project_key','<PLACE PROJECT KEY>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('141','12','jira_url','<PLACE YOUR JIRA URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('142','12','jira_user','<PLACE LOGIN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('143','12','trigger_description','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('144','13','<''DATETIME'' CUSTOMFIELD FOR EVENT RECOVERY TIME>','{EVENT.RECOVERY.DATE}T{EVENT.RECOVERY.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('145','13','<''DATETIME'' CUSTOMFIELD FOR EVENT TIME>','{EVENT.DATE}T{EVENT.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('146','13','<''NUMBER'' CUSTOMFIELD FOR EVENT.ID>','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('147','13','<''NUMBER'' CUSTOMFIELD FOR TRIGGER.ID>','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('148','13',E'<''STRING'' CUSTOMFIELD FOR HOST\\IP>','{HOST.HOST} [{HOST.IP}]');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('149','13','<''STRING'' CUSTOMFIELD FOR OPERATIONAL DATA>','{EVENT.OPDATA}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('150','13','<''STRING'' CUSTOMFIELD FOR SEVERITY>','{EVENT.SEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('151','13','<''URL'' CUSTOMFIELD FOR EVENT URL>','{$ZABBIX.URL}/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('152','13','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('153','13','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('154','13','event_recovery_value','{EVENT.RECOVERY.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('155','13','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('156','13','event_tags_json','{EVENT.TAGSJSON}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('157','13','event_update_action','{EVENT.UPDATE.ACTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('158','13','event_update_message','{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('159','13','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('160','13','event_update_user','{USER.FULLNAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('161','13','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('162','13','jira_issue_key','{EVENT.TAGS.__zbx_jira_issuekey}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('163','13','jira_issue_type','<PLACE ISSUETYPE NAME>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('164','13','jira_password','<PLACE PASSWORD OR TOKEN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('165','13','jira_project_key','<PLACE PROJECT KEY>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('166','13','jira_url','<PLACE YOUR JIRA URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('167','13','jira_user','<PLACE LOGIN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('168','13','trigger_description','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('169','14','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('170','14','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('171','14','event_date','{EVENT.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('172','14','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('173','14','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('174','14','event_opdata','{EVENT.OPDATA}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('175','14','event_recovery_date','{EVENT.RECOVERY.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('176','14','event_recovery_time','{EVENT.RECOVERY.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('177','14','event_severity','{EVENT.SEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('178','14','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('179','14','event_status','{EVENT.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('180','14','event_tags','{EVENT.TAGS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('181','14','event_time','{EVENT.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('182','14','event_update_action','{EVENT.UPDATE.ACTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('183','14','event_update_date','{EVENT.UPDATE.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('184','14','event_update_message','{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('185','14','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('186','14','event_update_time','{EVENT.UPDATE.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('187','14','event_update_user','{USER.FULLNAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('188','14','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('189','14','host_ip','{HOST.IP}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('190','14','host_name','{HOST.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('191','14','teams_endpoint','<PLACE WEBHOOK URL HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('192','14','trigger_description','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('193','14','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('194','14','use_default_message','false');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('195','14','zabbix_url','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('196','15','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('197','15','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('198','15','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('199','15','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('200','15','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('201','15','event_update_message','{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('202','15','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('203','15','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('204','15','redmine_access_key','<PUT YOUR ACCESS KEY>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('205','15','redmine_issue_key','{EVENT.TAGS.__zbx_redmine_issue_id}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('206','15','redmine_project','<PUT YOUR PROJECT ID OR NAME>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('207','15','redmine_tracker_id','<PUT YOUR TRACKER ID>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('208','15','redmine_url','<PUT YOUR REDMINE URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('209','15','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('210','15','zabbix_url','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('211','16','Message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('212','16','ParseMode','');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('213','16','Subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('214','16','To','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('215','16','Token','<PLACE YOUR TOKEN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('216','17','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('217','17','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('218','17','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('219','17','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('220','17','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('221','17','event_tags','{EVENT.TAGS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('222','17','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('223','17','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('224','17','severity_average','normal');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('225','17','severity_default','-');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('226','17','severity_disaster','urgent');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('227','17','severity_high','high');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('228','17','severity_information','low');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('229','17','severity_not_classified','low');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('230','17','severity_warning','normal');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('231','17','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('232','17','zbxurl','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('233','17','zendesk_issue_key','{EVENT.TAGS.__zbx_zdk_issuekey}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('234','17','zendesk_token','<put your {enduser_email_address}/token:{api_token}>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('235','17','zendesk_type','incident');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('236','17','zendesk_url','<put your Zendesk URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('237','18','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('238','18','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('239','18','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('240','18','event_recovery_value','{EVENT.RECOVERY.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('241','18','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('242','18','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('243','18','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('244','18','servicenow_password','<PLACE PASSWORD HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('245','18','servicenow_sys_id','{EVENT.TAGS.__zbx_servicenow_sys_id}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('246','18','servicenow_url','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('247','18','servicenow_user','<PLACE USERNAME HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('248','18','urgency_for_average','2');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('249','18','urgency_for_disaster','1');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('250','18','urgency_for_high','2');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('251','18','urgency_for_information','3');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('252','18','urgency_for_not_classified','3');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('253','18','urgency_for_warning','3');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('254','19','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('255','19','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('256','19','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('257','19','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('258','19','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('259','19','event_tags','{EVENT.TAGSJSON}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('260','19','event_update_message','{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('261','19','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('262','19','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('263','19','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('264','19','zabbix_url','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('265','19','zammad_access_token','<PUT YOUR ACCESS TOKEN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('266','19','zammad_customer','<PUT YOUR CUSTOMER EMAIL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('267','19','zammad_enable_tags','true');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('268','19','zammad_ticket_id','{EVENT.TAGS.__zbx_zammad_ticket_id}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('269','19','zammad_url','<PUT YOUR ZAMMAD URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('270','20','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('271','20','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('272','20','event_recovery_value','{EVENT.RECOVERY.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('273','20','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('274','20','event_tags_json','{EVENT.TAGSJSON}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('275','20','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('276','20','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('277','20','jira_password','<PLACE PASSWORD OR TOKEN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('278','20','jira_request_key','{EVENT.TAGS.__zbx_jira_requestkey}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('279','20','jira_request_type_id','<PLACE REQUEST TYPE ID>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('280','20','jira_servicedesk_id','<PLACE SERVICEDESK ID>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('281','20','jira_url','<PLACE YOUR JIRA URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('282','20','jira_user','<PLACE LOGIN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('283','21','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('284','21','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('285','21','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('286','21','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('287','21','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('288','21','event_update_message','{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('289','21','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('290','21','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('291','21','otrs_auth_password','<PUT YOUR USER PASSWORD>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('292','21','otrs_auth_user','<PUT YOUR USER NAME>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('293','21','otrs_customer','<PUT YOUR CUSTOMER EMAIL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('294','21','otrs_default_priority_id','3');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('295','21','otrs_queue','<PUT YOUR QUEUE NAME>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('296','21','otrs_ticket_id','{EVENT.TAGS.__zbx_otrs_ticket_id}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('297','21','otrs_ticket_state','new');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('298','21','otrs_time_unit','0');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('299','21','otrs_url','<PUT YOUR OTRS URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('300','21','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('301','21','zabbix_url','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('302','11','Event_Ack_Status','{EVENT.ACK.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('303','11','Event_Date_Time','{EVENT.DATE} {EVENT.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('304','11','Event_ID','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('305','11','Event_Update_Action','{EVENT.UPDATE.ACTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('306','11','Event_Update_Status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('307','11','Host_IP','{HOST.IP}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('308','11','Trigger_ID','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('309','11','Trigger_Status','{TRIGGER.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('310','11','User','{USER.FULLNAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('311','11','Zabbix_URL','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('312','10','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('313','22','.ILERT.ALERT.SOURCE.KEY','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('314','22','.ILERT.INCIDENT.SUMMARY','');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('315','22','ALERT.MESSAGE','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('316','22','ALERT.SUBJECT','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('317','22','EVENT.ACK.STATUS','{EVENT.ACK.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('318','22','EVENT.DATE','{EVENT.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('319','22','EVENT.ID','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('320','22','EVENT.NAME','{EVENT.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('321','22','EVENT.NSEVERITY','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('322','22','EVENT.OPDATA','{EVENT.OPDATA}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('323','22','EVENT.RECOVERY.DATE','{EVENT.RECOVERY.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('324','22','EVENT.RECOVERY.TIME','{EVENT.RECOVERY.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('325','22','EVENT.RECOVERY.VALUE','{EVENT.RECOVERY.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('326','22','EVENT.SEVERITY','{EVENT.SEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('327','22','EVENT.TAGS','{EVENT.TAGS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('328','22','EVENT.TIME','{EVENT.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('329','22','EVENT.UPDATE.ACTION','{EVENT.UPDATE.ACTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('330','22','EVENT.UPDATE.DATE','{EVENT.UPDATE.DATE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('331','22','EVENT.UPDATE.MESSAGE','{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('332','22','EVENT.UPDATE.STATUS','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('333','22','EVENT.UPDATE.TIME','{EVENT.UPDATE.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('334','22','EVENT.VALUE','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('335','22','HOST.HOST','{HOST.HOST}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('336','22','HOST.IP','{HOST.IP}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('337','22','HOST.NAME','{HOST.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('338','22','ITEM.ID1','{ITEM.ID1}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('339','22','ITEM.ID2','{ITEM.ID2}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('340','22','ITEM.ID3','{ITEM.ID3}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('341','22','ITEM.ID4','{ITEM.ID4}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('342','22','ITEM.ID5','{ITEM.ID5}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('343','22','ITEM.NAME1','{ITEM.NAME1}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('344','22','ITEM.NAME2','{ITEM.NAME2}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('345','22','ITEM.NAME3','{ITEM.NAME3}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('346','22','ITEM.NAME4','{ITEM.NAME4}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('347','22','ITEM.NAME5','{ITEM.NAME5}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('348','22','TRIGGER.DESCRIPTION','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('349','22','TRIGGER.ID','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('350','22','TRIGGER.NAME','{TRIGGER.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('351','22','TRIGGER.SEVERITY','{TRIGGER.SEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('352','22','TRIGGER.STATUS','{TRIGGER.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('353','22','TRIGGER.URL','{TRIGGER.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('354','22','TRIGGER.VALUE','{TRIGGER.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('355','22','USER.FULLNAME','{USER.FULLNAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('356','22','ZABBIX.URL','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('357','5','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('358','5','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('359','5','discovery_host_dns','{DISCOVERY.DEVICE.DNS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('360','5','discovery_host_ip','{DISCOVERY.DEVICE.IPADDRESS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('361','5','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('362','6','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('363','6','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('364','6','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('365','6','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('366','6','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('367','6','event_tags_json','{EVENT.TAGSJSON}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('368','6','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('369','6','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('370','6','opsgenie_api','<put your opsgenie api>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('371','6','opsgenie_tags','');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('372','6','opsgenie_teams','');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('373','6','opsgenie_token','<put your token>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('374','6','opsgenie_web','<put your opsgenie web>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('375','6','severity_average','P3');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('376','6','severity_default','P5');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('377','6','severity_disaster','P1');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('378','6','severity_high','P2');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('379','6','severity_information','P5');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('380','6','severity_not_classified','P5');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('381','6','severity_warning','P4');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('382','6','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('383','6','zbxuser','{USER.FULLNAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('384','7','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('385','7','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('386','8','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('387','8','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('388','8','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('389','8','priority_average','0');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('390','8','priority_default','0');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('391','8','priority_disaster','0');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('392','8','priority_high','0');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('393','8','priority_information','0');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('394','8','priority_not_classified','0');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('395','8','priority_warning','0');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('396','9','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('397','9','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('398','9','discovery_host_dns','{DISCOVERY.DEVICE.DNS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('399','9','discovery_host_ip','{DISCOVERY.DEVICE.IPADDRESS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('400','9','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('401','9','host_conn','{HOST.CONN}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('402','23','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('403','23','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('404','23','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('405','23','event_recovery_value','{EVENT.RECOVERY.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('406','23','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('407','23','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('408','23','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('409','23','priority_average','Medium');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('410','23','priority_default','Low');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('411','23','priority_disaster','Critical');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('412','23','priority_high','High');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('413','23','samanage_incident_id','{EVENT.TAGS.__zbx_solarwinds_inc_id}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('414','23','samanage_token','<PUT YOUR TOKEN HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('415','23','samanage_url','<PUT YOUR INSTANCE URL HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('416','24','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('417','24','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('418','24','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('419','24','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('420','24','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('421','24','event_update_message','{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('422','24','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('423','24','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('424','24','sysaid_auth_password','<PUT YOUR USER PASSWORD>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('425','24','sysaid_auth_user','<PUT YOUR USER NAME>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('426','24','sysaid_category_level_1','<PUT YOUR CATEGORY>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('427','24','sysaid_category_level_2','<PUT YOUR SUB-CATEGORY>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('428','24','sysaid_category_level_3','<PUT YOUR THIRD LEVEL CATEGORY>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('429','24','sysaid_default_priority_id','1');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('430','24','sysaid_incident_id','{EVENT.TAGS.__zbx_sysaid_incident_id}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('431','24','sysaid_incident_state','1');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('432','24','sysaid_template_id','<PUT YOUR TEMPLATE ID>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('433','24','sysaid_urgency_id','<PUT YOUR URGENCY ID>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('434','24','sysaid_url','<PUT YOUR SYSAID URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('435','24','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('436','24','zabbix_url','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('437','25','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('438','25','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('439','25','event_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('440','25','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('441','25','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('442','25','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('443','25','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('444','25','severity_average','P3');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('445','25','severity_default','P5');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('446','25','severity_disaster','P1');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('447','25','severity_high','P2');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('448','25','severity_information','P5');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('449','25','severity_not_classified','P5');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('450','25','severity_warning','P4');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('451','25','topdesk_api','<put your TOPdesk API URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('452','25','topdesk_issue_key','{EVENT.TAGS.__zbx_tpd_issuekey}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('453','25','topdesk_password','<put your TOPdesk application password>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('454','25','topdesk_status','<put default status for new tickets>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('455','25','topdesk_user','<put your TOPdesk username>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('456','25','trigger_id','{TRIGGER.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('457','25','zbxurl','{$ZABBIX.URL}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('458','26','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('459','26','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('460','26','event_recovery_value','{EVENT.RECOVERY.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('461','26','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('462','26','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('463','26','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('464','26','itop_api_version','1.3');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('465','26','itop_class','UserRequest');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('466','26','itop_comment','Created by Zabbix action {ACTION.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('467','26','itop_id','{EVENT.TAGS.__zbx_itop_id}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('468','26','itop_log','private_log');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('469','26','itop_organization_id','<PLACE ORGANIZATION ID>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('470','26','itop_password','<PLACE PASSWORD OR TOKEN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('471','26','itop_url','<PLACE YOUR ITOP URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('472','26','itop_user','<PLACE LOGIN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('473','27','alert_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('474','27','alert_subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('475','27','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('476','27','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('477','27','event_update_action','{EVENT.UPDATE.ACTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('478','27','event_update_message','{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('479','27','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('480','27','event_update_user','{USER.FULLNAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('481','27','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('482','27','field_1_full:Host','{HOST.NAME} [{HOST.IP}]');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('483','27','field_2_short:Severity','{EVENT.SEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('484','27','field_3_short:Event time','{EVENT.DATE} {EVENT.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('485','27','field_3_short_r:Recovery time','{EVENT.RECOVERY.DATE} {EVENT.RECOVERY.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('486','27','field_4_short_r:Event duration','{EVENT.DURATION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('487','27','field_5_short:Operational data','{EVENT.OPDATA}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('488','27','field_999_full_p:Trigger description','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('489','27','rc_api_url','api/v1/');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('490','27','rc_msg_id','{EVENT.TAGS.__zbx_rc_id}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('491','27','rc_room_id','{EVENT.TAGS.__zbx_rc_rid}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('492','27','rc_send_to','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('493','27','rc_title_link','{$ZABBIX.URL}/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('494','27','rc_url','<PLACE YOUR INSTANCE URL HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('495','27','rc_user_id','<PLACE USER ID HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('496','27','rc_user_token','<PLACE TOKEN HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('497','27','use_default_message','false');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('498','28','event_info','{$ZABBIX.URL}/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('499','28','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('500','28','event_recovery_value','{EVENT.RECOVERY.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('501','28','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('502','28','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('503','28','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('504','28','field:entity_display_name','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('505','28','field:entity_id','{EVENT.ID}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('506','28','field:hostname','{HOST.NAME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('507','28','field:monitoring_tool','Zabbix');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('508','28','field:operational_data','{EVENT.OPDATA}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('509','28','field:severity','{EVENT.SEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('510','28','field:state_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('511','28','field_p:trigger_description','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('512','28','field_r:event_duration','{EVENT.DURATION}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('513','28','field_r:recovery time','{EVENT.RECOVERY.DATE} {EVENT.RECOVERY.TIME}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('514','28','priority_average','WARNING');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('515','28','priority_default','INFO');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('516','28','priority_disaster','CRITICAL');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('517','28','priority_high','WARNING');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('518','28','priority_information','INFO');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('519','28','priority_not_classified','INFO');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('520','28','priority_resolved','OK');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('521','28','priority_update','INFO');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('522','28','priority_warning','INFO');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('523','28','vops_endpoint','<PLACE ENDPOINT URL HERE>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('524','28','vops_routing_key','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('525','29','endpoint','<PLACE HTTP API URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('526','29','flash','false');

INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('528','29','ring','false');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('529','29','send_to','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('530','29','telauto','true');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('531','29','text','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('532','29','username','<PLACE USERNAME>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('535','30','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('536','30','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('537','30','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('538','30','express_message','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('539','30','express_send_to','{ALERT.SENDTO}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('540','30','express_tags','{EVENT.TAGSJSON}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('541','30','express_token','<PLACE BOT TOKEN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('542','30','express_url','<PLACE INSTANCE URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('543','31','event_nseverity','{EVENT.NSEVERITY}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('544','31','event_recovery_value','{EVENT.RECOVERY.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('545','31','event_source','{EVENT.SOURCE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('546','31','event_update_status','{EVENT.UPDATE.STATUS}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('547','31','event_value','{EVENT.VALUE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('548','31','field_ref:requester','<PLACE API USER NAME>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('549','31','field_string:description','{ALERT.MESSAGE}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('550','31','field_string:subject','{ALERT.SUBJECT}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('551','31','priority_average','Normal');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('552','31','priority_default','Normal');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('553','31','priority_disaster','High');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('554','31','priority_high','High');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('555','31','priority_information','Low');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('556','31','priority_not_classified','Low');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('557','31','priority_warning','Medium');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('558','31','sd_on_demand_client_id','<PLACE ON DEMAND CLIENT ID>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('559','31','sd_on_demand_client_secret','<PLACE ON DEMAND CLIENT SECRET>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('560','31','sd_on_demand_refresh_token','<PLACE ON DEMAND REFRESH TOKEN>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('561','31','sd_on_demand_url_auth','<PLACE AUTHENTICATION URL FOR ON DEMAND>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('562','31','sd_on_premise','true');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('563','31','sd_on_premise_auth_token','<PLACE ON PREMISE TECHNICIAN_KEY>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('564','31','sd_request_id','{EVENT.TAGS.__zbx_sd_request_id}');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('565','31','sd_url','<PLACE INSTANCE URL>');
INSERT INTO media_type_param (mediatype_paramid,mediatypeid,name,value) values ('566','31','trigger_description','{TRIGGER.DESCRIPTION}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('1','1','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('2','1','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Problem duration: {EVENT.DURATION}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('3','1','0','2','Updated problem in {EVENT.AGE}: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, age is {EVENT.AGE}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('4','1','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('5','1','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('6','3','0','0','','{EVENT.SEVERITY}: {EVENT.NAME}
Host: {HOST.NAME}
{EVENT.DATE} {EVENT.TIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('7','3','0','1','','Resolved in {EVENT.DURATION}: {EVENT.NAME}
Host: {HOST.NAME}
{EVENT.DATE} {EVENT.TIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('8','3','0','2','','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem in {EVENT.AGE} at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('9','3','1','0','','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('10','3','2','0','','Autoregistration: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('11','4','0','0','Problem: {EVENT.NAME}','<b>Problem started</b> at {EVENT.TIME} on {EVENT.DATE}<br><b>Problem name:</b> {EVENT.NAME}<br><b>Host:</b> {HOST.NAME}<br><b>Severity:</b> {EVENT.SEVERITY}<br><b>Operational data:</b> {EVENT.OPDATA}<br><b>Original problem ID:</b> {EVENT.ID}<br>{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('12','4','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','<b>Problem has been resolved</b> at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}<br><b>Problem name:</b> {EVENT.NAME}<br><b>Problem duration:</b> {EVENT.DURATION}<br><b>Host:</b> {HOST.NAME}<br><b>Severity:</b> {EVENT.SEVERITY}<br><b>Original problem ID:</b> {EVENT.ID}<br>{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('13','4','0','2','Updated problem in {EVENT.AGE}: {EVENT.NAME}','<b>{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem</b> at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.<br>{EVENT.UPDATE.MESSAGE}<br><br><b>Current problem status:</b> {EVENT.STATUS}<br><b>Age:</b> {EVENT.AGE}<br><b>Acknowledged:</b> {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('14','4','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','<b>Discovery rule:</b> {DISCOVERY.RULE.NAME}<br><br><b>Device IP:</b> {DISCOVERY.DEVICE.IPADDRESS}<br><b>Device DNS:</b> {DISCOVERY.DEVICE.DNS}<br><b>Device status:</b> {DISCOVERY.DEVICE.STATUS}<br><b>Device uptime:</b> {DISCOVERY.DEVICE.UPTIME}<br><br><b>Device service name:</b> {DISCOVERY.SERVICE.NAME}<br><b>Device service port:</b> {DISCOVERY.SERVICE.PORT}<br><b>Device service status:</b> {DISCOVERY.SERVICE.STATUS}<br><b>Device service uptime:</b> {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('15','4','2','0','Autoregistration: {HOST.HOST}','<b>Host name:</b> {HOST.HOST}<br><b>Host IP:</b> {HOST.IP}<br><b>Agent port:</b> {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('16','11','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('17','11','0','1','Resolved: {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('18','11','0','2','Updated problem: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('19','11','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('20','11','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('21','12','0','0','[{EVENT.STATUS}] {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('22','12','0','1','[{EVENT.STATUS}] {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('23','12','0','2','[{EVENT.STATUS}] {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('24','12','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('25','12','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('26','13','0','0','[{EVENT.STATUS}] {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('27','13','0','1','[{EVENT.STATUS}] {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('28','13','0','2','[{EVENT.STATUS}] {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('29','13','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('30','13','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('31','14','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('32','14','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('33','14','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('34','14','0','1','Resolved: {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('35','14','0','2','Updated problem: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('36','15','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('37','15','0','1','Resolved: {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('38','15','0','2','Updated problem: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('39','15','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('40','15','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('41','16','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('42','16','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('43','16','0','2','Updated problem: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('44','16','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('45','16','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('46','17','0','0','{EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('47','17','0','1','{EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('48','17','0','2','{EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('49','17','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('50','17','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('51','17','3','0','Internal problem: {EVENT.NAME}','Internal problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('52','18','0','0','[{EVENT.STATUS}] {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('53','18','0','1','[{EVENT.STATUS}] {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('54','18','0','2','[{EVENT.STATUS}] {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('55','18','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('56','18','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('57','19','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('58','19','0','1','Resolved: {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('59','19','0','2','Updated problem: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('60','19','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('61','19','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('62','20','0','0','{EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('63','20','0','1','{EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('64','20','0','2','{EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('65','20','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('66','20','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('67','21','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('68','21','0','1','Resolved: {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('69','21','0','2','Updated problem: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('70','21','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('71','21','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('72','10','0','0','[{EVENT.STATUS}] {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('73','10','0','1','[{EVENT.STATUS}] {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('74','10','0','2','[{EVENT.STATUS}] {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('75','10','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('76','10','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('77','22','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('78','22','0','2','Updated problem in {EVENT.AGE}: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, age is {EVENT.AGE}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('79','22','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Problem duration: {EVENT.DURATION}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('80','5','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('81','5','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Problem duration: {EVENT.DURATION}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('82','5','0','2','Updated problem in {EVENT.AGE}: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, age is {EVENT.AGE}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('83','5','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('84','5','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('85','6','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('86','6','0','2','Updated problem in {EVENT.AGE}: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, age is {EVENT.AGE}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('87','6','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('88','6','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('89','6','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Problem duration: {EVENT.DURATION}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('90','7','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('91','7','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Problem duration: {EVENT.DURATION}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('92','7','0','2','Updated problem in {EVENT.AGE}: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, age is {EVENT.AGE}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('93','7','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('94','7','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('95','8','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('96','8','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Problem duration: {EVENT.DURATION}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('97','8','0','2','Updated problem in {EVENT.AGE}: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, age is {EVENT.AGE}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('98','8','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('99','8','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('100','9','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('101','9','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Problem duration: {EVENT.DURATION}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('102','9','0','2','Updated problem in {EVENT.AGE}: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, age is {EVENT.AGE}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('103','9','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('104','9','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('105','23','0','0','[{EVENT.STATUS}] {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}

Trigger description: {TRIGGER.DESCRIPTION}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('106','23','0','1','[{EVENT.STATUS}] {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('107','23','0','2','[{EVENT.STATUS}] {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('108','23','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('109','23','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('110','24','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('111','24','0','1','Resolved: {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('112','24','0','2','Updated problem: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('113','24','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('114','24','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('115','25','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('116','25','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Problem duration: {EVENT.DURATION}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('117','25','0','2','Updated problem in {EVENT.AGE}: {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, age is {EVENT.AGE}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('118','25','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('119','25','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('120','26','0','0','[{EVENT.STATUS}] {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('121','26','0','1','[{EVENT.STATUS}] {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('122','26','0','2','[{EVENT.STATUS}] {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('123','26','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('124','26','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('125','27','0','0','[{EVENT.STATUS}] {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('126','27','0','1','[{EVENT.STATUS}] {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('127','27','0','2','[{EVENT.STATUS}] {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('128','27','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('129','27','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('130','28','0','0','Problem: {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('131','28','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Problem duration: {EVENT.DURATION}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('132','28','0','2','[{EVENT.STATUS}] {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('133','28','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('134','28','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('135','29','0','0','[{EVENT.STATUS}] {EVENT.NAME}','[{EVENT.STATUS}] {EVENT.NAME}
Started at {EVENT.TIME} on {EVENT.DATE}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Event info: {$ZABBIX.URL}/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('136','29','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','[{EVENT.STATUS}] {EVENT.NAME}
Resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Event info: {$ZABBIX.URL}/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('137','29','0','2','[{EVENT.STATUS}] {EVENT.NAME}','[{EVENT.STATUS}] {EVENT.NAME}

{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('138','29','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}
Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('139','29','2','0','Autoregistration: {HOST.HOST}','Autoregistration: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('140','30','0','0','[{EVENT.STATUS}] {EVENT.NAME}','[{EVENT.STATUS}] {EVENT.NAME}
Started at {EVENT.TIME} on {EVENT.DATE}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Event info: {$ZABBIX.URL}/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('141','30','0','1','Resolved in {EVENT.DURATION}: {EVENT.NAME}','[{EVENT.STATUS}] {EVENT.NAME}
Resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Event info: {$ZABBIX.URL}/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('142','30','0','2','[{EVENT.STATUS}] {EVENT.NAME}','[{EVENT.STATUS}] {EVENT.NAME}

{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('143','30','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}
Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('144','30','2','0','Autoregistration: {HOST.HOST}','Autoregistration: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('145','31','0','0','[{EVENT.STATUS}] {EVENT.NAME}','Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Operational data: {EVENT.OPDATA}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('146','31','0','1','[{EVENT.STATUS}] {EVENT.NAME}','Problem has been resolved in {EVENT.DURATION} at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('147','31','0','2','[{EVENT.STATUS}] {EVENT.NAME}','{USER.FULLNAME} {EVENT.UPDATE.ACTION} problem at {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

Current problem status is {EVENT.STATUS}, acknowledged: {EVENT.ACK.STATUS}.');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('148','31','1','0','Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}','Discovery rule: {DISCOVERY.RULE.NAME}

Device IP: {DISCOVERY.DEVICE.IPADDRESS}
Device DNS: {DISCOVERY.DEVICE.DNS}
Device status: {DISCOVERY.DEVICE.STATUS}
Device uptime: {DISCOVERY.DEVICE.UPTIME}

Device service name: {DISCOVERY.SERVICE.NAME}
Device service port: {DISCOVERY.SERVICE.PORT}
Device service status: {DISCOVERY.SERVICE.STATUS}
Device service uptime: {DISCOVERY.SERVICE.UPTIME}');
INSERT INTO media_type_message (mediatype_messageid,mediatypeid,eventsource,recovery,subject,message) values ('149','31','2','0','Autoregistration: {HOST.HOST}','Host name: {HOST.HOST}
Host IP: {HOST.IP}
Agent port: {HOST.PORT}');
INSERT INTO usrgrp (usrgrpid,name,gui_access,users_status,debug_mode) values ('7','Zabbix administrators','0','0','0');
INSERT INTO usrgrp (usrgrpid,name,gui_access,users_status,debug_mode) values ('8','Guests','1','0','0');
INSERT INTO usrgrp (usrgrpid,name,gui_access,users_status,debug_mode) values ('9','Disabled','0','1','0');
INSERT INTO usrgrp (usrgrpid,name,gui_access,users_status,debug_mode) values ('11','Enabled debug mode','0','0','1');
INSERT INTO usrgrp (usrgrpid,name,gui_access,users_status,debug_mode) values ('12','No access to the frontend','3','0','0');
INSERT INTO users_groups (id,usrgrpid,userid) values ('2','8','2');
INSERT INTO users_groups (id,usrgrpid,userid) values ('3','9','2');
INSERT INTO users_groups (id,usrgrpid,userid) values ('4','7','1');
INSERT INTO scripts (scriptid,name,command,host_access,usrgrpid,groupid,description,confirmation,type,execute_on) values ('1','Ping','ping -c 3 {HOST.CONN}; case $? in [01]) true;; *) false;; esac','2',NULL,NULL,'','','0','2');
INSERT INTO scripts (scriptid,name,command,host_access,usrgrpid,groupid,description,confirmation,type,execute_on) values ('2','Traceroute','/usr/bin/traceroute {HOST.CONN}','2',NULL,NULL,'','','0','2');
INSERT INTO scripts (scriptid,name,command,host_access,usrgrpid,groupid,description,confirmation,type,execute_on) values ('3','Detect operating system','sudo /usr/bin/nmap -O {HOST.CONN}','2','7',NULL,'','','0','2');
INSERT INTO actions (actionid,name,eventsource,evaltype,status,esc_period,formula,pause_suppressed) values ('2','Auto discovery. Linux servers.','1','0','1','0','','1');
INSERT INTO actions (actionid,name,eventsource,evaltype,status,esc_period,formula,pause_suppressed) values ('3','Report problems to Zabbix administrators','0','0','1','1h','','1');
INSERT INTO actions (actionid,name,eventsource,evaltype,status,esc_period,formula,pause_suppressed) values ('4','Report not supported items','3','0','1','1h','','1');
INSERT INTO actions (actionid,name,eventsource,evaltype,status,esc_period,formula,pause_suppressed) values ('5','Report not supported low level discovery rules','3','0','1','1h','','1');
INSERT INTO actions (actionid,name,eventsource,evaltype,status,esc_period,formula,pause_suppressed) values ('6','Report unknown triggers','3','0','1','1h','','1');
INSERT INTO operations (operationid,actionid,operationtype,esc_period,esc_step_from,esc_step_to,evaltype,recovery) values ('1','2','6','0','1','1','0','0');
INSERT INTO operations (operationid,actionid,operationtype,esc_period,esc_step_from,esc_step_to,evaltype,recovery) values ('2','2','4','0','1','1','0','0');
INSERT INTO operations (operationid,actionid,operationtype,esc_period,esc_step_from,esc_step_to,evaltype,recovery) values ('3','3','0','0','1','1','0','0');
INSERT INTO operations (operationid,actionid,operationtype,esc_period,esc_step_from,esc_step_to,evaltype,recovery) values ('4','4','0','0','1','1','0','0');
INSERT INTO operations (operationid,actionid,operationtype,esc_period,esc_step_from,esc_step_to,evaltype,recovery) values ('5','5','0','0','1','1','0','0');
INSERT INTO operations (operationid,actionid,operationtype,esc_period,esc_step_from,esc_step_to,evaltype,recovery) values ('6','6','0','0','1','1','0','0');
INSERT INTO operations (operationid,actionid,operationtype,esc_period,esc_step_from,esc_step_to,evaltype,recovery) values ('7','3','11','0','1','1','0','1');
INSERT INTO operations (operationid,actionid,operationtype,esc_period,esc_step_from,esc_step_to,evaltype,recovery) values ('8','4','11','0','1','1','0','1');
INSERT INTO operations (operationid,actionid,operationtype,esc_period,esc_step_from,esc_step_to,evaltype,recovery) values ('9','5','11','0','1','1','0','1');
INSERT INTO operations (operationid,actionid,operationtype,esc_period,esc_step_from,esc_step_to,evaltype,recovery) values ('10','6','11','0','1','1','0','1');
INSERT INTO opmessage (operationid,default_msg,subject,message,mediatypeid) values ('3','1','','',NULL);
INSERT INTO opmessage (operationid,default_msg,subject,message,mediatypeid) values ('4','1','','',NULL);
INSERT INTO opmessage (operationid,default_msg,subject,message,mediatypeid) values ('5','1','','',NULL);
INSERT INTO opmessage (operationid,default_msg,subject,message,mediatypeid) values ('6','1','','',NULL);
INSERT INTO opmessage (operationid,default_msg,subject,message,mediatypeid) values ('7','1','','',NULL);
INSERT INTO opmessage (operationid,default_msg,subject,message,mediatypeid) values ('8','1','','',NULL);
INSERT INTO opmessage (operationid,default_msg,subject,message,mediatypeid) values ('9','1','','',NULL);
INSERT INTO opmessage (operationid,default_msg,subject,message,mediatypeid) values ('10','1','','',NULL);
INSERT INTO opmessage_grp (opmessage_grpid,operationid,usrgrpid) values ('1','3','7');
INSERT INTO opmessage_grp (opmessage_grpid,operationid,usrgrpid) values ('2','4','7');
INSERT INTO opmessage_grp (opmessage_grpid,operationid,usrgrpid) values ('3','5','7');
INSERT INTO opmessage_grp (opmessage_grpid,operationid,usrgrpid) values ('4','6','7');
INSERT INTO opgroup (opgroupid,operationid,groupid) values ('1','2','2');
INSERT INTO conditions (conditionid,actionid,conditiontype,operator,value,value2) values ('2','2','10','0','0','');
INSERT INTO conditions (conditionid,actionid,conditiontype,operator,value,value2) values ('3','2','8','0','9','');
INSERT INTO conditions (conditionid,actionid,conditiontype,operator,value,value2) values ('4','2','12','2','Linux','');
INSERT INTO conditions (conditionid,actionid,conditiontype,operator,value,value2) values ('6','4','23','0','0','');
INSERT INTO conditions (conditionid,actionid,conditiontype,operator,value,value2) values ('7','5','23','0','2','');
INSERT INTO conditions (conditionid,actionid,conditiontype,operator,value,value2) values ('8','6','23','0','4','');
INSERT INTO config (configid,refresh_unsupported,work_period,alert_usrgrpid,discovery_groupid) values ('1','10m','1-5,09:00-18:00','7','5');
INSERT INTO graph_theme (graphthemeid,theme,backgroundcolor,graphcolor,gridcolor,maingridcolor,gridbordercolor,textcolor,highlightcolor,leftpercentilecolor,rightpercentilecolor,nonworktimecolor,colorpalette) values ('1','blue-theme','FFFFFF','FFFFFF','CCD5D9','ACBBC2','ACBBC2','1F2C33','E33734','429E47','E33734','EBEBEB','1A7C11,F63100,2774A4,A54F10,FC6EA3,6C59DC,AC8C14,611F27,F230E0,5CCD18,BB2A02,5A2B57,89ABF8,7EC25C,274482,2B5429,8048B4,FD5434,790E1F,87AC4D,E89DF4');
INSERT INTO graph_theme (graphthemeid,theme,backgroundcolor,graphcolor,gridcolor,maingridcolor,gridbordercolor,textcolor,highlightcolor,leftpercentilecolor,rightpercentilecolor,nonworktimecolor,colorpalette) values ('2','dark-theme','2B2B2B','2B2B2B','454545','4F4F4F','4F4F4F','F2F2F2','E45959','59DB8F','E45959','333333','199C0D,F63100,2774A4,F7941D,FC6EA3,6C59DC,C7A72D,BA2A5D,F230E0,5CCD18,BB2A02,AC41A5,89ABF8,7EC25C,3165D5,79A277,AA73DE,FD5434,F21C3E,87AC4D,E89DF4');
INSERT INTO graph_theme (graphthemeid,theme,backgroundcolor,graphcolor,gridcolor,maingridcolor,gridbordercolor,textcolor,highlightcolor,leftpercentilecolor,rightpercentilecolor,nonworktimecolor,colorpalette) values ('3','hc-light','FFFFFF','FFFFFF','555555','000000','333333','000000','333333','000000','000000','EBEBEB','1A7C11,F63100,2774A4,A54F10,FC6EA3,6C59DC,AC8C14,611F27,F230E0,5CCD18,BB2A02,5A2B57,89ABF8,7EC25C,274482,2B5429,8048B4,FD5434,790E1F,87AC4D,E89DF4');
INSERT INTO graph_theme (graphthemeid,theme,backgroundcolor,graphcolor,gridcolor,maingridcolor,gridbordercolor,textcolor,highlightcolor,leftpercentilecolor,rightpercentilecolor,nonworktimecolor,colorpalette) values ('4','hc-dark','000000','000000','666666','888888','4F4F4F','FFFFFF','FFFFFF','FFFFFF','FFFFFF','333333','199C0D,F63100,2774A4,F7941D,FC6EA3,6C59DC,C7A72D,BA2A5D,F230E0,5CCD18,BB2A02,AC41A5,89ABF8,7EC25C,3165D5,79A277,AA73DE,FD5434,F21C3E,87AC4D,E89DF4');
INSERT INTO globalmacro (globalmacroid,macro,value,description,type) values ('2','{$SNMP_COMMUNITY}','public','','0');
INSERT INTO regexps (regexpid,name,test_string) values ('1','File systems for discovery','ext3');
INSERT INTO regexps (regexpid,name,test_string) values ('2','Network interfaces for discovery','eth0');
INSERT INTO regexps (regexpid,name,test_string) values ('3','Storage devices for SNMP discovery','/boot');
INSERT INTO regexps (regexpid,name,test_string) values ('4','Windows service names for discovery','SysmonLog');
INSERT INTO regexps (regexpid,name,test_string) values ('5','Windows service startup states for discovery','automatic');
INSERT INTO expressions (expressionid,regexpid,expression,expression_type,exp_delimiter,case_sensitive) values ('1','1','^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$','3',',','0');
INSERT INTO expressions (expressionid,regexpid,expression,expression_type,exp_delimiter,case_sensitive) values ('3','3','^(Physical memory|Virtual memory|Memory buffers|Cached memory|Swap space)$','4',',','1');
INSERT INTO expressions (expressionid,regexpid,expression,expression_type,exp_delimiter,case_sensitive) values ('5','4','^(MMCSS|gupdate|SysmonLog|clr_optimization_v2.0.50727_32|clr_optimization_v4.0.30319_32)$','4',',','1');
INSERT INTO expressions (expressionid,regexpid,expression,expression_type,exp_delimiter,case_sensitive) values ('6','5','^(automatic|automatic delayed)$','3',',','1');
INSERT INTO expressions (expressionid,regexpid,expression,expression_type,exp_delimiter,case_sensitive) values ('7','2','^Software Loopback Interface','4',',','1');
INSERT INTO expressions (expressionid,regexpid,expression,expression_type,exp_delimiter,case_sensitive) values ('8','2','^(In)?[Ll]oop[Bb]ack[0-9._]*$','4',',','1');
INSERT INTO expressions (expressionid,regexpid,expression,expression_type,exp_delimiter,case_sensitive) values ('9','2','^NULL[0-9.]*$','4',',','1');
INSERT INTO expressions (expressionid,regexpid,expression,expression_type,exp_delimiter,case_sensitive) values ('10','2','^[Ll]o[0-9.]*$','4',',','1');
INSERT INTO expressions (expressionid,regexpid,expression,expression_type,exp_delimiter,case_sensitive) values ('11','2','^[Ss]ystem$','4',',','1');
INSERT INTO expressions (expressionid,regexpid,expression,expression_type,exp_delimiter,case_sensitive) values ('12','2','^Nu[0-9.]*$','4',',','1');
INSERT INTO config_autoreg_tls (autoreg_tlsid,tls_psk_identity,tls_psk) values ('1','','');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10001',NULL,'Template OS Linux by Zabbix agent','3','-1','2','','','Template OS Linux by Zabbix agent','0',NULL,'Official Linux template. Requires agent of Zabbix 3.0.14, 3.4.5 and 4.0.0 or newer.

Known Issues:

  Description: Network discovery. Zabbix agent as of 4.2 doesn''t support items such as net.if.status, net.if.speed.

You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387225-discussion-thread-for-official-zabbix-template-for-linux

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10047',NULL,'Template App Zabbix Server','3','-1','2','','','Template App Zabbix Server','0',NULL,'Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10048',NULL,'Template App Zabbix Proxy','3','-1','2','','','Template App Zabbix Proxy','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10050',NULL,'Template Module Zabbix agent','3','-1','2','','','Template Module Zabbix agent','0',NULL,'Use this template for agents reachable from Zabbix server/proxy (passive mode).

Template tooling version used: 0.34','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10074',NULL,'Template OS OpenBSD','3','-1','2','','','Template OS OpenBSD','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10075',NULL,'Template OS FreeBSD','3','-1','2','','','Template OS FreeBSD','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10076',NULL,'Template OS AIX','3','-1','2','','','Template OS AIX','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10077',NULL,'Template OS HP-UX','3','-1','2','','','Template OS HP-UX','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10078',NULL,'Template OS Solaris','3','-1','2','','','Template OS Solaris','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10079',NULL,'Template OS Mac OS X','3','-1','2','','','Template OS Mac OS X','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10081',NULL,'Template OS Windows by Zabbix agent','3','-1','2','','','Template OS Windows by Zabbix agent','0',NULL,'Official Windows template. Requires agent of Zabbix 4.4 and newer.


You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387224-discussion-thread-for-official-zabbix-template-for-windows

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10084',NULL,'Zabbix server','0','-1','2','','','Zabbix server','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10093',NULL,'Template App FTP Service','3','-1','2','','','Template App FTP Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10094',NULL,'Template App HTTP Service','3','-1','2','','','Template App HTTP Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10095',NULL,'Template App HTTPS Service','3','-1','2','','','Template App HTTPS Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10096',NULL,'Template App IMAP Service','3','-1','2','','','Template App IMAP Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10097',NULL,'Template App LDAP Service','3','-1','2','','','Template App LDAP Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10098',NULL,'Template App NNTP Service','3','-1','2','','','Template App NNTP Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10099',NULL,'Template App NTP Service','3','-1','2','','','Template App NTP Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10100',NULL,'Template App POP Service','3','-1','2','','','Template App POP Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10101',NULL,'Template App SMTP Service','3','-1','2','','','Template App SMTP Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10102',NULL,'Template App SSH Service','3','-1','2','','','Template App SSH Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10103',NULL,'Template App Telnet Service','3','-1','2','','','Template App Telnet Service','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10169',NULL,'Template App Generic Java JMX','3','-1','2','','','Template App Generic Java JMX','0',NULL,'Template tooling version used: 0.38','1','1','','','','','','1','0');

INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10171',NULL,'Template Server Intel SR1530 IPMI','3','-1','2','','','Template Server Intel SR1530 IPMI','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10172',NULL,'Template Server Intel SR1630 IPMI','3','-1','2','','','Template Server Intel SR1630 IPMI','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10173',NULL,'Template VM VMware','3','-1','2','','','Template VM VMware','0',NULL,'You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10174',NULL,'Template VM VMware Guest','3','-1','2','','','Template VM VMware Guest','0',NULL,'Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10175',NULL,'Template VM VMware Hypervisor','3','-1','2','','','Template VM VMware Hypervisor','0',NULL,'Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10183',NULL,'Template Module EtherLike-MIB SNMP','3','-1','2','','','Template Module EtherLike-MIB SNMP','0',NULL,'Template EtherLike-MIB (duplex control only)

MIBs used:
EtherLike-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10185',NULL,'Template Module HOST-RESOURCES-MIB SNMP','3','-1','2','','','Template Module HOST-RESOURCES-MIB SNMP','0',NULL,'HOST-RESOURCES-MIB: CPU, memory and storage(vfs.fs.file) linked together.

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10186',NULL,'Template Module ICMP Ping','3','-1','2','','','Template Module ICMP Ping','0',NULL,'Template Module ICMP Ping

Template tooling version used: 0.34','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10188',NULL,'Template Module Interfaces Simple SNMP','3','-1','2','','','Template Module Interfaces Simple SNMP','0',NULL,'Template Module Interfaces Simple (no ifXTable). This is the exact copy of Template Module Interfaces template with the exception that metrics from ifXTable are replaced with ifTable counters where possible. Use this template with devices where IF-MIB::ifXtable is not available. If supported by the host - use Template Module Interfaces template instead.

MIBs used:
IF-MIB

Known Issues:

  Description: 32bit counters are used in this template (since there is no ifXtable available). If busy interfaces return incorrect bits sent/received - set update interval to 1m or less.

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10190',NULL,'Template Module Interfaces SNMP','3','-1','2','','','Template Module Interfaces SNMP','0',NULL,'Template Module Interfaces

MIBs used:
IF-MIB

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10192',NULL,'Template Module Interfaces Windows SNMP','3','-1','2','','','Template Module Interfaces Windows SNMP','0',NULL,'Template Interfaces Windows

MIBs used:
IF-MIB

Known Issues:

  Description: 32bit counters are used in this template (since 64bit are not supported by Windows OS). If busy interfaces return incorrect bits sent/received - set update interval to 1m or less.

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10204',NULL,'Template Module Generic SNMP','3','-1','2','','','Template Module Generic SNMP','0',NULL,'Template Module Generic

MIBs used:
SNMPv2-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10207',NULL,'Template Net Alcatel Timetra TiMOS SNMP','3','-1','2','','','Template Net Alcatel Timetra TiMOS SNMP','0',NULL,'Template Net Alcatel Timetra TiMOS

MIBs used:
TIMETRA-CHASSIS-MIB
TIMETRA-SYSTEM-MIB
SNMPv2-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10208',NULL,'Template Net Brocade FC SNMP','3','-1','2','','','Template Net Brocade FC SNMP','0',NULL,'Template Net Brocade FC

MIBs used:
SW-MIB

Known Issues:

  Description: no IF-MIB::ifAlias is available
  Version: v6.3.1c, v7.0.0c,  v7.4.1c
  Device: all

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10209',NULL,'Template Module Brocade_Foundry Performance SNMP','3','-1','2','','','Template Module Brocade_Foundry Performance SNMP','0',NULL,'Template Module Brocade_Foundry Performance

MIBs used:
FOUNDRY-SN-AGENT-MIB

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10210',NULL,'Template Net Brocade_Foundry Nonstackable SNMP','3','-1','2','','','Template Net Brocade_Foundry Nonstackable SNMP','0',NULL,'Template Net Brocade_Foundry Nonstackable

MIBs used:
FOUNDRY-SN-AGENT-MIB

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10211',NULL,'Template Net Brocade_Foundry Stackable SNMP','3','-1','2','','','Template Net Brocade_Foundry Stackable SNMP','0',NULL,'Template Brocade_Foundry Stackable

MIBs used:
FOUNDRY-SN-AGENT-MIB
FOUNDRY-SN-STACKING-MIB

Known Issues:

  Description: Correct fan(returns fan status as ''other(1)'' and temperature (returns 0) for the non-master Switches are not available in SNMP
  Version: Version 08.0.40b and above
  Device: ICX 7750 in stack

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10212',NULL,'Template Module Cisco CISCO-MEMORY-POOL-MIB SNMP','3','-1','2','','','Template Module Cisco CISCO-MEMORY-POOL-MIB SNMP','0',NULL,'Template Cisco CISCO-MEMORY-POOL-MIB

MIBs used:
CISCO-MEMORY-POOL-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10213',NULL,'Template Module Cisco CISCO-PROCESS-MIB SNMP','3','-1','2','','','Template Module Cisco CISCO-PROCESS-MIB SNMP','0',NULL,'Template Cisco CISCO-PROCESS-MIB

MIBs used:
CISCO-PROCESS-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10215',NULL,'Template Module Cisco OLD-CISCO-CPU-MIB SNMP','3','-1','2','','','Template Module Cisco OLD-CISCO-CPU-MIB SNMP','0',NULL,'Template Cisco OLD-CISCO-CPU-MIB

MIBs used:
OLD-CISCO-CPU-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10216',NULL,'Template Module Cisco Inventory SNMP','3','-1','2','','','Template Module Cisco Inventory SNMP','0',NULL,'Template Cisco Inventory

MIBs used:
ENTITY-MIB
SNMPv2-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10217',NULL,'Template Module Cisco CISCO-ENVMON-MIB SNMP','3','-1','2','','','Template Module Cisco CISCO-ENVMON-MIB SNMP','0',NULL,'Template Cisco CISCO-ENVMON-MIB

MIBs used:
CISCO-ENVMON-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10218',NULL,'Template Net Cisco IOS SNMP','3','-1','2','','','Template Net Cisco IOS SNMP','0',NULL,'Template Cisco IOS Software releases 12.2(3.5) or later

Known Issues:

  Description: no if(in|out)(Errors|Discards) are available for vlan ifType
  Version: IOS for example: 12.1(22)EA11, 15.4(3)M2
  Device: C2911, C7600

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10220',NULL,'Template Net Cisco IOS prior to 12.0_3_T SNMP','3','-1','2','','','Template Net Cisco IOS prior to 12.0_3_T SNMP','0',NULL,'Cisco IOS Software releases prior to 12.0(3)T

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10221',NULL,'Template Net Dell Force S-Series SNMP','3','-1','2','','','Template Net Dell Force S-Series SNMP','0',NULL,'Template Dell Force S-Series

MIBs used:
F10-S-SERIES-CHASSIS-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10222',NULL,'Template Net D-Link DES 7200 SNMP','3','-1','2','','','Template Net D-Link DES 7200 SNMP','0',NULL,'Template D-Link DES 7200

MIBs used:
MY-PROCESS-MIB
SNMPv2-MIB
MY-MEMORY-MIB
ENTITY-MIB
MY-SYSTEM-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10223',NULL,'Template Net D-Link DES_DGS Switch SNMP','3','-1','2','','','Template Net D-Link DES_DGS Switch SNMP','0',NULL,'Template D-Link DES_DGS Switch

MIBs used:
DLINK-AGENT-MIB
SNMPv2-MIB
ENTITY-MIB
EQUIPMENT-MIB

Known Issues:

  Description: D-Link reports missing PSU as fail(4)
  Version: Firmware: 1.73R008,hardware revision: B1
  Device: DGS-3420-26SC Gigabit Ethernet Switch

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10224',NULL,'Template Net Extreme EXOS SNMP','3','-1','2','','','Template Net Extreme EXOS SNMP','0',NULL,'Template Extreme EXOS

MIBs used:
EXTREME-SOFTWARE-MONITOR-MIB
EXTREME-SYSTEM-MIB
ENTITY-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10226',NULL,'Template Net Network Generic Device SNMP','3','-1','2','','','Template Net Network Generic Device SNMP','0',NULL,'Template Net Network Generic Device

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10227',NULL,'Template Net HP Comware HH3C SNMP','3','-1','2','','','Template Net HP Comware HH3C SNMP','0',NULL,'Template Net HP Comware (HH3C)

MIBs used:
ENTITY-MIB
HH3C-ENTITY-EXT-MIB

Known Issues:

  Description: No temperature sensors. All entities of them return 0 for HH3C-ENTITY-EXT-MIB::hh3cEntityExtTemperature
  Version: 1910-48 Switch Software Version 5.20.99, Release 1116 Copyright(c)2010-2016 Hewlett Packard Enterprise Development LP
  Device: HP 1910-48

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10229',NULL,'Template Net Huawei VRP SNMP','3','-1','2','','','Template Net Huawei VRP SNMP','0',NULL,'Template Net Huawei VRP

MIBs used:
HUAWEI-ENTITY-EXTENT-MIB
ENTITY-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10230',NULL,'Template Net Intel_Qlogic Infiniband SNMP','3','-1','2','','','Template Net Intel_Qlogic Infiniband SNMP','0',NULL,'Template Net Intel_Qlogic Infiniband

MIBs used:
ICS-CHASSIS-MIB

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10231',NULL,'Template Net Juniper SNMP','3','-1','2','','','Template Net Juniper SNMP','0',NULL,'Template Net Juniper

MIBs used:
JUNIPER-ALARM-MIB
JUNIPER-MIB
SNMPv2-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10233',NULL,'Template Net Mikrotik SNMP','3','-1','2','','','Template Net Mikrotik SNMP','0',NULL,'Template Net Mikrotik

MIBs used:
HOST-RESOURCES-MIB
MIKROTIK-MIB

Known Issues:

  Description: Doesn''t have ifHighSpeed filled. fixed in more recent versions
  Version: RouterOS 6.28 or lower

  Description: Doesn''t have any temperature sensors
  Version: RouterOS 6.38.5
  Device: Mikrotik 941-2nD, Mikrotik 951G-2HnD

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10234',NULL,'Template Net Netgear Fastpath SNMP','3','-1','2','','','Template Net Netgear Fastpath SNMP','0',NULL,'Template Net Netgear Fastpath

MIBs used:
FASTPATH-SWITCHING-MIB
FASTPATH-BOXSERVICES-PRIVATE-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10235',NULL,'Template Net QTech QSW SNMP','3','-1','2','','','Template Net QTech QSW SNMP','0',NULL,'Template Net QTech QSW

MIBs used:
QTECH-MIB
ENTITY-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10236',NULL,'Template Net TP-LINK SNMP','3','-1','2','','','Template Net TP-LINK SNMP','0',NULL,'Template Net TP-LINK

MIBs used:
TPLINK-SYSINFO-MIB
TPLINK-SYSMONITOR-MIB

Known Issues:

  Description: Default sysLocation, sysName and sysContact is not filled with proper data. Real hostname and location can be found only in private branch (TPLINK-SYSINFO-MIB). Please check whether this problem exists in the latest firmware: https://www.tp-link.com/en/support/download/t2600g-28ts/#Firmware
  Version: 2.0.0 Build 20170628 Rel.55184 (Beta)
  Device: T2600G-28TS 2.0

  Description: The Serial number of the product (tpSysInfoSerialNum) is missing in HW versions prior to V2_170323
  Version: Prior to version V2_170323
  Device: T2600G-28TS 2.0

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10237',NULL,'Template Net Ubiquiti AirOS SNMP','3','-1','2','','','Template Net Ubiquiti AirOS SNMP','0',NULL,'Template Net Ubiquiti AirOS

MIBs used:
IEEE802dot11-MIB
FROGFOOT-RESOURCES-MIB

Known Issues:

  Description: UBNT unifi reports speed: like IF-MIB::ifSpeed.1 = Gauge32: 4294967295 for all interfaces
  Version: Firmware: BZ.ar7240.v3.7.51.6230.170322.1513
  Device: UBNT UAP-LR

  Description: UBNT AirMax(NanoStation, NanoBridge etc) reports ifSpeed: as 0 for VLAN and wireless(ath0) interfaces
  Version: Firmware: XW.ar934x.v5.6-beta4.22359.140521.1836
  Device: NanoStation M5

  Description: UBNT AirMax(NanoStation, NanoBridge etc) reports always return ifType: as ethernet(6) even for wifi,vlans and other types
  Version: Firmware: XW.ar934x.v5.6-beta4.22359.140521.1836
  Device: NanoStation M5

  Description: ifXTable is not provided in IF-MIB. So Interfaces Simple Template is used instead
  Version: all above
  Device: NanoStation, UAP-LR

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10248',NULL,'Template OS Linux SNMP','3','-1','2','','','Template OS Linux SNMP','0',NULL,'Template OS Linux

You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387225-discussion-thread-for-official-zabbix-template-for-linux

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10249',NULL,'Template OS Windows SNMP','3','-1','2','','','Template OS Windows SNMP','0',NULL,'Official Windows SNMP template. Requires Zabbix server 4.0.14, 4.2.8, 4.4.0 or newer (JSONPath function avg() used with types autoconversion).


Known Issues:

  Description: Doesn''t support In/Out 64 bit counters even though IfxTable is present:
Currently, Windows gets it’s interface status from MIB-2. Since these 64bit SNMP counters (ifHCInOctets, ifHCOutOctets, etc.) are defined as an extension to IF-MIB, Microsoft has not implemented it.
https://social.technet.microsoft.com/Forums/windowsserver/en-US/07b62ff0-94f6-40ca-a99d-d129c1b33d70/windows-2008-r2-snmp-64bit-counters-support?forum=winservergen

  Version: Win2008, Win2012R2.

  Description: Doesn''t support ifXTable at all
  Version: WindowsXP

  Description: EtherLike MIB is not supported
  Version: *
  Device: *

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10250',NULL,'Template Net HP Enterprise Switch SNMP','3','-1','2','','','Template Net HP Enterprise Switch SNMP','0',NULL,'Template Net HP Enterprise Switch

MIBs used:
SEMI-MIB
NETSWITCH-MIB
HP-ICF-CHASSIS
ENTITY-SENSORS-MIB
ENTITY-MIB
STATISTICS-MIB

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10251',NULL,'Template Net Mellanox SNMP','3','-1','2','','','Template Net Mellanox SNMP','0',NULL,'The updated template for monitoring the Mellanox network switches over SNMP agent. All items collected in one template without any linked templates.

MIBs used:
HOST-RESOURCES-MIB
SNMPv2-MIB
ENTITY-SENSORS-MIB
ENTITY-STATE-MIB
ENTITY-MIB
IF-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10252',NULL,'Template Module Cisco CISCO-PROCESS-MIB IOS versions 12.0_3_T-12.2_3.5 SNMP','3','-1','2','','','Template Module Cisco CISCO-PROCESS-MIB IOS versions 12.0_3_T-12.2_3.5 SNMP','0',NULL,'Template Module Cisco CISCO-PROCESS-MIB IOS versions 12.0_3_T-12.2_3.5

MIBs used:
CISCO-PROCESS-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10253',NULL,'Template Net Cisco IOS versions 12.0_3_T-12.2_3.5 SNMP','3','-1','2','','','Template Net Cisco IOS versions 12.0_3_T-12.2_3.5 SNMP','0',NULL,'Cisco IOS Software releases later to 12.0(3)T and prior to 12.2(3.5)

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10254',NULL,'Template Net Arista SNMP','3','-1','2','','','Template Net Arista SNMP','0',NULL,'Template Net Arista

MIBs used:
ENTITY-SENSORS-MIB
ENTITY-STATE-MIB
ENTITY-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10255',NULL,'Template Server Dell iDRAC SNMP','3','-1','2','','','Template Server Dell iDRAC SNMP','0',NULL,'Template Server iDRAC

MIBs used:
IDRAC-MIB-SMIv2

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10256',NULL,'Template Server HP iLO SNMP','3','-1','2','','','Template Server HP iLO SNMP','0',NULL,'Template Server HP iLO

MIBs used:
CPQSINFO-MIB
CPQHLTH-MIB
CPQIDA-MIB

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10258',NULL,'Template Server IBM IMM SNMP','3','-1','2','','','Template Server IBM IMM SNMP','0',NULL,'Template Server IBM IMM

MIBs used:
IMM-MIB

Known Issues:

  Description: Some IMMs (IMM1) do not return disks
  Version: IMM1
  Device: IBM x3250M3

  Description: Some IMMs (IMM1) do not return fan status: fanHealthStatus
  Version: IMM1
  Device: IBM x3250M3

  Description: IMM1 servers (M2, M3 generations) sysObjectID is NET-SNMP-MIB::netSnmpAgentOIDs.10
  Version: IMM1
  Device: IMM1 servers (M2,M3 generations)

  Description: IMM1 servers (M2, M3 generations) only Ambient temperature sensor available
  Version: IMM1
  Device: IMM1 servers (M2,M3 generations)

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10259',NULL,'Template Server Supermicro Aten SNMP','3','-1','2','','','Template Server Supermicro Aten SNMP','0',NULL,'Template Server Supermicro Aten

MIBs used:
ATEN-IPMI-MIB

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10260',NULL,'Template App Apache Tomcat JMX','3','-1','2','','','Template App Apache Tomcat JMX','0',NULL,'The template to monitor Apache Tomcat by Zabbix that work without any external scripts.
The metrics are collected by JMX.


You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/411862-discussion-thread-for-official-zabbix-template-tomcat

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10261',NULL,'Template App Remote Zabbix server','3','-1','2','','','Template App Remote Zabbix server','0',NULL,'Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10262',NULL,'Template App Remote Zabbix proxy','3','-1','2','','','Template App Remote Zabbix proxy','0',NULL,'','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10263',NULL,'Template DB PostgreSQL','3','-1','2','','','Template DB PostgreSQL','0',NULL,'You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384190-%C2%A0discussion-thread-for-official-zabbix-template-db-postgresql

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10264',NULL,'Template App Apache by Zabbix agent','3','-1','2','','','Template App Apache by Zabbix agent','0',NULL,'Get metrics from mod_status module using HTTP agent.
https://httpd.apache.org/docs/current/mod/mod_status.html

You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384764-discussion-thread-for-official-zabbix-template-apache

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10265',NULL,'Template App Apache by HTTP','3','-1','2','','','Template App Apache by HTTP','0',NULL,'Get metrics from mod_status module using HTTP agent.
https://httpd.apache.org/docs/current/mod/mod_status.html

You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384764-discussion-thread-for-official-zabbix-template-apache

Template tooling version used: 0.38','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10266',NULL,'Template App Nginx by Zabbix agent','3','-1','2','','','Template App Nginx by Zabbix agent','0',NULL,'Get metrics from stub status module using Zabbix agent running on Linux
https://nginx.ru/en/docs/http/ngx_http_stub_status_module.html


You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384765-discussion-thread-for-official-zabbix-template-nginx

Template tooling version used: 0.37','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10267',NULL,'Template App Nginx by HTTP','3','-1','2','','','Template App Nginx by HTTP','0',NULL,'Get metrics from stub status module using HTTP agent
https://nginx.ru/en/docs/http/ngx_http_stub_status_module.html.


You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384765-discussion-thread-for-official-zabbix-template-nginx

Template tooling version used: 0.37','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10268',NULL,'Template Module Linux memory SNMP','3','-1','2','','','Template Module Linux memory SNMP','0',NULL,'MIBs used:
UCD-SNMP-MIB

Known Issues:

  Description: Please note that memory utilization is a rough estimate, since memory available is calculated as free+buffers+cached, which is not 100% accurate, but the best we can get using SNMP.

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10269',NULL,'Template Module Linux block devices SNMP','3','-1','2','','','Template Module Linux block devices SNMP','0',NULL,'MIBs used:
UCD-DISKIO-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10270',NULL,'Template Module Linux CPU SNMP','3','-1','2','','','Template Module Linux CPU SNMP','0',NULL,'MIBs used:
HOST-RESOURCES-MIB
UCD-SNMP-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10271',NULL,'Template Module Linux filesystems SNMP','3','-1','2','','','Template Module Linux filesystems SNMP','0',NULL,'MIBs used:
HOST-RESOURCES-MIB
UCD-SNMP-MIB

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10272',NULL,'Template Module Linux CPU by Zabbix agent','3','-1','2','','','Template Module Linux CPU by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10273',NULL,'Template Module Linux filesystems by Zabbix agent','3','-1','2','','','Template Module Linux filesystems by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10274',NULL,'Template Module Linux memory by Zabbix agent','3','-1','2','','','Template Module Linux memory by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10275',NULL,'Template Module Linux block devices by Zabbix agent','3','-1','2','','','Template Module Linux block devices by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10276',NULL,'Template Module Linux network interfaces by Zabbix agent','3','-1','2','','','Template Module Linux network interfaces by Zabbix agent','0',NULL,'Known Issues:

  Description: High interface utilization trigger is removed since currently it is not possible to retrieve interface speed to determine the max bandwidth.

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10277',NULL,'Template Module Linux generic by Zabbix agent','3','-1','2','','','Template Module Linux generic by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10278',NULL,'Template Module Linux CPU by Zabbix agent active','3','-1','2','','','Template Module Linux CPU by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10279',NULL,'Template Module Linux filesystems by Zabbix agent active','3','-1','2','','','Template Module Linux filesystems by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10280',NULL,'Template Module Linux memory by Zabbix agent active','3','-1','2','','','Template Module Linux memory by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10281',NULL,'Template Module Linux block devices by Zabbix agent active','3','-1','2','','','Template Module Linux block devices by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10282',NULL,'Template Module Linux network interfaces by Zabbix agent active','3','-1','2','','','Template Module Linux network interfaces by Zabbix agent active','0',NULL,'Known Issues:

  Description: High interface utilization trigger is removed since currently it is not possible to retrieve interface speed to determine the max bandwidth.

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10283',NULL,'Template Module Linux generic by Zabbix agent active','3','-1','2','','','Template Module Linux generic by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10284',NULL,'Template OS Linux by Zabbix agent active','3','-1','2','','','Template OS Linux by Zabbix agent active','0',NULL,'Official Linux template. Requires agent of Zabbix 3.0.14, 3.4.5 and 4.0.0 or newer.

Known Issues:

  Description: Network discovery. Zabbix agent as of 4.2 doesn''t support items such as net.if.status, net.if.speed.

You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387225-discussion-thread-for-official-zabbix-template-for-linux

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10285',NULL,'Template OS Linux by Prom','3','-1','2','','','Template OS Linux by Prom','0',NULL,'Official Linux template using node exporter.

Known Issues:

  Description: node_exporter v0.16.0 renamed many metrics. CPU utilization for ''guest'' and ''guest_nice'' metrics are not supported in this template with node_exporter < 0.16. Disk IO metrics are not supported. Other metrics provided as ''best effort''.  
 See https://github.com/prometheus/node_exporter/releases/tag/v0.16.0 for details.
  Version: below 0.16.0

  Description: metric node_network_info with label ''device'' cannot be found, so network discovery is not possible.
  Version: below 0.18

You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387225-discussion-thread-for-official-zabbix-template-for-linux

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10286',NULL,'Template Module Windows CPU by Zabbix agent','3','-1','2','','','Template Module Windows CPU by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10287',NULL,'Template Module Windows memory by Zabbix agent','3','-1','2','','','Template Module Windows memory by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10288',NULL,'Template Module Windows filesystems by Zabbix agent','3','-1','2','','','Template Module Windows filesystems by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10289',NULL,'Template Module Windows physical disks by Zabbix agent','3','-1','2','','','Template Module Windows physical disks by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10290',NULL,'Template Module Windows generic by Zabbix agent','3','-1','2','','','Template Module Windows generic by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10291',NULL,'Template Module Windows network by Zabbix agent','3','-1','2','','','Template Module Windows network by Zabbix agent','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10292',NULL,'Template Module Zabbix agent active','3','-1','2','','','Template Module Zabbix agent active','0',NULL,'Use this template instead of ''Template Module Zabbix agent'' for agents running in active mode only.

Template tooling version used: 0.34','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10293',NULL,'Template Module Windows CPU by Zabbix agent active','3','-1','2','','','Template Module Windows CPU by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10294',NULL,'Template Module Windows memory by Zabbix agent active','3','-1','2','','','Template Module Windows memory by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10295',NULL,'Template Module Windows filesystems by Zabbix agent active','3','-1','2','','','Template Module Windows filesystems by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10296',NULL,'Template Module Windows physical disks by Zabbix agent active','3','-1','2','','','Template Module Windows physical disks by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10297',NULL,'Template Module Windows generic by Zabbix agent active','3','-1','2','','','Template Module Windows generic by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10298',NULL,'Template Module Windows network by Zabbix agent active','3','-1','2','','','Template Module Windows network by Zabbix agent active','0',NULL,'Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10299',NULL,'Template OS Windows by Zabbix agent active','3','-1','2','','','Template OS Windows by Zabbix agent active','0',NULL,'Official Windows template. Requires agent of Zabbix 4.4 and newer.


You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387224-discussion-thread-for-official-zabbix-template-for-windows

Template tooling version used: 0.39','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10300',NULL,'Template App RabbitMQ cluster by Zabbix agent','3','-1','2','','','Template App RabbitMQ cluster by Zabbix agent','0',NULL,'Get cluster metrics from RabbitMQ management plugin provided an HTTP-based API using Zabbix agent.

You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387226-discussion-thread-for-official-zabbix-template-rabbitmq

Template tooling version used: 0.34','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10301',NULL,'Template App RabbitMQ node by Zabbix agent','3','-1','2','','','Template App RabbitMQ node by Zabbix agent','0',NULL,'Get node metrics from RabbitMQ management plugin provided an HTTP-based API using Zabbix agent.

You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387226-discussion-thread-for-official-zabbix-template-rabbitmq

Template tooling version used: 0.34','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10302',NULL,'Template App RabbitMQ cluster by HTTP','3','-1','2','','','Template App RabbitMQ cluster by HTTP','0',NULL,'Get cluster metrics from RabbitMQ management plugin provided an HTTP-based API using HTTP agent.

You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387226-discussion-thread-for-official-zabbix-template-rabbitmq

Template tooling version used: 0.34','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10303',NULL,'Template App RabbitMQ node by HTTP','3','-1','2','','','Template App RabbitMQ node by HTTP','0',NULL,'Get node metrics from RabbitMQ management plugin provided an HTTP-based API using HTTP agent.

You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387226-discussion-thread-for-official-zabbix-template-rabbitmq

Template tooling version used: 0.34','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10304',NULL,'Template Server Cisco UCS SNMP','3','-1','2','','','Template Server Cisco UCS SNMP','0',NULL,'Template Server Cisco UCS

MIBs used:
CISCO-UNIFIED-COMPUTING-COMPUTE-MIB
CISCO-UNIFIED-COMPUTING-PROCESSOR-MIB
CISCO-UNIFIED-COMPUTING-EQUIPMENT-MIB
CISCO-UNIFIED-COMPUTING-STORAGE-MIB

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10305',NULL,'Template Module HOST-RESOURCES-MIB CPU SNMP','3','-1','2','','','Template Module HOST-RESOURCES-MIB CPU SNMP','0',NULL,'Requires Zabbix server 4.0.14, 4.2.8, 4.4.0 or newer (JSONPath function avg() used with types autoconversion).

MIBs used:
HOST-RESOURCES-MIB

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10306',NULL,'Template Module HOST-RESOURCES-MIB memory SNMP','3','-1','2','','','Template Module HOST-RESOURCES-MIB memory SNMP','0',NULL,'MIBs used:
HOST-RESOURCES-MIB

Template tooling version used: 0.36','1','1','','','','','','1','0');
INSERT INTO hosts (hostid,proxy_hostid,host,status,ipmi_authtype,ipmi_privilege,ipmi_username,ipmi_password,name,flags,templateid,description,tls_connect,tls_accept,tls_issuer,tls_subject,tls_psk_identity,tls_psk,proxy_address,auto_compress,discover) values ('10307',NULL,'Template Module HOST-RESOURCES-MIB storage SNMP','3','-1','2','','','Template Module HOST-RESOURCES-MIB storage SNMP','0',NULL,'MIBs used:
HOST-RESOURCES-MIB

Template tooling version used: 0.36','1','1','','','','','','1','0');
