
# Jira Data Center by JMX

## Overview

This template is used for monitoring Jira Data Center health. It is designed for standalone operation for on-premises Jira installations.

This template uses a single data source, JMX, which requires JMX RMI setup of your Jira application and Java Gateway setup on the Zabbix side.
If you need "Garbage collector" and "Web server" monitoring, add "Generic Java JMX" and "Apache Tomcat by JMX" templates on the same host.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Jira Data Center 9.14.1
- Jira Data Center 9.12.4

## Configuration

> Zabbix should be configured according to the instructions in the [Templates out of the box](https://www.zabbix.com/documentation/7.0/manual/config/templates_out_of_the_box) section.

## Setup

Metrics are collected by JMX.
0. Deploy the Zabbix Java Gateway component ([instructions](https://www.zabbix.com/documentation/7.0/manual/concepts/java)).
1. Enable and configure JMX access to Jira Data Center. See documentation for [instructions](https://confluence.atlassian.com/adminjiraserver/live-monitoring-using-the-jmx-interface-939707304.html).
2. Assign the "Jira Data Center by JMX" template to the host with a JMX interface.
2. If your Jira installation requires authentication for JMX, set the values in the host macros `{$JMX.USERNAME}` and `{$JMX.PASSWORD}`.
3. (Optional) Set custom macro values and add macros with context for specific metrics following the macro description.
4. (Optional) Assign the "Generic Java JMX" template for garbage collector monitoring.
5. (Optional) Assign the "Apache Tomcat by JMX" template for web server monitoring.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$JMX.USER}|
User for JMX.
||
|{$JMX.PASSWORD}|
Password for JMX.
||
|{$JIRA_DC.LICENSE.USER.CAPACITY.WARN}|
User capacity warning threshold (%).
|`80`|
|{$JIRA_DC.DB.CONNECTION.USAGE.WARN}|
Warning threshold for database connections usage (%).
|`80`|
|{$JIRA_DC.ISSUE.LATENCY.WARN}|
Warning threshold for issue operation latency (in seconds).
|`5`|
|{$JIRA_DC.STORAGE.LATENCY.WARN}|
Warning threshold for storage write operation latency (in seconds).
|`5`|
|{$JIRA_DC.INDEXING.LATENCY.WARN}|
Warning threshold for indexing operation latency (in seconds).
|`5`|
|{$JIRA_DC.LLD.FILTER.MATCHES.HOMEFOLDERS}|
Used for storage metric discovery.
|`local\|share`|
|{$JIRA_DC.LLD.FILTER.NOT.MATCHES.HOMEFOLDERS}|
Used for storage metric discovery.
|`NO MATCH`|
|{$JIRA_DC.LLD.FILTER.MATCHES.INDEXING}|
Used for indexing metric discovery.
|`.*`|
|{$JIRA_DC.LLD.FILTER.NOT.MATCHES.INDEXING}|
Used for indexing metric discovery.
|`NO MATCH`|
|{$JIRA_DC.LLD.FILTER.MATCHES.ISSUE}|
Used for issue discovery.
|`.*`|
|{$JIRA_DC.LLD.FILTER.NOT.MATCHES.ISSUE}|
Used for issue discovery.
|`NO MATCH`|
|{$JIRA_DC.LLD.FILTER.MATCHES.MAIL}|
Used for mail server connection metric discovery.
|`.*`|
|{$JIRA_DC.LLD.FILTER.NOT.MATCHES.MAIL}|
Used for mail server connection metric discovery.
|`NO MATCH`|
|{$JIRA_DC.LLD.FILTER.MATCHES.LICENSE}|
Used for license discovery.
|`.*`|
|{$JIRA_DC.LLD.FILTER.NOT.MATCHES.LICENSE}|
Used for license discovery.
|`NO MATCH`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|DB: Connections: State|
The state of the database connection.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=state,name=value",Value]|
|DB: Connections: Failed per minute|
The count of database connection failures registered in one minute.

Units: fpm - fails per minute.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=failures,name=counter",Count]
**Preprocessing**

- Simple change: 
|
|DB: Pool: Connections: Idle|
Idle connection count of the database pool.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=pool,category03=numIdle,name=value",Value]|
|DB: Pool: Connections: Active|
Active connection count of the database pool.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=pool,category03=numActive,name=value",Value]|
|DB: Reads|
Database read operations from Jira per second.

Units: rps - read operations per second.
|JMX agent|jmx["com.atlassian.jira:type=db.reads",invocation\.count]
**Preprocessing**

- Change per second: 
|
|DB: Writes|
Database write operations from Jira per second.

Units: wps - write operations per second.
|JMX agent|jmx["com.atlassian.jira:type=db.writes",invocation\.count]
**Preprocessing**

- Change per second: 
|
|DB: Connections: Limit|
Total allowed database connection count.
|JMX agent|jmx["com.atlassian.jira:name=BasicDataSource,connectionpool=connections",MaxTotal]|
|DB: Connections: Active|
Active database connection count.
|JMX agent|jmx["com.atlassian.jira:name=BasicDataSource,connectionpool=connections",NumActive]|
|DB: Connections: Latency|
The latest measure of latency when querying the database.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=latency,name=value",Value]|
|License: Users: Get|
License data for the discovery rule.
|JMX agent|jmx.discovery[attributes,"com.atlassian.jira:type=jira.license"]
**Preprocessing**

- 
JavaScript: `The text is too long. Please see the template.`

|
|HTTP: Pool: Connections: Active|
The latest measure of the number of active connections in the HTTP connection pool.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=http,category01=connection,category02=pool,category03=numActive,name=value",Value]|
|HTTP: Pool: Connections: Idle|
The latest measure of the number of idle connections in the HTTP connection pool.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=http,category01=connection,category02=pool,category03=numIdle,name=value",Value]|
|HTTP: Sessions: Active|
The latest measure of the number of active user sessions.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=http,category01=connection,category02=sessions,category03=active,name=value",Value]|
|HTTP: Requests per minute|
The latest measure of the total number of HTTP requests per minute.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=http,category01=requests,name=value",Value]|
|Mail: Queue|
The latest measure of the number of items in a mail queue.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numItems,name=value",Value]|
|Mail: Queue: Error|
The latest measure of the number of items in an error mail queue.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numErrors,name=value",Value]|
|Mail: Sent per minute|
The latest measure of the number of emails sent by the SMTP server per minute.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numEmailsSentPerMin,name=value",Value]|
|Mail: Processed per minute|
The latest measure of the number of items processed by a mail queue per minute.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numItemsProcessedPerMin,name=value",Value]|
|Mail: Queue: Processing state|
The latest indicator of the state of a mail queue job.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=jobRunning,name=value",Value]|
|Entity: Issues|
The number of issues.
|JMX agent|jmx["com.atlassian.jira:type=entity.issues.total",Value]|
|Entity: Attachments|
The number of attachments.
|JMX agent|jmx["com.atlassian.jira:type=entity.attachments.total",Value]|
|Entity: Components|
The number of components.
|JMX agent|jmx["com.atlassian.jira:type=entity.components.total",Value]|
|Entity: Custom fields|
The number of custom fields.
|JMX agent|jmx["com.atlassian.jira:type=entity.customfields.total",Value]|
|Entity: Filters|
The number of filters.
|JMX agent|jmx["com.atlassian.jira:type=entity.filters.total",Value]|
|Entity: Versions created|
The number of versions created.
|JMX agent|jmx["com.atlassian.jira:type=entity.versions.total",Value]|
|Issue: Search per minute|
Issue searches performed per minute.
|JMX agent|jmx["com.atlassian.jira:type=issue.search.count",Value]
**Preprocessing**

- Simple change: 
|
|Issue: Created per minute|
Issues created per minute.
|JMX agent|jmx["com.atlassian.jira:type=issue.created.count",Value]
**Preprocessing**

- Simple change: 
|
|Issue: Updates per minute|
Issue updates performed per minute.
|JMX agent|jmx["com.atlassian.jira:type=issue.updated.count",Value]
**Preprocessing**

- Simple change: 
|
|Quicksearch: Concurrent searches|
The number of concurrent searches that are being performed in real-time by using the quick search.
|JMX agent|jmx["com.atlassian.jira:type=quicksearch.concurrent.search",Value]
**Preprocessing**

- Simple change: 
|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Jira Data Center: DB: Connection lost|
Database connection lost
|`max(/Jira Data Center by JMX/jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=state,name=value",Value],3m)=0`|Average|**Manual close**: Yes|
|Jira Data Center: DB: Pool: Out of idle connections|
Fires when out of idle connections in database pool for 5 minutes.
|`min(/Jira Data Center by JMX/jmx["com.atlassian.jira:type=metrics,category00=db,category01=connection,category02=pool,category03=numIdle,name=value",Value],5m)<=0`|Warning|**Manual close**: Yes|
|Jira Data Center: DB: Connection usage is near the limit||`100*min(/Jira Data Center by JMX/jmx["com.atlassian.jira:name=BasicDataSource,connectionpool=connections",NumActive],5m)/last(/Jira Data Center by JMX/jmx["com.atlassian.jira:name=BasicDataSource,connectionpool=connections",MaxTotal])>{$JIRA_DC.DB.CONNECTION.USAGE.WARN}`|Warning|**Manual close**: Yes|
|Jira Data Center: DB: Connection limit reached||`min(/Jira Data Center by JMX/jmx["com.atlassian.jira:name=BasicDataSource,connectionpool=connections",NumActive],5m)=last(/Jira Data Center by JMX/jmx["com.atlassian.jira:name=BasicDataSource,connectionpool=connections",MaxTotal])`|Warning|**Manual close**: Yes|
|Jira Data Center: HTTP: Pool: Out of idle connections|
All available connections are utilized. It can cause outages for users as the system is unable to serve their requests.
|`min(/Jira Data Center by JMX/jmx["com.atlassian.jira:type=metrics,category00=http,category01=connection,category02=pool,category03=numIdle,name=value",Value],5m)<=0`|Warning|**Manual close**: Yes|
|Jira Data Center: Mail: Queue: Doesn’t empty over an extended period|
Might indicate SMTP performance or connection problems.
|`min(/Jira Data Center by JMX/jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numItems,name=value",Value],30m)>0`|Warning|**Manual close**: Yes
**Depends on**:

- Jira Data Center: Mail: Queue job is not running
|
|Jira Data Center: Mail: Error queue contains one or more items|
A mail queue attempts to resend items up to 10 times. If the operation fails for the 11th time, the items are put into an error mail queue.
You can remove items from the error mail queue in one of the following ways:
  - Manually clear the whole error queue.
  - Manually resend all items from the error queue to a mail queue.
You should pay attention to the cases where an error mail queue item gets back to an error mail queue after you resend the items manually. These cases might indicate permanent performance issues.
|`max(/Jira Data Center by JMX/jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numErrors,name=value",Value],5m)>0`|Warning|**Manual close**: Yes|
|Jira Data Center: Mail: Queue job is not running|
It should be running when its queue is not empty.
Might indicate SMTP server connection problems.
|`max(/Jira Data Center by JMX/jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=jobRunning,name=value",Value],15m)=0 and min(/Jira Data Center by JMX/jmx["com.atlassian.jira:type=metrics,category00=mail,category01=queue,category02=numItems,name=value",Value],15m)>0`|Average|**Manual close**: Yes|

### LLD rule Storage discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Storage discovery|
Discovery of the Jira storage metrics.
|JMX agent|jmx.discovery[beans,"com.atlassian.jira:type=metrics,category00=home,category01=*,category02=write,category03=latency,*,name=value"]|

### Item prototypes for Storage discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Storage [{#JMXCATEGORY01}]: Latency|
The median latency of writing a small file (~30 bytes) to `{#JMXCATEGORY01}`.
|JMX agent|jmx["{#JMXOBJ}",Value]
**Preprocessing**

- 
Custom multiplier: `0.001`

|

### Trigger prototypes for Storage discovery

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Jira Data Center: Storage [{#JMXCATEGORY01}]: Slow performance|
Fires when latency grows above the threshold: `{$JIRA_DC.STORAGE.LATENCY.WARN:"{#JMXCATEGORY01}"}`s
|`min(/Jira Data Center by JMX/jmx["{#JMXOBJ}",Value],5m)>{$JIRA_DC.STORAGE.LATENCY.WARN:"{#JMXCATEGORY01}"}`|Warning|**Manual close**: Yes|

### LLD rule Mail server discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Mail server discovery|
Discovery of the Jira connected mail servers.
|JMX agent|jmx.discovery[beans,"com.atlassian.jira:type=metrics,category00=mail,category01=*,category02=connection,category03=state,name=*"]|

### Item prototypes for Mail server discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Mail [{#JMXCATEGORY01},{#JMXNAME}]: Connection state|
Shows connection state of Jira to discovered mail server: `{#JMXCATEGORY01}-{#JMXNAME}`
|JMX agent|jmx["{#JMXOBJ}",Connected]
**Preprocessing**

- Boolean to decimal: 
|
|Mail [{#JMXCATEGORY01},{#JMXNAME}]: Failures per minute|
Count of failed connections to discovered mail server `{#JMXCATEGORY01}-{#JMXNAME}` per minute
|JMX agent|jmx["{#JMXOBJ}",TotalFailures]
**Preprocessing**

- Simple change: 
|

### Trigger prototypes for Mail server discovery

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Jira Data Center: Mail [{#JMXCATEGORY01}-{#JMXNAME}]: Server disconnected|
Trigger is fired when discovered mail server `{#JMXCATEGORY01}-{#JMXNAME}` becomes unavailable
|`max(/Jira Data Center by JMX/jmx["{#JMXOBJ}",Connected],5m)=0`|Average|**Manual close**: Yes|

### LLD rule Indexing latency discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Indexing latency discovery|
Discovery of the Jira indexing metrics.
|JMX agent|jmx.discovery[beans,"com.atlassian.jira:type=metrics,category00=indexing,name=*"]|

### Item prototypes for Indexing latency discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Indexing [{#JMXNAME}]: Latency|
Average time spent on indexing operations.
|JMX agent|jmx["com.atlassian.jira:type=metrics,category00=indexing,name={#JMXNAME}",Mean]
**Preprocessing**

- 
Custom multiplier: `0.001`

|

### Trigger prototypes for Indexing latency discovery

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Jira Data Center: Indexing [{#JMXNAME}]: Slow performance|
Fires when latency grows above the threshold: `{$JIRA_DC.INDEXING.LATENCY.WARN:"{#JMXNAME}"}`s
|`min(/Jira Data Center by JMX/jmx["com.atlassian.jira:type=metrics,category00=indexing,name={#JMXNAME}",Mean],5m)>{$JIRA_DC.INDEXING.LATENCY.WARN:"{#JMXNAME}"}`|Warning|**Manual close**: Yes|

### LLD rule Issue latency discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Issue latency discovery|
Discovery of the Jira issue latency metrics.
|JMX agent|jmx.discovery[beans,"com.atlassian.jira:type=metrics,category00=issue,name=*"]|

### Item prototypes for Issue latency discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Issue [{#JMXNAME}]: Latency|
Average time spent on issue `{#JMXNAME}` operations.
|JMX agent|jmx["{#JMXOBJ}",Mean]
**Preprocessing**

- 
Custom multiplier: `0.001`

|

### Trigger prototypes for Issue latency discovery

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Jira Data Center: Issue [{#JMXNAME}]: Slow operations|
Fires when latency grows above the threshold: `{$JIRA_DC.ISSUE.LATENCY.WARN:"{#JMXNAME}"}`s
|`min(/Jira Data Center by JMX/jmx["{#JMXOBJ}",Mean],5m)>{$JIRA_DC.ISSUE.LATENCY.WARN:"{#JMXNAME}"}`|Warning|**Manual close**: Yes|

### LLD rule License discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|License discovery|
Discovery of the Jira licenses.
|Dependent item|jmx.license.discovery
**Preprocessing**

- 
JavaScript: `The text is too long. Please see the template.`

- 
Discard unchanged with heartbeat: `1h`

|

### Item prototypes for License discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|License [{#LICENSE.TYPE}]: Users: Current|
Current user count for `{#LICENSE.TYPE}`.
|Dependent item|jmx.license.get.user.current["{#LICENSE.TYPE}"]
**Preprocessing**

- 
JSON Path: `$.{#LICENSE.TYPE}.properties.current_user_count`

|
|License [{#LICENSE.TYPE}]: Users: Maximum|
User count limit for `{#LICENSE.TYPE}`.

`-1` = No limits for the license type.
|Dependent item|jmx.license.get.user.max["{#LICENSE.TYPE}"]
**Preprocessing**

- 
JSON Path: `$.{#LICENSE.TYPE}.properties.max_user_count`

|

### Trigger prototypes for License discovery

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Jira Data Center: License [{#LICENSE.TYPE}]: Low user capacity|
Fires when relative user quantity grows above the threshold: `{$JIRA_DC.LICENSE.USER.CAPACITY.WARN:"{#LICENSE.TYPE}"}`%
|`last(/Jira Data Center by JMX/jmx.license.get.user.max["{#LICENSE.TYPE}"])>=0 * (100*last(/Jira Data Center by JMX/jmx.license.get.user.current["{#LICENSE.TYPE}"])/last(/Jira Data Center by JMX/jmx.license.get.user.max["{#LICENSE.TYPE}"])>{$JIRA_DC.LICENSE.USER.CAPACITY.WARN:"{#LICENSE.TYPE}"})`|Warning|**Manual close**: Yes
**Depends on**:

- Jira Data Center: License [{#LICENSE.TYPE}]: User count reached the limit
|
|Jira Data Center: License [{#LICENSE.TYPE}]: User count reached the limit|
Fires when user quantity reaches the limit.
It won't fire if the limit is disabled (set to `-1`).
|`last(/Jira Data Center by JMX/jmx.license.get.user.max["{#LICENSE.TYPE}"])>=0 * ((last(/Jira Data Center by JMX/jmx.license.get.user.max["{#LICENSE.TYPE}"])-last(/Jira Data Center by JMX/jmx.license.get.user.current["{#LICENSE.TYPE}"]))<=0)`|Average|**Manual close**: Yes|

## Feedback

Please report any issues with the template at [`https://support.zabbix.com`](https://support.zabbix.com)

You can also provide feedback, discuss the template, or ask for help at [`ZABBIX forums`](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback)

