IT运维管理,ITIL,ITSS,ITSM,ISO20000-ITIL先锋论坛

 找回密码
 立即注册 - 请先获取邀请码

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 129|回复: 0

[Zabbix专区] 简述Jira与Zabbix结合

[复制链接]
来自- 广东广州

参加活动:0

组织活动:12

发表于 2017-8-28 17:01:14 | 显示全部楼层 |阅读模式 来自- 广东广州
zabbix-jira
zabbix-jira is python module that allows you to create tasks in Jira with grafs by the trigger from Zabbix.
Requirements:
  • python >= 2.7
  • python libs: requests, jira

Installation:
  • Copy this repo to your zabbix-server: git clone https://github.com/OSidorenkov/zabbix-jira.git
  • Copy jirabix.py to your Zabbix AlertScriptsPath directory (see your zabbix_server.conf)
  • Create and configure config.py near jirabix.py. You can take as an example config.py.example from repo.
  • Install python libs: pip install requirements.txt

Configuration:
  • Create new media type in Zabbix:

0?wx_fmt=png.jpg
If you use Zabbix 3.0 and higher, add this parameters:
{ALERT.SENDTO}{ALERT.SUBJECT}{ALERT.MESSAGE}
  • Add this media to your read user in Zabbix

0?wx_fmt=png.jpg
Add in "Send to" field jira username (see the profile user in Jira)
  • Configure your Actions:

0?wx_fmt=png.jpg
Example message:
Last value:{ITEM.VALUE1} ({TIME})zbx;graphszbx;graphs_period=1800zbx;itemid:{ITEM.ID1}zbx;triggerid:{TRIGGER.ID}zbx;title:{HOST.HOST} - {TRIGGER.NAME}zbx;priority:{TRIGGER.SEVERITY}Server: {HOSTNAME} ({HOST.IP})Desc:{TRIGGER.DESCRIPTION}
0?wx_fmt=png.jpg
Example recovery message:
Server: {HOSTNAME} ({HOST.IP})zbx;triggerid:{TRIGGER.ID}zbx;ok:1Descriptionroblem resolved!Time of resolved problem: {DATE} {TIME}Annotationszbx;graphs -- enables attached graphszbx;graphs_period=10800 -- set graphs period (default - 3600 seconds)zbx;graphs_width=700 -- set graphs width (default - 900px)zbx;graphs_height=300 -- set graphs height (default - 300px)zbx;itemid:{ITEM.ID1} -- define itemid (from trigger) for attachzbx;title:{HOST.HOST} - {TRIGGER.NAME} -- graph titlezbx;triggerid:{TRIGGER.ID} -- define triggerid to link problem and recovery of eventzbx;priority:{TRIGGER.SEVERITY} -- set priority task like as priority of trigger from Zabbixzbx;ok:1 -- use this parameter only in RECOVERY message, if you don't want create a new task about recovery in Jira
You can use Jira format text in your actions: https://jira.atlassian.com/secur ... on.jspa?section=all
Test script
You can use the following command to create a ticket in Jira from your command line:
python jirabix.py "jira_username" "ticket_subject" "ticket_desc" where
  • jira_username - username from Jira user profile
  • For ticket_subject and ticket_desc you may use "test" "test"

    • If you want to test real text from zabbix action message copy test/entry.txt from repo and change the contents of the file on your real data and change jirabix.py like this:
      0?wx_fmt=png.jpg
      And run:
      python jirabix.py "jira_username" "ticket_subject

Result
  • See how creates the ticket with graf from Zabbix:



  • When problem is going to OK, script convert the ticket to "Done" status with comment from zabbix recovery message:





原创:成小编

本版积分规则

团购课程最新动态

 

 

高品质!好口碑!

百分百通过率!

PeopleCertEXIN

国际授权资质!

ITIL Foundation北上广

2天精华班,包证书

ITIL Foundation三天精

讲,知名讲师,包证书

ITIL Expert 金牌讲师北

上广深11天,包证书

DevOps Foundation

2天热点认证班,包证书

ITSS 认证IT服务经理

4天课程,包证书

Prince2双证4天高级班

Cobit高端课程2天班

Togaf高端课程4天班

 

报名热线: 4008-060-230


QQ|小黑屋|手机版|Archiver|ITIL先锋论坛万人社区 ( 粤ICP备17056641号|网站地图

Baidu

GMT+8, 2018-2-22 18:46 , Processed in 0.254895 second(s), 37 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表