Book Image

Mastering Zabbix (Second Edition)

Book Image

Mastering Zabbix (Second Edition)

Overview of this book

Table of Contents (18 chapters)
Mastering Zabbix Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

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):

While linking...