> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/z/zabbix.md).

# Zabbix

Zabbix is a monitoring platform. OctoXLabs reads the monitored hosts and the Zabbix user accounts through the JSON-RPC API. This adds interfaces, inventory data, host groups and templates to the device inventory.

## Use cases

* List all hosts monitored by Zabbix.

```
Adapters = zabbix
```

* Find servers that are in your inventory but not monitored in Zabbix. Replace `active-directory` with any other source that lists your servers.

```
Adapters = active-directory AND NOT Adapters = zabbix
```

## Before you begin

### Network

| Source              | Destination                            | Port                        | Protocol |
| ------------------- | -------------------------------------- | --------------------------- | -------- |
| OctoXLabs connector | Zabbix web server (`/api_jsonrpc.php`) | 443 (default, configurable) | HTTPS    |

### Required permissions

| Scope or role                                             | Permission                                           | Needed for                           |
| --------------------------------------------------------- | ---------------------------------------------------- | ------------------------------------ |
| User group with Template permissions and Host permissions | Read                                                 | Hosts, templates, groups             |
| User role with **Access to API**                          | Read: Inventory, Groups, Interfaces, Templates, Tags | API data                             |
| Admin authority of the token creator                      | Not applicable                                       | API token (when **Use Token** is on) |

## Create credentials in Zabbix

{% stepper %}
{% step %}

### Create a user group

Go to **Users > User Groups**. Click **Create user group**, or edit an existing group.
{% endstep %}

{% step %}

### Add template permissions

In the Template Permissions section add the template groups you want to see, such as Applications, Databases, Operating Systems and Server Hardware.
{% endstep %}

{% step %}

### Add host permissions

In the Host Permissions section add the host groups you want to see, such as Discovered Hosts, Virtual Machines, Linux Servers and Zabbix Servers.
{% endstep %}

{% step %}

### Create a role

Go to **Users > User Roles**. Create a role and assign it to the user group. Enable **Access to API**. Grant permissions for Inventory, Groups, Interfaces, Templates and Tags.
{% endstep %}

{% step %}

### Optional: create a token

To use a token, generate an API token for a user that has admin authority.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                 | Required              | Type    | Default | Description                                                                                                                         |
| ------------------------- | --------------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| IP                        | Yes                   | Text    |         | IP address or host name of Zabbix.                                                                                                  |
| Port                      | No                    | Integer | 443     | Web server port.                                                                                                                    |
| URL Path                  | No                    | Text    |         | Folder path when `api_jsonrpc.php` is not at the root, for example `zabbix` or `zabbix/api`.                                        |
| Major Version             | No                    | Text    | 7       | `7` or `6`. Version 6 sends the token in the request body. Version 7 sends it as a Bearer header.                                   |
| Username                  | When Use Token is off | Text    |         | Account name.                                                                                                                       |
| Password                  | When Use Token is off | Text    |         | Account password.                                                                                                                   |
| Token                     | When Use Token is on  | Text    |         | Pre-generated API token.                                                                                                            |
| Use Token                 | No                    | Boolean | False   | Use the token instead of the user name and password.                                                                                |
| Is Secure?                | No                    | Boolean | True    | Use HTTPS.                                                                                                                          |
| Thread Count              | No                    | Integer | 32      | Parallel threads for per host calls.                                                                                                |
| Timeout                   | No                    | Integer | 30      | Seconds to wait for API responses.                                                                                                  |
| Extend Device Output      | No                    | Boolean | True    | Return full host output.                                                                                                            |
| Extend Inventory          | No                    | Boolean | True    | Include inventory details.                                                                                                          |
| Extend Groups             | No                    | Boolean | True    | Include host groups.                                                                                                                |
| Extend Interfaces         | No                    | Boolean | True    | Include interfaces.                                                                                                                 |
| Extend Parent Templates   | No                    | Boolean | True    | Include parent templates.                                                                                                           |
| Extend Tags               | No                    | Boolean | True    | Include tags.                                                                                                                       |
| Extend User Output        | No                    | Boolean | True    | Return full user output.                                                                                                            |
| Extend Role               | No                    | Boolean | True    | Include role information.                                                                                                           |
| Extend User Groups        | No                    | Boolean | True    | Include user groups.                                                                                                                |
| Fetch History Information | No                    | Boolean | False   | Add the latest history record of each host. Its time is used as last seen.                                                          |
| Extend Items              | No                    | Boolean | False   | Include all items of each host. Cannot be used with Item Keys.                                                                      |
| Item Keys                 | No                    | Text    |         | Comma separated item keys, for example `system.cpu.load,vm.memory.size`. One extra call per host. Cannot be used with Extend Items. |
| Extend History Output     | No                    | Boolean | True    | Return full history output.                                                                                                         |

## Troubleshooting

| Error message                                             | Cause                                                  | Fix                                                           |
| --------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------- |
| 'extend\_items' and 'item\_keys' cannot be used together. | Both options are set.                                  | Use only one.                                                 |
| Failed to obtain authentication token from Zabbix API.    | The login failed. This is a log error.                 | Check the user name, password or token and the major version. |
| No device data returned from Zabbix API.                  | The host call returned nothing. This is a log warning. | Check the permissions of the user group and role.             |

## Change history
