diff options
author | Tikhon Uskov <tikhon.uskov@zabbix.com> | 2021-01-14 15:34:13 +0300 |
---|---|---|
committer | Tikhon Uskov <tikhon.uskov@zabbix.com> | 2021-01-14 15:34:13 +0300 |
commit | ba807da793e9c63b43564c2eb3418fc8aed01296 (patch) | |
tree | aa0e65eb9007b0fbd49c523f6cb800f8b8c8a6c4 /templates/media | |
parent | d2494bfe2625f979b6783cbc4f4b7d2a52cb3d94 (diff) |
.........T [ZBXNEXT-5862] fixed after QA
Diffstat (limited to 'templates/media')
-rw-r--r-- | templates/media/rocketchat/README.md | 6 | ||||
-rw-r--r-- | templates/media/rocketchat/media_rocketchat.yaml | 16 |
2 files changed, 6 insertions, 16 deletions
diff --git a/templates/media/rocketchat/README.md b/templates/media/rocketchat/README.md index 09ccb177ceb..4f8ead4c2b2 100644 --- a/templates/media/rocketchat/README.md +++ b/templates/media/rocketchat/README.md @@ -1,7 +1,6 @@ # Rocket.Chat webhook This guide describes how to integrate Zabbix 5.4 installation with Rocket.Chat using the Zabbix webhook feature. This guide provides instructions on setting up a media type, a user and an action in Zabbix.<br> -Please note that recovery and update operations are supported only for trigger-based events.<br> By default, all new alerts will be posted as messages with an attachment card. Event updates and resolve messages will be added to the thread of the first message. ## Setting up Rocket.Chat @@ -30,11 +29,10 @@ Format explanation:<br> - *field* - prefix of the parameter with field info. - *1* - the position of the field. Fields with the same position will be added in the alphabetical order. - *short* - whether the field should be short or not. If *short*, there can be several fields on one line, otherwise, the field will be placed on a separate line. -- *p* - used if the field should be sent only on problem/recovery/update operation. Possible values: +- *p* - optional. Used if the field should be sent only on problem/recovery operation. Possible values: - *p* - problem - *r* - recovery - - *u* - update -- *Host* - the title of the field. There can be any text including whitespaces or symbols. +- *Host* - the title of the field. There can be any text including whitespaces or symbols.aces or symbols. 4\. Create a **Zabbix user** and add **Media** with the **Rocket.Chat** media type. "Send to" field should be filled as `#channel_name` or `@username`.<br> diff --git a/templates/media/rocketchat/media_rocketchat.yaml b/templates/media/rocketchat/media_rocketchat.yaml index 8478885fc68..955be1d8037 100644 --- a/templates/media/rocketchat/media_rocketchat.yaml +++ b/templates/media/rocketchat/media_rocketchat.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '5.4' - date: '2021-01-11T14:01:55Z' + date: '2021-01-14T12:31:14Z' media_types: - name: Rocket.Chat @@ -16,9 +16,6 @@ zabbix_export: name: event_nseverity value: '{EVENT.NSEVERITY}' - - name: event_recovery_value - value: '{EVENT.RECOVERY.VALUE}' - - name: event_source value: '{EVENT.SOURCE}' - @@ -129,9 +126,8 @@ zabbix_export: prefix = parts[0].split('_'); if (typeof prefix[2] === 'undefined' - || (prefix[2] === 'p' && params.event_value === '0') - || (prefix[2] === 'r' && params.event_recovery_value === '0') - || (prefix[2] === 'u' && params.event_update_status === '1')) { + || (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], @@ -322,7 +318,7 @@ zabbix_export: rc = {}, update = {}, result = {tags: {}}, - required_params = ['alert_subject', 'alert_message', 'event_recovery_value', 'event_source', 'event_value'], + required_params = ['alert_subject', 'alert_message', 'event_source', 'event_value'], severities = [ {name: 'not_classified', color: '#97AAB3'}, {name: 'information', color: '#7499FF'}, @@ -372,10 +368,6 @@ zabbix_export: 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'; } |