Creates or updates a ticket on JIRA from Zabbix alarms
Purpose
zabbix2jira is a simple command line program that receives an action from Zabbix (or any other script) and creates (or updates) a ticket on a project inside a JIRA installation.
Installation
Use the following command under the program directory:
$ pip install -e .
We recommend using virtualenv to setup a self-contained app directory. In this case, you should use:
$ virtualenv env $ source env/bin/activate $ pip install -e .
If you want to see which libraries this application uses, please check the requirements.txt file.
Usage
Default paths:
Configuration: /etc/zabbix2jira.cfg
Log: /var/log/zabbix2jira.log
Cache Directory: /var/cache/zabbix2jira
To run it, activate virtualenv first:
$ source env/bin/activate $ zabbix2jira -h
Configuration
The command itself uses some default configuration, but you will want to configure a file to configure your jira url, username and password.
Simply copy the sample-config.cfg file to the default configuration path (/etc/zabbix/zabbix2jira.cfg) or copy to any location and use the -c parameter at the CLI call.
The file itself is self-explanatory.
Zabbix Integration
Create an action that calls the script with the proper variables.
We create a action named zabbix2jira with the conditions:
A Maintenance status not in maintenance
B Trigger value = PROBLEM
C Trigger value = OK
And with calculation: A and (B or C). Pay attention to the (B or C) because we want to run the action both on alarm and recovery.
Note: this changed on Zabbix 3.2. You can skip and B and C conditions because on this version, problem and recovery operations are separate.
Then on the Operations Tab, create a step that executes a Custom script on the Zabbix Server with the following commands:
zabbix2jira -v -i {EVENT.ID} PROJECT {TRIGGER.STATUS} "[Zabbix Alert] {HOSTNAME} - {TRIGGER.NAME}" "Alert Details"
You can also use the script as a user media and send a message to it.
Note that if using a virtualenv setup, activate it before the previous command:
source /opt/z2d/env/bin/activate
Examples
Here are some examples for running zabbix2jira.
Create an issue with component Alert:
zabbix2jira -v -p Alert PROJECT PROBLEM "[Zabbix Alert] PROBLEM" "Alert Details"
With the zabbix backend enabled, track the event id (123) to acknowledge it:
zabbix2jira -v -i 123 PROJECT PROBLEM "[Zabbix Alert] PROBLEM" "Alert Details"
Recover the previous issue:
zabbix2jira -v -i 123 PROJECT OK "[Zabbix Alert] PROBLEM "Alert Details"
Create an issue with type Bug:
zabbix2jira -v -t Bug PROJECT PROBLEM "[Zabbix Alert] PROBLEM" "Alert Details"
Release files for zabbix2jira 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zabbix2jira-0.2.1.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zabbix2jira-0.2.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 17.1 kB
Release files / zabbix2jira-0.2.1.tar.gz
| Download URL | zabbix2jira-0.2.1.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da1281acdcaab0dfb238e0098ebce19f1678c128164506a919f2c1e6ee6e428f
|
|
BLAKE2b-256 checksum How to use checksums |
3ed3dc3cb17243b38226329dab68e52e27fd5c8ceee2743333432fa846922b4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / zabbix2jira-0.2.1-py2.py3-none-any.whl
| Download URL | zabbix2jira-0.2.1-py2.py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f2a9c60a23007d62e2b27d99aabccd40bbccaf2e58673dadade71e6883a7e8dd
|
|
BLAKE2b-256 checksum How to use checksums |
f5be06a2d26a5fda8e5b09e11799dd01ec8f033e9edb4a2803558001572ce417
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |