
# Mantis BT by HTTP

## Overview

This template is designed for the effortless deployment of Mantis BT monitoring by Zabbix via HTTP and doesn't require any external scripts.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- MantisBT 2.22

## 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

1. Generate the API token in Mantis BT. Use this [manual](https://support.mantishub.com/hc/en-us/articles/215787323-Connecting-to-MantisHub-APIs-using-API-Tokens) for detailed instructions.
2. Change values for the {$MANTIS.URL} and {$MANTIS.TOKEN} macros.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$MANTIS.URL}|
MantisBT URL.
||
|{$MANTIS.TOKEN}|
MantisBT Token.
||
|{$MANTIS.LLD.FILTER.PROJECTS.MATCHES}|
Filter of discoverable projects.
|`.*`|
|{$MANTIS.LLD.FILTER.PROJECTS.NOT_MATCHES}|
Filter to exclude discovered projects.
|`CHANGE_IF_NEEDED`|
|{$MANTIS.HTTP.PROXY}|
Proxy for http requests.
||

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get projects|
Get projects from Mantis BT.
|HTTP agent|mantisbt.get.projects|

### LLD rule Projects discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Projects discovery|
Discovery rule for a Mantis BT projects.
|Dependent item|mantisbt.projects.discovery
**Preprocessing**

- 
JSON Path: `$.projects`

|

### Item prototypes for Projects discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Project [{#NAME}]: Get issues|
Getting project issues.
|HTTP agent|mantisbt.get.issues[{#NAME}]|
|Project [{#NAME}]: Total issues|
Count of issues in project.
|Dependent item|mantis.project.total_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues.length()`

|
|Project [{#NAME}]: New issues|
Count of issues with 'new' status.
|Dependent item|mantis.project.status.new_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.status.name=='new')].length()`

|
|Project [{#NAME}]: Resolved issues|
Count of issues with 'resolved' status.
|Dependent item|mantis.project.status.resolved_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.status.name=='resolved')].length()`

|
|Project [{#NAME}]: Closed issues|
Count of issues with 'closed' status.
|Dependent item|mantis.project.status.closed_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.status.name=='closed')].length()`

|
|Project [{#NAME}]: Assigned issues|
Count of issues with 'assigned' status.
|Dependent item|mantis.project.status.assigned_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.status.name=='assigned')].length()`

|
|Project [{#NAME}]: Feedback issues|
Count of issues with 'feedback' status.
|Dependent item|mantis.project.status.feedback_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.status.name=='feedback')].length()`

|
|Project [{#NAME}]: Acknowledged issues|
Count of issues with 'acknowledged' status.
|Dependent item|mantis.project.status.acknowledged_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.status.name=='acknowledged')].length()`

|
|Project [{#NAME}]: Confirmed issues|
Count of issues with 'confirmed' status.
|Dependent item|mantis.project.status.confirmed_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.status.name=='confirmed')].length()`

|
|Project [{#NAME}]: Open issues|
Count of "open" resolution issues.
|Dependent item|mantis.project.resolution.open_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.resolution.name=='open')].length()`

|
|Project [{#NAME}]: Fixed issues|
Count of "fixed" resolution issues.
|Dependent item|mantis.project.resolution.fixed_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.resolution.name=='fixed')].length()`

|
|Project [{#NAME}]: Reopened issues|
Count of "reopened" resolution issues.
|Dependent item|mantis.project.resolution.reopened_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.resolution.name=='reopened')].length()`

|
|Project [{#NAME}]: Unable to reproduce issues|
Count of "unable to reproduce" resolution issues.
|Dependent item|mantis.project.resolution.unable_to_reproduce_issues[{#NAME}]
**Preprocessing**

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

|
|Project [{#NAME}]: Not fixable issues|
Count of "not fixable" resolution issues.
|Dependent item|mantis.project.resolution.not_fixable_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.resolution.name=='not fixable')].length()`

|
|Project [{#NAME}]: Duplicate issues|
Count of "duplicate" resolution issues.
|Dependent item|mantis.project.resolution.duplicate_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.resolution.name=='duplicate')].length()`

|
|Project [{#NAME}]: No change required issues|
Count of "no change required" resolution issues.
|Dependent item|mantis.project.resolution.no_change_required_issues[{#NAME}]
**Preprocessing**

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

|
|Project [{#NAME}]: Suspended issues|
Count of "suspended" resolution issues.
|Dependent item|mantis.project.resolution.suspended_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.resolution.name=='suspended')].length()`

|
|Project [{#NAME}]: Will not fix issues|
Count of "wont fix" resolution issues.
|Dependent item|mantis.project.resolution.wont_fix_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.resolution.name=='wont fix')].length()`

|
|Project [{#NAME}]: Feature severity issues|
Count of "feature" severity issues.
|Dependent item|mantis.project.severity.feature_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.severity.name=='feature')].length()`

|
|Project [{#NAME}]: Trivial severity issues|
Count of "trivial" severity issues.
|Dependent item|mantis.project.severity.trivial_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.severity.name=='trivial')].length()`

|
|Project [{#NAME}]: Text severity issues|
Count of "text" severity issues.
|Dependent item|mantis.project.severity.text_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.severity.name=='text')].length()`

|
|Project [{#NAME}]: Tweak severity issues|
Count of "tweak" severity issues.
|Dependent item|mantis.project.severity.tweak_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.severity.name=='tweak')].length()`

|
|Project [{#NAME}]: Minor severity issues|
Count of "minor" severity issues.
|Dependent item|mantis.project.severity.minor_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.severity.name=='minor')].length()`

|
|Project [{#NAME}]: Major severity issues|
Count of "major" severity issues.
|Dependent item|mantis.project.severity.major_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.severity.name=='major')].length()`

|
|Project [{#NAME}]: Crash severity issues|
Count of "crash" severity issues.
|Dependent item|mantis.project.severity.crash_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.severity.name=='crash')].length()`

|
|Project [{#NAME}]: Block severity issues|
Count of "block" severity issues.
|Dependent item|mantis.project.severity.block_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.severity.name=='block')].length()`

|
|Project [{#NAME}]: None priority issues|
Count of "none" priority issues.
|Dependent item|mantis.project.priority.none_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.priority.name=='none')].length()`

|
|Project [{#NAME}]: Low priority issues|
Count of "low" priority issues.
|Dependent item|mantis.project.priority.low_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.priority.name=='low')].length()`

|
|Project [{#NAME}]: Normal priority issues|
Count of "normal" priority issues.
|Dependent item|mantis.project.priority.normal_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.priority.name=='normal')].length()`

|
|Project [{#NAME}]: High priority issues|
Count of "high" priority issues.
|Dependent item|mantis.project.priority.high_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.priority.name=='high')].length()`

|
|Project [{#NAME}]: Urgent priority issues|
Count of "urgent" priority issues.
|Dependent item|mantis.project.priority.urgent_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.priority.name=='urgent')].length()`

|
|Project [{#NAME}]: Immediate priority issues|
Count of "immediate" priority issues.
|Dependent item|mantis.project.priority.immediate_issues[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.issues[?(@.priority.name=='immediate')].length()`

|

## 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)

