mortn / zabbix2zendesk

Python script that open and close Zendesk tickets based on Zabbix trigger notifications.
7 stars 4 forks source link

Please explain how to install correctly #2

Closed dstyles-jg closed 4 years ago

dstyles-jg commented 4 years ago

This script looks VERY useful and to be exactly what I need. However, like the previous person I am not sure on how to configure this correctly and would like to understand how to get this working correctly. Kind Regards DS

OmniTroid commented 4 years ago

Hey, I'm looking to use this as well. However, from the code I see a number of issues.. for example it assumes the Zabbix database is MySQL. I also doubt this would run with Python 3. It's likely that I will reprogram it, though

dstyles-jg commented 4 years ago

Hey, I'm looking to use this as well. However, from the code I see a number of issues.. for example it assumes the Zabbix database is MySQL. I also doubt this would run with Python 3. It's likely that I will reprogram it, though

@OmniTroid I would be VERY interested in this - my python isn't great - my zabbixdb is MariaDb/MySql - however, I would think for the script to be useful to more than just mySQL users it would need multiDB connectivity and so on...

I'm happy to help test and get this up and running if you are happy to put some work in? I am can spin up zabbix VMs in minutes.. real easy for me to test this stuff and bug check.

OmniTroid commented 4 years ago

This is what we have right now: https://github.com/Horze-International/zabbix_zendesk_alerts/tree/master

It's a dead simple script based on the zenpy Python module. The idea is to add a close ticket action that is triggered when the corresponding problem in Zabbix is resolved.

dstyles-jg commented 4 years ago

Took a quick look and I can see where you’re going with this.. I’m still unclear of how I run this – do I plonk it on the Zabbix server, configure it and set up a Cron to run it periodiocally?

So.. – the way we’ve setup our Zabbix monitoring, is that we have certain alerts (High Priority and above) send emails DIRECTLY to zendesk which, of course, creates a ticket. Some of these issues will “auto resolve” - let’s use free disk space on a SQL server as an example – the trigger sends the alert when free disk space drops below 10%. The server does it scheduled clean up and this brings the free disk space back up to.. let’s say 18%.. this triggers the “resolved” alert… which again sends email to Zendesk – now I have 2 tickets for the same issue.. I am able to merge them.. or investigate etc… in our business.. if it’s not a ticket in Zendesk.. then it doesn’t exist.. 😉 – in the ideal world.. there would be something that existed that was able to close the initial ticket sent when the disk space dropped.. without sending the second mail.. OR merging the “problem” and “resolved” tickets and marking them “solved” – the fact the ticket was “self closed” is enough for me to know the problem was resolved if that makes sense? Alternatively, I can actually live with a situation where the initial ticket gets closed and the “resolved” ticket is left open waiting for human interaction as this forces me to check the list and I am made to pay attention to what has been occurring on the “automated” side of the business..

I hope I’m making sense here?

OmniTroid commented 4 years ago

Yes, though the script leverages Zendesk's API directly. I have now updated the code so it has a "solve_ticket" action, which should close the ticket with the corresponsing subject automatically. This can then be added to the recovery action in Zabbix to enable the behavior you're describing.

dstyles-jg commented 4 years ago

That sounds absolutely perfect. I'll get it installed and do some testing. I think any further conversation should probably take place over on your project page ;)