Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Zabbix: Enterprise Network Montioring Made Easy

You're reading from   Zabbix: Enterprise Network Montioring Made Easy Ultimate open source, real-time monitoring tool

Arrow left icon
Product type Course
Published in Feb 2017
Publisher Packt
ISBN-13 9781787129047
Length 1327 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Rihards Olups Rihards Olups
Author Profile Icon Rihards Olups
Rihards Olups
Andrea Dalle Vacche Andrea Dalle Vacche
Author Profile Icon Andrea Dalle Vacche
Andrea Dalle Vacche
Patrik Uytterhoeven Patrik Uytterhoeven
Author Profile Icon Patrik Uytterhoeven
Patrik Uytterhoeven
Arrow right icon
View More author details
Toc

Table of Contents (51) Chapters Close

Zabbix: Enterprise Network Montioring Made Easy
Zabbix: Enterprise Network Montioring Made Easy
Credits
Preface
1. Getting Started with Zabbix FREE CHAPTER 2. Getting Your First Notification 3. Monitoring with Zabbix Agents and Basic Protocols 4. Monitoring SNMP Devices 5. Managing Hosts, Users, and Permissions 6. Detecting Problems with Triggers 7. Acting upon Monitored Conditions 8. Simplifying Complex Configurations with Templates 9. Visualizing Data with Graphs and Maps 10. Visualizing Data with Screens and Slideshows 11. Advanced Item Monitoring 12. Automating Configuration 13. Monitoring Web Pages 14. Monitoring Windows 15. High-Level Business Service Monitoring 16. Monitoring IPMI Devices 17. Monitoring Java Applications 18. Monitoring VMware 19. Using Proxies to Monitor Remote Locations 20. Encrypting Zabbix Traffic 21. Working Closely with Data 22. Zabbix Maintenance 23. Zabbix Configuration 24. Getting Around in Zabbix 25. Groups, Users, and Permissions 26. Monitoring with Zabbix 27. Testing with Triggers in Zabbix 28. Working with Templates 29. Data Visualization and Reporting in Zabbix 30. Monitoring VMware and Proxies 31. Autodiscovery 32. Zabbix Maintenance and API 33. Deploying Zabbix 34. Distributed Monitoring 35. High Availability and Failover 36. Collecting Data 37. Visualizing Data 38. Managing Alerts 39. Managing Templates 40. Handling External Scripts 41. Extending Zabbix 42. Integrating Zabbix Troubleshooting Being Part of the Community Upgrading and Troubleshooting Zabbix Bibliography
Index

Creating RT tickets from the Zabbix events


Zabbix will search for custom alert scripts in the directory specified by AlertScriptsPath in the zabbix_server.conf file. In the case of a default install, this would be ${datadir}/zabbix/alertscripts, and in Red Hat, it is set to /usr/lib/zabbix/alertscripts/.

This is where we will put our script called rt_mkticket.py. The Zabbix action that we configured earlier will call this script with the following three arguments in this order:

  • Recipient

  • Subject

  • Message

As we have seen, the content of the subject and the message is defined in the action operation and depends on the specifics of the event triggering action. The recipient is defined in the media type configuration of the user receiving the message, and it is usually an e-mail address. In our case, it will be the base URL of our Request Tracker installation.

So, let's start the script by importing the relevant libraries and parsing the arguments:


#!/usr/bin/python2
from pyzabbix import ZabbixAPI...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image