Zabbix と統合する
統合でできるようになること
Integration leverages Jira Service Management's Zabbix-specific executable and (Jira Edge Connector (JEC) utility to automatically create rich alerts and synchronize alert status between Zabbix and Jira Service Management. Zabbix alarms are acknowledged automatically when the alert is acknowledged in Jira Service Management. Jira Service Management Zabbix plugin is the recommended integration method as it enables Zabbix to take advantage of advanced capabilities provided by Jira Service Management.
統合による機能
When users acknowledge an alert from their mobile devices using the Jira Service Management app, the alert is acknowledged in Zabbix.
統合をセットアップする
Zabbix is a bidirectional integration. Setting it up involves the following steps:
Add a Zabbix integration in Jira Service Management
Configure the integration in Zabbix
Zabbix プラグインをインストールする
Following are the steps to integrate Jira Service Management and Zabbix using the Jira Service Management Zabbix integration plugin. Note that these instructions may need slight alteration depending on the exact Linux distribution and the Zabbix configuration.
前提条件
Download the latest version of the Zabbix plugin package from Github Releases: zabbix · Releases · atlassian/jsm-integration-scripts
パッケージは以下のシステムに対応しています。
RedHat ベースの Linux ディストリビューション
Debian ベースの Linux ディストリビューション
RedHat ベースのディストリビューションの場合
Get the rpm package corresponding to the RedHat version you are using:
If running RedHat Enterprise Linux 6 (or variants), get:
jsm-zabbix-<your_version>.rhel6.<architecture>.rpm
For newer versions of RedHat, get:
jsm-zabbix-<your_version>.<architecture>.rpm
After downloading, run the following command: rpm -i <downloaded_package>.rpm
アップグレード中、rpm パッケージは既存の設定を上書きしません。新しい既定の設定ファイルは jsm-integration.conf.rpmnew として保存されます。rpm アップグレード設定ファイルの処理についてはこちらをご確認ください。バージョン 201X-XX-XX から 2.X.X にアップデートするには、--force
パラメーターを追加します。次に例を示します。
rpm -U --force jsm-integration-<your_version>.rpm
アップデートする前に設定ファイルをバックアップしてください。
Debian ベースのディストリビューションの場合
次のコマンドを実行します。 dpkg -i jsm-zabbix_<your_version>_<architecture>.deb
Zabbix 統合を追加する
双方向統合は Free プランと Standard プランではサポートされていません。他のすべての統合は Free と Standard でチーム レベルでサポートされています。ただし、送信統合を機能させるには、上位のプランにアップグレードする必要があります。Settings
(歯車アイコン) > Products
(Jira 設定の下) > OPERATIONS
からサイト レベルで統合を追加できるのは、Premium プランと Enterprise プランのみです。
統合をチームの運用ページから追加すると、そのチームが統合の所有者になります。つまり、Jira Service Management は、この統合を通じて受信したアラートをチームにのみ割り当てます。
To add a Zabbix integration in Jira Service Management:
チームの運用ページに移動します。
左側のナビゲーション パネルで、[統合] > [統合を追加] の順に選択します。
Run a search and select “Zabbix”.
次の画面で、統合の名前を入力します。
オプション: 特定のチームが統合からのアラートを受信するようにする場合は、[Assignee team (担当者チーム)] のチームを選択します。
[Continue] を選択します。
この時点で、統合が保存されます。[統合をオンにする] を選択します。
統合のために作成したルールは、統合をオンにした場合にのみ機能します。
Zabbix でプラグインを設定する (Zabbix バージョン 3.0 以下)
The plugin uses a golang-executable file (included in the plugin as send2jsm) to create, acknowledge, and close alerts in Jira Service Management. Configure Zabbix to execute this file on events to create, acknowledge, and close alerts in Jira Service Management. Configure an action via the Zabbix frontend, that executes /home/jsm/jec/scripts/send2jsm when an event is triggered.
Under Actions enable "Recovery Message" checkbox for closing the alert on Jira Service Management when an alert is closed on Zabbix.
Under Operations, define a Remote Command that executes on Zabbix server. Paste the command in */home/jsm/jec/scripts/actionCommand.txt into Command.
[Add (追加)]、[Save (保存)] の順に選択します。
Check Send2Jsm Configuration.
Configure the plugin in Zabbix (For Zabbix version 3.2 to 6.2)
The plugin uses a golang-executable file (included in the plugin as send2jsm) to create, acknowledge, and close alerts in Jira Service Management. Configure Zabbix to execute this file on events to create, acknowledge, and close alerts in Jira Service Management.
Configure an action via the Zabbix frontend, that executes */home/jsm/jec/scripts/send2jsm when an event is triggered.
[設定] > [アクション]、[Create New Action (新規アクションの作成)] の順に選択します。
[Actions (アクション)] で [Operations (実行内容)] を選択します。
Under Operations, define a remote command that executes on Zabbix server.
*/home/jsm/jec/scripts/actionCommand.txt
のコマンドを [Command (コマンド)] に貼り付けます。[Actions (アクション)] で [Recovery Operations (復旧時の実行内容)] を選択します。
Under Recovery Operations, define a remote command that executes on Zabbix server.
*/home/jsm/jec/scripts/actionCommand.txt
のコマンドを [Command (コマンド)] に貼り付けます。[Add (追加)]、[Save (保存)] の順に選択します。
Check Send2Jsm Configuration.
Configure the plugin in Zabbix (For Zabbix version 6.4 and above)
The plugin uses a golang-executable file (included in the plugin as send2jsm) to create, acknowledge, and close alerts in Jira Service Management. Configure Zabbix to execute this file on events to create, acknowledge, and close alerts in Jira Service Management.
For new installations starting with Zabbix 7.0, global script execution is set to disabled
by default. To enable, set EnableGlobalScripts
from 0
to 1
in your Zabbix server configuration file (typically found in /etc/zabbix/zabbix_server.conf
) and restart your Zabbix instance.
Configure an action via the Zabbix frontend, that executes */home/jsm/jec/scripts/send2jsm when an event is triggered.
From the navigation menu, select Alerts > Scripts then select Create Script
Choose:
A user defined identifier as Name
Action Operation as Scope,
Script as Type
Zabbix Proxy or Server as Execute on
Paste the command stored in
/home/jsm/jec/scripts/actionCommand.txt
into Commands.[追加] を選択します。
From the navigation menu, select Alerts > Actions > Trigger Actions then select Create Action.
Fill the action settings as you please, then switch to the Operations tab.
Under Operations, select Add in the Operations table.
For Operation, select the script you created in Step 4 from the dropdown menu.
From Target List, check the box for Current Host.
追加 を選択します 。
Repeat the steps 7 through 10 for the Recovery Operations and Update Operations tables.
追加 を選択します 。
Check Send2Jsm Configuration.
Send2Jsm Configuration
send2jsm を動作させるには、いくつかの追加設定を行います。以下の表は、パラメーター、パラメーターが配置されている場所、およびそれらの入力が必須であるかどうかをまとめたものです。
設定パラメーター | 説明 | 入力必須 | 場所 |
---|---|---|---|
API キー | Copy the API key from the Zabbix integration you've created above. send2jsm uses this key to authenticate to Jira Service Management. API key is also used to identify the right integration configuration that should be used to process alerts. | はい | /home/jsm/jec/conf/jec-config.json |
ベース URL | If you're using Jira Service Management from another domain(eg. EU, sandbox), you should update this configuration. Jira Service Management Zabbix integration, Advanced Settings page. | 任意 | /home/jsm/jec/conf/jec-config.json |
responders | Responders field is used to specify who should be notified for the Zabbix alerts. This field is used to set the default responders field value. The recipients can be modified to route different alerts to different people and teams in Jira Service Management Zabbix integration, Advanced Settings page. Recipients can be set to users, groups, escalations or schedules who will be notified by Jira Service Management. If you did not set responders in the integration, this field is required.schedules who will be notified by Jira Service Management. If you did not set recipients in the integration, this field is required. | 任意 | /home/jsm/jec/conf/jsm-integration.conf |
tags | tags フィールドは、Jira Service Management で作成されたアラートのタグを指定するために使用されます。 | 任意 | /home/jsm/jec/conf/jsm-integration.conf |
logPath | ログ ファイルの完全なパスを指定します (既定値は /var/log/jsm/send2jsm.log)。 | 任意 | /home/jsm/jec/conf/jsm-integration.conf |
zabbix2jsm.http.proxy.enabled | zabbix2jsm.http.proxy.enabled フィールドは外部プロキシの設定を有効または無効にするためのものです。既定値は false です。 | 任意 | /home/jsm/jec/conf/jsm-integration.conf |
zabbix2jsm.http.proxy.host | これは、プロキシのホストです。 | 任意 | /home/jsm/jec/conf/jsm-integration.conf |
zabbix2jsm.http.proxy.port | プロキシのポートです。 | 任意 | /home/jsm/jec/conf/jsm-integration.conf |
zabbix2jsm.http.proxy.scheme | これは、プロキシ接続プロトコルです。プロキシ サーバーによって、http または https になる場合があります。既定値は http です。 | 任意 | /home/jsm/jec/conf/jsm-integration.conf |
zabbix2jsm.http.proxy.username | プロキシ認証ユーザー名です。 | 任意 | /home/jsm/jec/conf/jsm-integration.conf |
zabbix2jsm.http.proxy.password | これは、プロキシ認証パスワードです。 | 任意 | /home/jsm/jec/conf/jsm-integration.conf |
Special characters (except triggerUrl, ipAddress, date, and time fields) are removed from Zabbix incoming payload before data is processed in Jira Service Management.
追加のカスタム引数を送信する場合は、customArgName1 customArgValue1 customArgName2 customArgValue2 のようにフラグの後に追加します。入力フィールドの必要な場所に {{_payload.customArgName}}
を追加することで、カスタム引数を解析できます。
省略可: Zabbix 統合を設定する
Use JEC and the Zabbix script to update alerts on Zabbix. This enables deployment of your own scripts/ability to modify the ones provided and execute customized actions on Zabbix. To be able to execute actions in Zabbix, JEC gets the configuration parameters from the configuration file. The configuration file can be found under /home/jsm/jec/conf/jec-config.json
設定パラメーター | 説明 | 場所 |
---|---|---|
command_url | The Zabbix API endpoint to acknowledge Zabbix alerts. | /home/jsm/jec/conf/jec-config.json |
ユーザー | The username that JEC used to authenticate to Zabbix. | /home/jsm/jec/conf/jec-config.json |
パスワード | The password that JEC uses to authenticate to Zabbix. | /home/jsm/jec/conf/jec-config.json |
filePath | The script JEC uses to execute actions on Zabbix. Change to the value matching with your Zabbix version:
| /home/jsm/jec/conf/jec-config.json |
ダウンロードしたパッケージには、/usr/local/bin にある JEC ユーティリティと、/home/jsm/jec/scripts にある JEC によって実行する必要があるスクリプトも含まれています。設定したら JEC を実行してください。JEC の実行方法については、こちらをご確認ください。
Zabbix integration package doesn’t support SSL v1.0. If your Zabbix Server has SSL v1.0, upgrade your SSL server.
よくある質問とトラブルシューティング
統合が機能しない場合は、このセクションを確認して、規定のガイドラインに従ってください。
1. Jira Service Management で Zabbix アラートが作成されない
シェルから次のテスト・コマンドを実行します。Jira Service Management でテスト・アラートが作成されているかどうかを確認してください。
テキスト
/home/jsm/jec/jsm-zabbix/send2jsm -triggerName='zabbix test alert' -triggerStatus='PROBLEM'
"Trace/breakpoint trap (トレース/ブレークポイント トラップ)" エラーが発生した場合: sendjsm プラグインにサーバー ディストリビューションとの互換性がないことを意味します。以下の「send2jsm のソースと再コンパイル」セクションに従い、特定のサーバー環境に従って send2jsm.go を再構築します。
If the alert is created in Jira Service Management: It means the integration is installed correctly. The problem might be that Zabbix is not executing the command.
そうでない場合: /var/log/jsm/send2jsm.log のログを確認してください。ログ ファイルから次のエラーを探します。
If "RestException[Could not authenticate.]" error occurs in the logs, it means Jira Service Management couldn't identify the api key. Check if the API key is set correctly, as explained in "Jira Service Management plugin configuration in Zabbix" in this article.
問題がはっきりしない場合は、プラグインのログ レベルをデバッグに設定してもう一度お試しいただき、お問い合わせフォームからログを送信してください。
/var/log/jsm/send2jsm.log ファイルがない場合、またはこのファイルにログがない場合は以下を確認してください。
First, make sure the Zabbix user has permission to write to /var/log/jsm directory. The installation package should automatically do this. If problems occur, execute:
chown -R zabbix:jsm /var/log/jsm.
Now check the Zabbix server logs at /var/log/zabbix/zabbix_server.log. See if there are error logs regarding send2jsm, and contact us with them.
send2jsm プラグインのログレベルを DEBUG に設定する
行 zabbix2jsm.logger=warning を zabbix2jsm.logger=debug に変更します (/home/jsm/jec/conf/jsm-integration.conf ファイル内)。
2. Jira Service Management でアラートを承認しても Zabbix アラームが承認されない
アラート ログを確認します。
If the "Posted [Acknowledge] action to Zabbix.." log does not appear, it means Jira Service Management didn't send the Acknowledge action to Zabbix. Check the integration configuration, it might not have matched the alert action.
「Posted [Acknowledge] action to Zabbix..」のみがログに記録されており、それ以降関連ログがない場合、JEC に接続の問題が発生している可能性があります。ログを確認してください。
3. Zabbix RPM パッケージを開けません
If while installing Zabbix's rpm package you get the following error:
テキスト
zabbix is obsoleted by (installed) zabbix-server-pgsql-4.0.13-1.el7.x86_64
zabbix is obsoleted by (installed) zabbix-agent-4.0.13-1.el7.x86_64
zabbix is obsoleted by (installed) zabbix-java-gateway-4.0.13-1.el7.x86_64
代わりに "rpm -i jsm-zabbix-1.0.4-rpm-x86-64.rpm --nodeps" を使用します。"is already installed (インストール済み)" エラーが表示された場合は、代わりに "rpm -i jsm-zabbix-1.0.4-rpm-x86-64.rpm --force" を使用してください。
send2jsm のソースと再コンパイル
実行可能ファイル send2jsm と send2jsm.go のソースは /home/jsm/jec/jsm-zabbix の下にあり、Jira Service Managment 統合用の GitHub リポジトリにもあります。実行可能ファイルの動作を変更するには、send2jsm.go を編集し、以下を使用してビルドします。
go build send2jsm.go
go のインストール方法についてはこちらをご確認ください。プラグインの実行可能ファイルは linux/386 システム用に構築されていることに注意してください。
この内容はお役に立ちましたか?