Zabbix + Better Uptime integration

This integration allows you to create Better Uptime incidents from Zabbix automatically

Connecting Prometheus and Better Uptime

1. In the Better Uptime dashboard

  1. Log into your Better Uptime dashboard and on the left panel click Integrations
  2. Click the Importing data tab
  3. Scroll down and look for the Infrastructure monitoring section
  4. Find the Zabbix card and click the Add button
  5. In the new window, name your Zabbix integration (e.g.: Backend service) and click Save changes. Don't close the Better Uptime dashboard just yet, you'll need it in a moment.

2. In the Zabbix dashboard

  1. Open the Zabbix dashboard
  2. Click on Create media type in the upper right corner
  3. Enter Name: Better Uptime
  4. Select Type: Webhook
  5. Remove all parameters except* Message: {ALERT.MESSAGE}*
  6. Input the Zabbix Media type Script found in the Better Uptime configuration into the Script field and click Apply or copy it from here

    // Make a POST request to the Better Uptime Zabbix Webhook
    // https://betteruptime.com/api/v2/zabbix/webhook/sHvzVfzMofxz6eD4XdZEEqdF
    
    var request = new CurlHttpRequest();
    request.AddHeader('Content-Type: application/json');
    
    var response = 
    request.Post('https://betteruptime.com/api/v2/zabbix/webhook/sHvzVfzMofxz6eD4XdZEEqdF', value);
    if (request.Status() != 200) {
      throw 'Response code: ' + request.Status();
    }
    
    return response;
    
    Copied!
  7. Make sure Enabled is checked

  8. Click Add

3. Create a new user in Administration > Users

  1. Click on Create user in the upper right corner
  2. Enter Alias: Better Uptime user
  3. Add this user to a group of your choosing and input any password (we won't see the password)
  4. Switch to the Permissions tab
  5. Add host read permissions to the user so that it can receive messages. You can also achieve this for all hosts by promoting the user to a SuperAdmin
  6. Switch to the Media tab
  7. Add Better Uptime as a new Media
  8. Fill anything in the Send field (Zabbix requires a value, but it's not used by Better Uptime)
  9. Select severities you want to report to Better Uptime
  10. Click Add to save the media options
  11. Click Add again to save the user

4. Create a new Action in Configuration > Actions

  1. Click on Create action in the upper right corner
  2. Enter the Name: Better Uptime Action
  3. (Optional) Restrict the action by adding your own conditions.
  4. Switch to the Operations tab
  5. Change Default operation step duration to 1m
  6. Under Operations, click Add
  7. Select Better Uptime user in the Send to Users field
  8. Select Better Uptime in the Send only to select box
  9. Check Custom message and input the Operational message found below to the Message field (you can leave the Subject empty).
  10. Click Add to save the operation
  11. Repeat steps 30. - 34. for Recovery operations and Update operations, filling their respective messages
  12. After filling Recovery and Update operations, click Add to save the action