[comment]: # ({85991cf3-4f969495})
# 19 Extensions

[comment]: # ({/85991cf3-4f969495})

[comment]: # ({99ac2a08-574b73cc})
#### Overview

Although Zabbix offers a multiplicity of features, there is always room for additional functionality.
Extensions are a convenient way of modifying and enhancing the monitoring capabilities of Zabbix
without changing its source code.

You can extend Zabbix functionality either by using built-in extension options
(trapper items, user parameters, etc.) or by using or creating custom extensions (loadable modules, plugins, etc.).

This section provides an overview with references to all the options for extending Zabbix.

[comment]: # ({/99ac2a08-574b73cc})

[comment]: # ({506e8c98-7b2875dd})
#### Data collection with custom commands

[comment]: # ({/506e8c98-7b2875dd})

[comment]: # ({d1691dc9-2d4c92f9})
##### Trapper items

[Trapper items](/manual/config/items/itemtypes/trapper) are items that accept incoming data instead of querying for it.
Trapper items are useful for sending specific data to Zabbix server or proxy, for example, periodic availability and performance data in the case of long-running user scripts.
Sending data to Zabbix server or proxy is possible using the [Zabbix sender](/manual/concepts/sender) utility or Zabbix sender [protocol](/manual/appendix/protocols/zabbix_sender).
Sending data to Zabbix server is also possible using the [`history.push`](/manual/api/reference/history/push) API method.

[comment]: # ({/d1691dc9-2d4c92f9})

[comment]: # ({e7b67f3a-327d4393})
##### External checks

An [external check](/manual/config/items/itemtypes/external) is an item for executing checks
by running an executable, for example, a [shell script](/manual/appendix/command_execution) or a binary.

External checks are executed by Zabbix server or proxy (when host is monitored by proxy),
and do not require an agent running on the host being monitored.

[comment]: # ({/e7b67f3a-327d4393})

[comment]: # ({e86032a0-ce750625})
##### User parameters

A [user parameter](/manual/config/items/userparameters) is a user-defined command (associated with a user-defined key)
that, when executed, can retrieve the data you need from the host where Zabbix agent is running.
User parameters are useful for configuring agent or agent 2 items that are not predefined in Zabbix.

[comment]: # ({/e86032a0-ce750625})

[comment]: # ({7929dcdd-014456ed})
##### `system.run[]` Zabbix agent items

