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.
Trapper items are items that accept incoming data instead of querying for it. Trapper items are useful for sending specific data to Zabbix server, for example, periodic availability and performance data in the case of long running user scripts. You can do that by using the Zabbix sender command-line utility or by implementing a JSON-based communication protocol (similar to that used in Zabbix sender) yourself.
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.
A user parameter 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.
system.runZabbix agent items
system.run Zabbix agent item 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.
system.run items are disabled by default and, if used, must be enabled (allowed) and defined in the Zabbix agent or agent 2 configuration file (
AllowKey configuration parameter).
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.
HTTP agent 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 and script items are supported by Zabbix server and proxy, and do not require an agent running on the host being monitored.
Loadable modules, 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), 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.
Plugins provide an alternative to loadable modules (written in C). However, plugins are a way to extend Zabbix agent 2 only.
A plugin is a Go package that defines the structure and implements one or several plugin interfaces (Exporter, Collector, Configurator, Runner, Watcher). Two types of Zabbix agent 2 plugins are supported:
An alert script is a Zabbix media type 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.
Frontend modules 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.
Rebranding is a way to customize the user interface of your Zabbix frontend installation. You can customize the user interface in the following ways:
Note: you can also create you own Zabbix themes to better fit the rebranding.
A global script 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:
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 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.
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.
Zabbix API is an HTTP-based API that is part of Zabbix frontend. With Zabbix API, you can do any of the following operations:
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.