The built-in Zabbix Notifications trigger initiates a flow when it receives a signal from a Zabbix Trigger.
Add the Zabbix Notifications trigger to the canvas
- Go to the Triggers tab in the palette, expand the App Triggers section, and drag the trigger onto the canvas.
- Double-click the trigger (or click the pencil icon).
- Set the authenticating user, and then copy the URL — you'll use this to set up the webhook in Zabbix. Alternatively, you can create an integration user to use as the authenticating user.
- Click the Flood Control tab to edit the trigger's default flood control settings. For more information about these settings, see Trigger Flood Control.
- Click Done.
- On the flow canvas, connect the steps you want to run when xMatters receives a request to that URL.
You're now ready to configure Zabbix to target the trigger.
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.
- 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:
- 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.
The trigger has the following outputs you can use as inputs to steps further along the flow.
|Recipients||List of targeted recipients.|
|Signal Mode||Determines the flow path to follow, based on the value of the Event Value parameter.|
|Signal ID||Key or identifier used to terminate or correlate events or signals|
Whether or not the event is acknowledged in Zabbix. Valid value are:
|Date||Date the event was initiated.|
|Event ID||Unique ID of the event in Zabbix.|
|Event Name||Name of the event as provided by Zabbix.|
Severity of the event. Valid values are:
|Operational Data||Data that triggered the event in Zabbix.|
|Tags||Comma-separated list of event tags provided by Zabbix.|
|Time||Time the event was initiated in Zabbix.|
Whether or not the notification is an event update in Zabbix. Valid values are:
|State||Whether the event is open or resolved in Zabbix.|
|Host IP||IP of the host that triggered the Zabbix event.|
|Host Name||Name of the host that triggered the Zabbix event.|
|Trigger Description||Description of the trigger that created the Zabbix event.|
|Trigger ID||Unique ID of the trigger that created the Zabbix event.|
|Raw Request||JSON representation of the request that can be parsed separately to get additional context on outputs.|