`system.run[]` Zabbix [agent item](/manual/config/items/itemtypes/zabbix_agent#system.run)
is an item for a user-defined command (associated with a predefined key `system.run[]`,
for example, `system.run[myscript.sh]`) that can be executed on the host where Zabbix agent is running. 

Note: `system.run[]` items are disabled by default and, if used,
must be enabled ([allowed](/manual/config/items/restrict_checks)) and defined
in the Zabbix agent or agent 2 configuration file (`AllowKey` configuration parameter).

[comment]: # ({/7929dcdd-014456ed})

[comment]: # ({2550c7b3-8ef20381})
::: noteimportant
User-defined commands in items such as external checks, user parameters and `system.run[]` Zabbix agent items
are executed from the OS user that is used to run Zabbix components.
To execute these commands, this user must have the necessary permissions.
:::

[comment]: # ({/2550c7b3-8ef20381})

[comment]: # ({f4f740a1-9530d8d5})
##### HTTP agent items

[HTTP agent](/manual/config/items/itemtypes/http) item is an item for executing data requests over HTTP/HTTPS.
HTTP agent items are useful for sending requests to HTTP endpoints to retrieve data from services such as *Elasticsearch* and *OpenWeatherMap*, for checking the status of Zabbix API or the status of Apache or Nginx web server, etc.
HTTP agent items (with trapping enabled) can also function as [trapper items](#trapper-items).

[comment]: # ({/f4f740a1-9530d8d5})

[comment]: # ({a5135d6d-f6b462b1})
##### Script items

A [script item](/manual/config/items/itemtypes/script)
is an item for executing user-defined JavaScript code that retrieves data over HTTP/HTTPS.
Script items are useful when the functionality provided by HTTP agent items is not enough.
For example, in demanding data collection scenarios that require multiple steps or complex logic,
a script item can be configured to make an HTTP call, then process the data received,
and then pass the transformed value to a second HTTP call.

[comment]: # ({/a5135d6d-f6b462b1})

[comment]: # ({60de34fb-fc37db31})
::: notetip
HTTP agent items and script items are supported by Zabbix server and proxy,
and do not require an agent running on the host being monitored.
:::

[comment]: # ({/60de34fb-fc37db31})

[comment]: # ({8a85d13d-37a255c2})
#### Advanced extensions

[comment]: # ({/8a85d13d-37a255c2})

[comment]: # ({037daafe-45ac5b61})
##### Loadable modules

[Loadable modules](/manual/extensions/loadablemodules), written in C, are a versatile
and performance-minded option for extending the functionality of Zabbix components (server, proxy, agent)
on UNIX platforms. A loadable module is basically a shared library used by Zabbix daemon and loaded on startup.
The library should contain certain functions,
so that a Zabbix process may detect that the file is indeed a module it can load and work with.

Loadable modules have a number of benefits, including the ability to add new metrics or implement any other logic
(for example, Zabbix [history data export](/manual/extensions/loadablemodules#providing-history-export-callbacks)),
great performance, and the option to develop, use and share the functionality they provide.
It contributes to trouble-free maintenance
and helps to deliver new functionality easier and independently of the Zabbix core code base.

Loadable modules are especially useful in a complex monitoring setup.
When monitoring embedded systems, having a large number of monitored parameters
or heavy scripts with complex logic or long startup time,
extensions such as user parameters, `system.run[]` Zabbix agent items, and external checks
will have an impact on performance.
Loadable modules offer a way of extending Zabbix functionality without sacrificing performance.

[comment]: # ({/037daafe-45ac5b61})

[comment]: # ({80ccd6be-c3a7defc})
##### Plugins

Plugins extend the monitoring capabilities of Zabbix agent 2.
Written in the Go programming language, they provide an alternative to loadable modules (written in C).

It is possible to develop your own plugin (independent data collector) for Zabbix agent 2. See [Developer center](/devel/plugins).

[comment]: # ({/80ccd6be-c3a7defc})

[comment]: # ({1ab5311c-d554dcca})
#### Alert customization

[comment]: # ({/1ab5311c-d554dcca})

[comment]: # ({0fa1d1af-4957b4ed})
##### Webhooks

A [webhook](/manual/config/notifications/media/webhook)
is a Zabbix [media type](/manual/config/notifications/media)
that provides an option to extend Zabbix alerting capabilities
to external software such as helpdesk systems, chats, or messengers.
Similarly to script items, webhooks are useful for making HTTP calls using custom JavaScript code,
for example, to push notifications to different platforms such as Microsoft Teams, Discord, and Jira.
It is also possible to return some data (for example, about created helpdesk tickets) that is then displayed in Zabbix.

Existing webhooks are available
in the Zabbix [Git repository](https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media).
For custom webhook development,
see [Webhook development guidelines](https://www.zabbix.com/documentation/guidelines/en/webhooks).

[comment]: # ({/0fa1d1af-4957b4ed})

[comment]: # ({fde4aa0a-1ff47b17})
##### Alert scripts

An [alert script](/manual/config/notifications/media/script)
is a Zabbix [media type](/manual/config/notifications/media)
that provides an option to create an alternative way (script) to handle Zabbix alerts.
Alert scripts are useful if you are not satisfied with the existing media types for sending alerts in Zabbix.

[comment]: # ({/fde4aa0a-1ff47b17})

[comment]: # ({8d0a3d44-6a53c965})
#### Frontend customization

[comment]: # ({/8d0a3d44-6a53c965})

[comment]: # ({fd4967cb-e59962d6})
##### Custom themes

It is possible to change Zabbix frontend visual appearance by using custom themes. See the
[instructions](/manual/web_interface/theming) on creating and applying your own themes.

[comment]: # ({/fd4967cb-e59962d6})

[comment]: # ({850d0b20-a1752bc3})
##### Frontend modules

[Frontend modules](/manual/extensions/frontendmodules) provide an option to extend Zabbix frontend functionality
by adding third-party modules or by developing your own.
With frontend modules you can add new menu items, their respective views, actions, etc.

[comment]: # ({/850d0b20-a1752bc3})

[comment]: # ({a2988159-485cf185})
#### Global scripts

A [global script](/manual/web_interface/frontend_sections/alerts/scripts)
is a user-defined set of commands that can be executed on a monitoring target (by shell (/bin/sh) interpreter),
depending on the configured scope and user permissions.
Global scripts can be configured for the following actions:

-   Action [operation](/manual/config/notifications/action/operation)
-   [Manual host action](/manual/web_interface/menu/host_menu#overview)
-   [Manual event action](/manual/web_interface/menu/event_menu#content)

Global scripts are useful in many cases.
For example, if configured for action operations or manual host actions, you can use global scripts
to automatically or manually execute [remote commands](/manual/config/notifications/action/operation/remote_command)
such as restarting an application (web server, middleware, CRM, etc.)
or freeing disk space (removing older files, cleaning `/tmp`, etc).
Or, another example, if configured for manual event actions,
you can use global scripts to manage problem tickets in external systems.

Global scripts can be executed by Zabbix server, proxy or agent.

[comment]: # ({/a2988159-485cf185})

[comment]: # ({29547248-44d06965})
::: noteimportant
User-defined commands are executed from the OS user that is used to run Zabbix components.
To execute these commands, this user must have the necessary permissions.
:::

[comment]: # ({/29547248-44d06965})

[comment]: # ({fb93634c-ee438455})
#### Zabbix API

[Zabbix API](/manual/api) is an HTTP-based API that is part of Zabbix frontend.
With Zabbix API, you can do any of the following operations:

-   Programmatically retrieve and modify the configuration of Zabbix.
-   Import and export Zabbix configuration.
-   Access Zabbix historical and trend data.
-   Configure applications to work with Zabbix.
-   Integrate Zabbix with third-party software.
-   Automate routine tasks.

Zabbix API consists of a multiplicity of methods that are nominally grouped into separate APIs.
Each method performs a specific task.
For the available methods, as well as an overview of the functions provided by Zabbix API,
see Zabbix API [Method reference](/manual/api/reference).

[comment]: # ({/fb93634c-ee438455})
