Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-6525

Allow OpsGenie WebHook mediatype to close alert on Event Recovery

XMLWordPrintable

      The OpsGenie webhook should send an Alert Close action when an Event is in the recovery status.

      Inside the 'Event Update' block in the template, I've included the following javascript, which performs this action to my requirements. It's provided as a suggestion on what should be done:

       

      if((params.event_source == 0 && params.event_value == 0 && params.event_update_status == 0) || (params.event_source == 3 && params.event_value == 1)) {
          resp = Media.request('post', params.event_id + '/close?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.';
          }
      }

            wiper Andris Zeila
            jameskirsop James Kirsop
            Votes:
            8 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: