Это перевод страницы документации с английского языка. Помогите нам сделать его лучше.

2 Пользовательские макросы поддерживаемые по назначению

Обзор

Определяемые пользователями макросы поддерживаются в следующих местах:

  • Узлы сети
    • IP/DNS интерфейса
    • Порт интерфейса
  • Пассивные прокси
    • Порт интерфейса
  • Элементы данных и прототипы элементов данных
    • Имя (устарело)
    • Параметры ключей
    • Интервал обновления
    • Пользовательские интервалы
    • Период хранения истории
    • Период хранения динамики изменений
    • Имя контекста SNMPv3
    • Имя безопасности SNMPv3
    • Пароль аутентификации SNMPv3
    • Ключевая фраза безопасности SNMPv3
    • SNMPv1/v2 community
    • SNMP OID
    • SNMP порт
    • Имя пользователя SSH
    • Публичный ключ SSH
    • Приватный ключ SSH
    • Пароль к SSH
    • SSH скрипт
    • Имя пользователя к Telnet
    • Пароль к Telnet
    • Telnet скрипт
    • Формула вычисляемого элемента данных
    • Поле "Разрешенные узлы сети" траппер элемента данных
    • Дополнительные параметры мониторинга баз данных
    • Поле элемента данных JMX endpoint
    • начиная с Zabbix 4.0 также в:
      • шагах предобработки значений элементов данных
      • поле URL HTTP агента
      • HTTP полях запросов HTTP агента
      • поле тела запроса HTTP агента
      • поле кодов состояний HTTP агента
      • поле заголовков ключа и значения HTTP агента
      • поле имени пользователя HTTP аутентификации HTTP агента
      • поле пароля HTTP аутентификации HTTP агента
      • поле HTTP прокси HTTP агента
      • поле файла SSL сертификата HTTP агента
      • поле файла SSL ключа HTTP агента
      • поле пароля к SSL ключу HTTP агента
      • поле HTTP времени ожидания HTTP агента
      • поле HTTP разрешенных хостов HTTP агента
  • Обнаружения
    * Интервал обновления
           * Имя контекста SNMPv3
           * Имя безопасности SNMPv3
           * Пароль аутентификации SNMPv3
           * Ключевая фраза безопасности SNMPv3
           * SNMPv1/v2 community
           * SNMP OID
  • Правило низкоуровневого обнаружения
    * Имя
           * Параметры ключей
           * Интервал обновления
           * Пользовательские интервалы
           * Имя контекста SNMPv3
           * Имя безопасности SNMPv3
           * Пароль аутентификации SNMPv3
           * Ключевая фраза безопасности SNMPv3
           * SNMPv1/v2 community
           * SNMP OID
           * SNMP порт
           * Имя пользователя SSH
           * Публичный ключ SSH
           * Приватный ключ SSH
           * Пароль к SSH
           * SSH скрипт
           * Имя пользователя к Telnet
           * Пароль к Telnet
           * Telnet скрипт
           * Поле "Разрешенные узлы сети" траппер элемента данных
           * Дополнительные параметры мониторинга баз данных
           * Поле элемента данных JMX endpoint
           * Период хранения потерянных ресурсов
           * Регулярные выражения в фильтре
           * начиная с Zabbix 4.0 также в:
             * поле URL HTTP агента
             * HTTP полях запросов HTTP агента
             * поле запроса тела HTTP агента
             * поле требуемых кодов состояний HTTP агента
             * поле заголовков ключа и значения HTTP агента
             * поле имени пользователя HTTP аутентификации HTTP агента
             * поле пароля HTTP аутентификации HTTP агента
             * поле HTTP времени ожидания HTTP агента
       
       * Веб-сценарий
           * Имя
           * Интервал обновления
           * Агент
           * HTTP прокси
           * Переменные
           * Заголовки
           * Имя шага
           * URL шага
           * Post переменные шага
           * Заголовки шага
           * Время ожидания шага
           * Требуемая строка
           * Требуемые коды состояний
           * Аутентификация
           * Файл сертификата SSL
           * Файл ключа SSL
           * Пароль к ключу SSL
          
       * Триггеры
           * Имя
           * Выражение (только в константах и в параметрах функций)
           * Описание
           * URL
  • Оповещения, основанные на триггерах
  • Оповещения о внутренних событиях, основанные на триггерах
  • Оповещения обновления проблем
  • Теги событий
    * Имя тега
           * Значение тега
           * Тег для поиска совпадений
  • Операции действий
    • Длительность шага операции по умолчанию
    • Длительность шага
  • Условия действий
    • Условие периода времени
  • Глобальные скрипты (включая текст подтверждения)
  • Поле URL динамического элемента комплексного экрана URL
  • Администрирование → Пользователи → Оповещения: поле 'Когда активно'
  • Администрирование → Общие → Рабочее время: поле 'Рабочее время'

Полный список всех поддерживаемых макросов в Zabbix смотрите макросы поддерживаемые по назначению.

