osidorenkov / zabbix-jira Goto Github PK
View Code? Open in Web Editor NEWPython module that allows you to create tasks in Jira by the trigger from Zabbix
License: MIT License
Python module that allows you to create tasks in Jira by the trigger from Zabbix
License: MIT License
Hi,
Issue registration works fine (graph also attached). But when problem resolved transition to Done doesn't work.
Interesting that script doesn't write to file jirabix.db.
Maybe we need to install additional software on server?
Hello all,
In our environment, we use Zabbix 4.0.1 / CentOS7
We would like to reach Jira Cloud and open/close tickets. I applied the steps but I'm receiving this error.
WARNING:root:Got recoverable error from GET https://xxxxxx.atlassian.net/rest/api/2/serverInfo, will retry [1/3] in 0.96207812462s. Err: 401
Then I created a API Token by following Jira documentation. Then I changed the config.py as below.
jira_server = 'https://xxxxxxxx.atlassian.net'
jira_user = '[email protected]:TOKEN_ID'
jira_pass = 'Password'
Then I used the command to create test ticket.
python jirabix.py "[email protected]:TOKEN_ID" "ZBX TEST" "Mesaj govdesi"
Still I'm receiving the same error message.
Could you help me please ?
Best regards.
Hello,
does this script work with zabbix 4.2 ?
I copied the script and created media types and actions (Administration -> Create Action (Event source Internal )) according to readme.
I will add that when it performs the test the ticket is created.
Regards,
Piotr
Hello,
creating a test ticket in JIRA v8.4.2 works wonderfully just because script doesn't come back.
After a long, long wait I get the following messages:
WARNING:root:Got recoverable error from GET https://jira.domain.de/rest/api/2/issue/ZBX-5, will retry [1/3] in 8.50127465586s. Err: 502 Proxy Error
WARNING:root:Got recoverable error from GET https://jira.domain.de/rest/api/2/issue/ZBX-5, will retry [2/3] in 25.7807044327s. Err: 502 Proxy Error
WARNING:root:Got recoverable error from GET https://jira.domain.de/rest/api/2/issue/ZBX-5, will retry [3/3] in 21.7523551016s. Err: 502 Proxy Error
Traceback (most recent call last):
File "./jirabix.py", line 230, in
main()
File "./jirabix.py", line 203, in main
config.jira_issue_type, priority)
File "./jirabix.py", line 33, in create_issue
return jira.create_issue(fields=issue_params).key
File "/usr/lib/python2.7/site-packages/jira/client.py", line 1113, in create_issue
return self.issue(raw_issue_json['key'])
File "/usr/lib/python2.7/site-packages/jira/client.py", line 1071, in issue
issue.find(id, params=params)
File "/usr/lib/python2.7/site-packages/jira/resources.py", line 201, in find
self._load(url, params=params)
File "/usr/lib/python2.7/site-packages/jira/resources.py", line 316, in _load
r = self._session.get(url, headers=headers, params=params)
File "/usr/lib/python2.7/site-packages/jira/resilientsession.py", line 151, in get
return self.__verb('GET', url, **kwargs)
File "/usr/lib/python2.7/site-packages/jira/resilientsession.py", line 147, in __verb
raise_on_error(response, verb=verb, **kwargs)
File "/usr/lib/python2.7/site-packages/jira/resilientsession.py", line 57, in raise_on_error
r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError: JiraError HTTP 502 url: https://jira.domain.de/rest/api/2/issue/ZBX-5
text:
The proxy server received an invalid
response from an upstream server.
The proxy server could not handle the request GET /rest/api/2/issue/ZBX-5.
Reason: Error reading from remote server
response headers = {'content-length': '423', 'keep-alive': 'timeout=100, max=94', 'server': 'Apache/2.4.6 () OpenSSL/1.0.2k-fips mod_auth_gssapi/1.5.1 mod_auth_kerb/5.4 PHP/7.3.10', 'connection': 'Keep-Alive', 'date': 'Mon, 18 Nov 2019 14:10:10 GMT', 'content-type': 'text/html; charset=iso-8859-1'}
response text = <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
The proxy server received an invalid
response from an upstream server.
The proxy server could not handle the request GET /rest/api/2/issue/ZBX-5.
Reason: Error reading from remote server
Hi
graph attachment is not working of zabbix, and transition state is not changing to done in jira
JIRA version v7.11.1
zabbix version v3.0.20
thanks in advance
When Zabbix fires an recovery alert, the Jira issue is not transitioned to Done. I adjusted the transition ID so it should be okay.
Hi, I use jirabix on zabbix 4.2.
it works normally with High triggers but it can't create disaster triggers. I create it in my jira project but I got the following message in action message:
Traceback (most recent call last):
File "/usr/local/share/zabbix/alertscripts//jirabix.py", line 231, in
main()
File "/usr/local/share/zabbix/alertscripts//jirabix.py", line 204, in main
config.jira_issue_type, priority)
File "/usr/local/share/zabbix/alertscripts//jirabix.py", line 34, in create_issue
return jira.create_issue(fields=issue_params).key
File "/usr/lib/python2.7/site-packages/jira/client.py", line 1107, in create_issue
r = self._session.post(url, data=json.dumps(data))
File "/usr/lib/python2.7/site-packages/jira/resilientsession.py", line 154, in post
return self.__verb('POST', url, **kwargs)
File "/usr/lib/python2.7/site-packages/jira/resilientsession.py", line 147, in __verb
raise_on_error(response, verb=verb, **kwargs)
File "/usr/lib/python2.7/site-packages/jira/resilientsession.py", line 57, in raise_on_error
r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError: JiraError HTTP 400 url: https://myjirasite.com/rest/api/2/issue
text: This priority is not available for this project.
response headers = {'Content-Length': '96', 'X-AUSERNAME': 'ZabbixTicket', 'X-AREQUESTID': '594x968418x1', 'X-XSS-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Content-Security-Policy': "frame-ancestors 'self'", 'Content-Encoding': 'gzip', 'X-Seraph-LoginReason': 'OK', 'Vary': 'User-Agent', 'X-ASESSIONID': '1dgok5l', 'Connection': 'close', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Wed, 01 Jan 2020 06:24:54 GMT', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Type': 'application/json;charset=UTF-8', 'X-ASEN': 'SEN-L14752448'}
response text = {"errorMessages":[],"errors":{"priority":"This priority is not available for this project."}}
requests.exceptions.SSLError: HTTPSConnectionPool(host='127.0.0.1', port=443): Max retries exceeded with url: / (Caused by SSLError(CertificateError("hostname '127.0.0.1' doesn't match either of '*.crevgo.com', 'crevgo.com'",),))
From command line execution, I get this error (warning):
(...)
raise TypeError("quote_from_bytes() expected bytes")
Solution:
# title = requests.utils.quote(title) title = requests.utils.quote(str(title))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.