Setting up Zabbix to integrate with Request Tracker

Our goal is to define a Zabbix action step that, when executed, will:

  • Create a ticket with all the relevant event information
  • Link the ticket back to the Zabbix event that generated it
  • Acknowledge the event with a link to the ticket just created

While the first point can be covered with a simple e-mail action to RT, we need custom code to take care of the other two. The best way to do this is to define a new media type in Zabbix as a custom alert script. The script will do the following:

  • Take the action message
  • Parse it to extract relevant information
  • Create a ticket with all custom fields and link the referrals filled out
  • Get back the ticket ID
  • Write a link to the created ticket in the event's acknowledgment field

Before actually writing the script, let's create the media type and link it to a user (you can assign the media type to any user you want; the custom rt_tickets user has been used here, as shown in the following screenshot):

Setting up Zabbix to integrate with Request Tracker

While linking the media type to the user, use the RT base URL in the Send to field, so you won't need to define it statically in the script. This is shown in the following screenshot:

Setting up Zabbix to integrate with Request Tracker

Once saved, you'll see all relevant information at a glance in the Media tab, as shown in the following screenshot. Just after the URL address, you'll find the notification periods for the media and, after that, a six-letter code that shows the active severity levels. If you disabled any of them, the corresponding letter would be in gray:

Setting up Zabbix to integrate with Request Tracker

Now, let's create an action step that will send a message to our rt_tickets user through the custom media type. Needless to say, the rt_tickets user won't receive any actual message as the alert script will actually create an RT ticket, but all of this is completely transparent from the point of view of a Zabbix action. You can put any information you want in the message body, but, at the very least, you should specify the trigger name in the subject and the event ID, severity, hosts, and items in the body so that the script will parse them and fill them in the appropriate ticket fields. This is shown in the following screenshot:

Setting up Zabbix to integrate with Request Tracker

We are now ready to actually write the script and use it to create tickets from Zabbix.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.95.244