Zabbix
How it works
When a test meets a specified threshold in Zabbix, it sends a JSON-formatted webhook to xMatters. A Zabbix trigger in xMatters parses the webhook and initiates a flow. The webhook includes essential alert data you can use to enrich notifications to users or when building automated tasks.
Install the workflow
Here's how to install the Zabbix workflow through the xMatters one-click installation process.
- Go to the Workflows Templates page and click the Zabbix tile.
- On the Set up the Workflow tab, give the workflow a name that identifies its purpose (this must be unique in your instance), add an optional description, and set the default incident type (if applicable). Any built-in Initiate Incident steps in the workflow will automatically be set to the selected incident type.
- You can edit these later, if needed.
- Click Next to set up the connection.
- Choose the authentication method. A trigger URL is generated based on the selected authentication method.
- Copy the trigger URL — you’ll use this to configure the webhook in Zabbix.
- The trigger URL includes the recipients parameter, which specifies who should be notified. By default, this parameter is set to notify you (the logged in user), but you can set it to target any user or group you want.
- Send a test signal to the trigger URL to test the connection.
- Click Open Workflow to view and customize the workflow, or Close to return to the Workflows page.
Configure Zabbix to send requests to the trigger URL
To have Zabbix send alerts to the flow trigger, you need to configure a webhook and set it to use the trigger URL.
- Download the xMatters_media_type.xml to an easy-to-find location on your computer.
- In Zabbix, go to the Alerts menu and select Media Types.
- Click Import.
- Navigate to the xMatters_media_type.xml file on your system and select it to import.
- Once imported, edit the file by selecting it from the list.
- In the Parameters section, go to the xm_url parameter and add the trigger URL you copied from Flow Designer to the Value field.
- Add the target names of any recipients you want xMatters to notify when the alert fires to the end of the URL.
- For URL authentication, use an ampersand to attach recipients. For example, if you want to notify Emma Pearson and the on-call members in the group responsible for the Antares service, you'd add &recipients=epearson,antares to the URL.
- For other authentication types, use a question mark to attach recipients. For example, if you want to notify Barry Gull and the on-call members in the group responsible for the Cassiopeia service, you'd add ?recipients=bgull,cassiopeia to the URL.
- You must URL-encode any special characters or spaces in the target names.
- If you're using Basic or API Key authentication, update the xm_auth field with your Base64 encoded username and password, or API key and secret. You can create a Base64 encoded username and password at https://www.base64encode.org/ or by typing echo “username:password” | base64 into a terminal.
- Click Update to save the file.
Now you need to create an xMatters user in Zabbix.
- In Zabbix, go to Users > Users > Create User.
- Click Create user.
- On the User tab, enter the following information:
- Username: xMatters
- Name: xMatters
- Last Name: API
- Groups: Select any group available in your instance of Zabbix
- Password: Set a password for this user
- Password (once again): Confirm the password. Remember the password as it is required in further steps.
-
Click Add.
- Go to the Media tab, click Add at the top of the page and enter the following information (the other fields can be left with the default information):
- Type: xMatters
- Send to: xMatters
- Click Add.
- Go to the Permissions tab. In the Role field type Super admin role.
- The page populates with information related to the Super admin role. Click Update to save all changes.
You now need to create an action in Zabbix.
- In Zabbix, go to Alerts > Actions and select Trigger Action.
- Create a new action and give it a unique Name. You can also modify existing actions.
- Create the Conditions for the action.
- Go to the Operations tab
- For each of the following sections on the page click Add and add xMatters as a user to the Send to users section:
- Operations
- Recovery operations
- Update operations.
- Click Update for each section.
The Actions window should have "Send message to users: xMatters (xMatters API via all media" in each section.
- Click Update on the Actions window to save all changes.
You're ready to use the webhook to trigger automated flows, including steps such as sending alerts and initiating incidents, though we always recommend testing before putting things into use.
Set recipients in the trigger URL
The trigger expects the recipients in the trigger URL. When you copy the URL from xMatters, it includes the recipients parameter: recipients=<yourname>. Of course, you don’t want to receive all the alerts.
To change the recipients for alerts from this webhook, swap out your name for the people or groups you want to target.
- For URL authentication, use an ampersand to attach recipients. For example, if you want to notify Emma Pearson and the on-call members in the group responsible for the Antares service, you'd add &recipients=epearson,antares to the URL.
- For other authentication types, use a question mark to attach recipients. For example, if you want to notify Barry Gull and the on-call members in the group responsible for the Cassiopeia service, you'd add ?recipients=bgull,cassiopeia to the URL.
Remember to URL-encode any special characters, including spaces, in your group names.
We recommend using groups so you can take advantage of the xMatters group features — rotations, escalations, and absences — to reach the right on-call people to jump on an issue.
How to use the workflow
When a condition you've set fires, it sends a signal to xMatters, which creates an alert and notifies the individual or the on-call members of the people or groups you set as recipients in the webhook URL. When the trigger receives a signal saying the issue is resolved, it automatically terminates related alerts in xMatters.
The person responding to the notification has the following response options:
- Acknowledge: Acknowledges the notifications and stops escalations.
- Escalate: Immediately escalates the alert to the next on-call resolver in a targeted group.
- Close: Ends the xMatters alert and stops notifying all targeted recipients.
- Initiate Incident: Initiates an incident in xMatters.
Next Steps
Now that you've installed the Zabbix workflow, you can use it as-is, or customize it to suit your needs better. Here are some examples of things you can add to the workflow to customize it:
- Use Slack, Zoom, and Microsoft Teams steps to add collaboration channels to the flow.
- Change the severity of incidents created when a recipient selects the Initiate Incident response.
- Update the message sent to resolvers to include the information most relevant to your team.
- Use the Zabbix Alerts trigger to build your own custom flows.