Actions

In actions, user macros can be used in the following fields:

Location Multiple macros/mix with text1
Trigger-based notifications and commands yes
Trigger-based internal notifications yes
Problem update notifications yes
Service-based notifications and commands yes
Service update notifications yes
Time period condition no
Operations
Default operation step duration no
Step duration no

Hosts/host prototypes

In a host and host prototype configuration, user macros can be used in the following fields:

Location Multiple macros/mix with text1
Interface IP/DNS DNS only
Interface port no
SNMP v1, v2
SNMP community yes
SNMP v3
Context name yes
Security name yes
Authentication passphrase yes
Privacy passphrase yes
IPMI
Username yes
Password yes
//Tags //
Tag names yes
Tag values yes

Items / item prototypes

In an item or an item prototype configuration, user macros can be used in the following fields:

Location Multiple macros/mix with text1
Name (deprecated) yes
Item key parameters yes
Update interval no
Custom intervals no
History storage period no
Trend storage period no
Description yes
Calculated item
Formula yes
Database monitor
Username yes
Password yes
SQL query yes
HTTP agent
URL2 yes
Query fields yes
Timeout no
Request body yes
Headers (names and values) yes
Required status codes yes
HTTP proxy yes
HTTP authentication username yes
HTTP authentication password yes
SSl certificate file yes
SSl key file yes
SSl key password yes
Allowed hosts yes
JMX agent
JMX endpoint yes
Script item
Parameter names and values yes
SNMP agent
SNMP OID yes
SSH agent
Username yes
Public key file yes
Private key file yes
Password yes
Script yes
TELNET agent
Username yes
Password yes
Script yes
Zabbix trapper
Allowed hosts yes
Tags
Tag names yes
Tag values yes
Preprocessing
Step parameters (including custom scripts) yes

Low-level discovery

In a low-level discovery rule, user macros can be used in the following fields:

Location Multiple macros/mix with text1
Name yes
Key parameters yes
Update interval no
Custom interval no
Keep lost resources period no
Description yes
SNMP agent
SNMP OID yes
SSH agent
Username yes
Public key file yes
Private key file yes
Password yes
Script yes
TELNET agent
Username yes
Password yes
Script yes
Zabbix trapper
Allowed hosts yes
Database monitor
Additional parameters yes
JMX agent
JMX endpoint yes
HTTP agent
URL2 yes
Query fields yes
Timeout no
Request body yes
Headers (names and values) yes
Required status codes yes
HTTP authentication username yes
HTTP authentication password yes
Filters
Regular expression yes
Overrides
Filters: regular expression yes
Operations: update interval (for item prototypes) no
Operations: history storage period (for item prototypes) no
Operations: trend storage period (for item prototypes) no

Network discovery

In a network discovery rule, user macros can be used in the following fields:

Location Multiple macros/mix with text1
Update interval no
SNMP v1, v2
SNMP community yes
SNMP OID yes
SNMP v3
Context name yes
Security name yes
Authentication passphrase yes
Privacy passphrase yes
SNMP OID yes

Proxies

In a proxy configuration, user macros can be used in the following field:

Location Multiple macros/mix with text1
Interface port (for passive proxy) no

Templates

In a template configuration, user macros can be used in the following fields:

Location Multiple macros/mix with text1
Tags
Tag names yes
Tag values yes

Triggers

In a trigger configuration, user macros can be used in the following fields:

Location Multiple macros/mix with text1
Name yes
Operational data yes
Expression (only in constants and function parameters; secret macros are not supported). yes
Description yes
URL2 yes
Tag for matching yes
Tags
Tag names yes
Tag values yes

Web scenario

In a web scenario configuration, user macros can be used in the following fields:

Location Multiple macros/mix with text1
Name yes
Update interval no
Agent yes
HTTP proxy yes
Variables (values only) yes
Headers (names and values) yes
Steps
Name yes
URL2 yes
Variables (values only) yes
Headers (names and values) yes
Timeout no
Required string yes
Required status codes no
Authentication
User yes
Password yes
SSL certificate yes
SSL key file yes
SSL key password yes
Tags
Tag names yes
Tag values yes

Other locations

In addition to the locations listed here, user macros can be used in the following fields:

Location Multiple macros/mix with text1
Global scripts (script, SSH, Telnet, IPMI), including confirmation text yes
Webhooks
JavaScript script no
JavaScript script parameter name no
JavaScript script parameter value yes
Monitoring → Dashboards
URL2 field of dynamic URL dashboard widget yes
Administration → Users → Media
When active no
Administration → General → GUI
Working time no
Administration → Media types → Message templates
Subject yes
Message yes

For a complete list of all macros supported in Zabbix, see supported macros.

Footnotes

1 If multiple macros in a field or macros mixed with text are not supported for the location, a single macro has to fill the whole field.

2 URLs that contain a secret macro will not work, as the macro in them will be resolved as "******".