Объект прототипа элемента данных
Следующие объекты напрямую связаны с API itemprototype.
Прототип элемента данных
Объект прототипа элемента данных имеет следующие свойства.
| Property | Type | Description |
|---|---|---|
| itemid | ID | ID прототипа элемента данных. Property behavior: - read-only - required for update operations |
| delay | string | Интервал обновления прототипа элемента данных. Принимает секунды или единицу времени с суффиксом (например, 30s, 1m, 2h, 1d) и, дополнительно, один или несколько custom intervals, все разделенные точкой с запятой. Пользовательские интервалы могут представлять собой смесь гибких и интервальных расписаний. Принимает пользовательские макросы и макросы LLD. Если используется, значение должно быть одним макросом. Несколько макросов или макросы, смешанные с текстом, не поддерживаются. Гибкие интервалы можно записывать как два макроса, разделенные косой чертой (например, {$FLEX_INTERVAL}/{$FLEX_PERIOD}).Пример: 1h;wd1-5h9-18;{$Macro1}/1-7,00:00-24:00;0/6-7,12:00-24:00;{$Macro2}/{$Macro3}Property behavior: - required if type is set to "Zabbix agent" (0), "Simple check" (3), "Zabbix internal" (5), "External check" (10), "Database monitor" (11), "IPMI agent" (12), "SSH agent" (13), "TELNET agent" (14), "Calculated" (15), "JMX agent" (16), "HTTP agent" (19), "SNMP agent" (20), "Script" (21), "Browser" (22), or if type is set to "Zabbix agent (active)" (7) and key_ does not contain "mqtt.get" |
| hostid | ID | ID узла сети, которому принадлежит прототип элемента данных. Property behavior: - constant - required for create operations |
| interfaceid | ID | ID интерфейса узла сети прототипа элемента данных. Property behavior: - required if item prototype belongs to host and type is set to "Zabbix agent", "IPMI agent", "JMX agent", "SNMP trap", or "SNMP agent"- supported if item prototype belongs to host and type is set to "Simple check", "External check", "SSH agent", "TELNET agent", or "HTTP agent" |
| key_ | string | Ключ прототипа элемента данных. Property behavior: - required for create operations - read-only for inherited objects |
| name | string | Имя прототипа элемента данных. Поддерживает пользовательские макросы. Property behavior: - required for create operations - read-only for inherited objects |
| type | integer | Тип прототипа элемента данных. Possible values: 0 - Zabbix agent; 2 - Zabbix trapper; 3 - Simple check; 5 - Zabbix internal; 7 - Zabbix agent (active); 10 - External check; 11 - Database monitor; 12 - IPMI agent; 13 - SSH agent; 14 - TELNET agent; 15 - Calculated; 16 - JMX agent; 17 - SNMP trap; 18 - Dependent item; 19 - HTTP agent; 20 - SNMP agent; 21 - Script; 22 - Browser. Property behavior: - required for create operations - read-only for inherited objects |
| url | string | Строка URL. Поддерживает макросы LLD, пользовательские макросы, {HOST.IP}, {HOST.CONN}, {HOST.DNS}, {HOST.HOST}, {HOST.NAME}, {HOST.PORT}, {ITEM.ID}, {ITEM.KEY}. Property behavior: - required if type is set to "HTTP agent"- read-only for inherited objects |
| value_type | integer | Тип информации прототипа элемента данных. Possible values: 0 - numeric float; 1 - character; 2 - log; 3 - numeric unsigned; 4 - text; 5 - binary. Property behavior: - required for create operations - read-only for inherited objects |
| allow_traps | integer | Разрешает заполнять значение аналогично элементу данных типа trapper. 0 - (default) Не разрешать принимать входящие данные; 1 - Разрешить принимать входящие данные. Property behavior: - supported if type is set to "HTTP agent" |
| authtype | integer | Метод аутентификации. Possible values if type is set to "SSH agent":0 - (default) password; 1 - public key. Possible values if type is set to "HTTP agent":0 - (default) none; 1 - basic; 2 - NTLM; 3 - Kerberos; 4 - Digest. Property behavior: - supported if type is set to "SSH agent" or "HTTP agent"- read-only for inherited objects (if type is set to "HTTP agent") |
| description | string | Описание прототипа элемента данных. |
| flags | integer | Origin прототипа элемента данных. Possible values: 2 - an item prototype; 6 - a discovered item prototype Property behavior: - read-only |
| follow_redirects | integer | Следовать перенаправлениям ответа при опросе данных. Possible values: 0 - Do not follow redirects; 1 - (default) Follow redirects. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| headers | array | Массив headers, которые будут отправлены при выполнении HTTP-запроса. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| history | string | Единица времени, определяющая, как долго должны храниться данные истории. Также принимает пользовательский макрос и макрос LLD. По умолчанию: 31d. |
| http_proxy | string | Строка подключения к HTTP(S) proxy. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| ipmi_sensor | string | Датчик IPMI. Property behavior: - required if type is set to "IPMI agent" and key_ is not set to "ipmi.get"- supported if type is set to "IPMI agent"- read-only for inherited objects |
| jmx_endpoint | string | Пользовательская строка подключения JMX gateway. По умолчанию: service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi Property behavior: - supported if type is set to "JMX agent" |
| logtimefmt | string | Формат времени в записях журнала. Property behavior: - supported if value_type is set to "log"- read-only for inherited objects |
| master_itemid | ID | ID основного элемента данных. Property behavior: - required if type is set to "Dependent item"- read-only for inherited objects |
| output_format | integer | Следует ли преобразовывать ответ в JSON. Possible values: 0 - (default) Store raw; 1 - Convert to JSON. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| params | string | Дополнительные параметры в зависимости от типа прототипа элемента данных: - выполняемый скрипт для прототипов элементов данных SSH agent и TELNET agent; - SQL-запрос для прототипов элементов данных Database monitor; - формула для прототипов вычисляемых элементов данных; - скрипт для прототипов элементов данных Script и Browser. Property behavior: - required if type is set to "Database monitor", "SSH agent", "TELNET agent", "Calculated", "Script", or "Browser"- read-only for inherited objects (if type is set to "Script" or "Browser") |
| parameters | object/array | Дополнительные параметры, если type установлен в "Script" или "Browser". Массив объектов со свойствами name и value, где name должен быть уникальным.Property behavior: - supported if type is set to "Script" or "Browser"- read-only for inherited objects |
| password | string | Пароль для аутентификации. Property behavior: - required if type is set to "JMX agent" and username is set- supported if type is set to "Simple check", "SSH agent", "TELNET agent", "Database monitor", or "HTTP agent"- read-only for inherited objects (if type is set to "HTTP agent") |
| post_type | integer | Тип тела POST-данных, хранящихся в свойстве posts.Possible values: 0 - (default) Raw data. 2 - JSON data. 3 - XML data. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| posts | string | Данные тела HTTP(S)-запроса. Property behavior: - required if type is set to "HTTP agent" and post_type is set to "JSON data" or "XML data"- supported if type is set to "HTTP agent" and post_type is set to "Raw data"- read-only for inherited objects |
| privatekey | string | Имя файла закрытого ключа. Property behavior: - required if type is set to "SSH agent" and authtype is set to "public key" |
| publickey | string | Имя файла открытого ключа. Property behavior: - required if type is set to "SSH agent" and authtype is set to "public key" |
| query_fields | array | Массив query fields, которые будут отправлены при выполнении HTTP-запроса. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| request_method | integer | Тип метода запроса. Possible values: 0 - (default) GET; 1 - POST; 2 - PUT; 3 - HEAD. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| retrieve_mode | integer | Какая часть ответа должна быть сохранена. Possible values if request_method is set to "GET", "POST", or "PUT":0 - (default) Body; 1 - Headers; 2 - Both body and headers will be stored. Possible values if request_method is set to "HEAD":1 - Headers. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| snmp_oid | string | SNMP OID. Property behavior: - required if type is set to "SNMP agent"- read-only for inherited objects |
| ssl_cert_file | string | Путь к файлу открытого SSL-ключа. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| ssl_key_file | string | Путь к файлу закрытого SSL-ключа. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| ssl_key_password | string | Пароль для файла SSL-ключа. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| status | integer | Статус прототипа элемента данных. Possible values: 0 - (default) enabled item prototype; 1 - disabled item prototype; 3 - unsupported item prototype. |
| status_codes | string | Диапазоны требуемых HTTP-кодов состояния, разделенные запятыми. Также поддерживает пользовательские макросы или макросы LLD как часть списка, разделенного запятыми. Пример: 200,200-{$M},{$M},200-400 Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| templateid | ID | ID родительского шаблона прототипа элемента данных. Property behavior: - read-only |
| timeout | string | Тайм-аут запроса опроса данных элемента данных. Принимает секунды или единицу времени с суффиксом (например, 30s, 1m). Также принимает пользовательские макросы и макросы LLD. Диапазон допустимых значений: 1-600s. По умолчанию: "" - использовать настройки proxy/глобальные настройки. Property behavior: - supported if type is set to "Zabbix agent" (0), "Simple check" (3) and key_ does not start with "vmware." and "icmpping", "Zabbix agent (active)" (7), "External check" (10), "Database monitor" (11), "SSH agent" (13), "TELNET agent" (14), "HTTP agent" (19), "SNMP agent" (20) and snmp_oid starts with "walk[" or "get[", "Script" (21), "Browser" (22)- read-only for inherited objects |
| trapper_hosts | string | Разрешенные узлы сети. Property behavior: - supported if type is set to "Zabbix trapper", or if type is set to "HTTP agent" and allow_traps is set to "Allow to accept incoming data" |
| trends | string | Единица времени, определяющая, как долго должны храниться данные трендов. Также принимает пользовательский макрос и макрос LLD. По умолчанию: 365d. Property behavior: - supported if value_type is set to "numeric float" or "numeric unsigned" |
| units | string | Единицы значения. Property behavior: - supported if value_type is set to "numeric float" or "numeric unsigned"- read-only for inherited objects |
| username | string | Имя пользователя для аутентификации. Property behavior: - required if type is set to "SSH agent" or "TELNET agent", or if type is set to "JMX agent" and password is set- supported if type is set to "Simple check", "Database monitor", or "HTTP agent"- read-only for inherited objects (if type is set to "HTTP agent") |
| uuid | string | Универсальный уникальный идентификатор, используемый для связывания импортированных прототипов элементов данных с уже существующими. Генерируется автоматически, если не указан. Property behavior: - supported if the item prototype belongs to a template |
| valuemapid | ID | ID связанной карты значений. Property behavior: - supported if value_type is set to "numeric float", "character", or "numeric unsigned"- read-only for inherited objects |
| verify_host | integer | Следует ли проверять, что имя узла сети для соединения совпадает с именем в сертификате узла сети. Possible values: 0 - (default) Do not validate; 1 - Validate. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| verify_peer | integer | Следует ли проверять, что сертификат узла сети является подлинным. Possible values: 0 - (default) Do not validate; 1 - Validate. Property behavior: - supported if type is set to "HTTP agent"- read-only for inherited objects |
| discover | integer | Статус обнаружения прототипа элемента данных. Possible values: 0 - (default) new items will be discovered; 1 - new items will not be discovered and existing items will be marked as lost. |
HTTP-заголовок
Объект заголовка имеет следующие свойства:
| Property | Type | Description |
|---|---|---|
| name | string | Имя HTTP-заголовка. Поведение свойства: - required |
| value | string | Значение заголовка. Поведение свойства: - required |
Поле HTTP-запроса
Объект поля запроса определяет имя и значение, которые используются для указания параметра URL. Он имеет следующие свойства:
| Property | Type | Description |
|---|---|---|
| name | string | Имя параметра. Property behavior: - required |
| value | string | Значение параметра. Property behavior: - required |
Тег прототипа элемента данных
Объект тега прототипа элемента данных имеет следующие свойства.
| Property | Type | Description |
|---|---|---|
| tag | string | Имя тега прототипа элемента данных. Поведение свойства: - required |
| value | string | Значение тега прототипа элемента данных. |
Предобработка прототипа элемента данных
Объект предобработки прототипа элемента данных имеет следующие свойства.
| Property | Type | Description |
|---|---|---|
| type | integer | Тип опции предобработки. Возможные значения: 1 - Пользовательский множитель; 2 - Обрезка справа; 3 - Обрезка слева; 4 - Обрезка; 5 - Регулярное выражение; 6 - Булево в десятичное; 7 - Восьмеричное в десятичное; 8 - Шестнадцатеричное в десятичное; 9 - Простое изменение; 10 - Изменение за секунду; 11 - XML XPath; 12 - JSONPath; 13 - В диапазоне; 14 - Соответствует регулярному выражению; 15 - Не соответствует регулярному выражению; 16 - Проверка ошибки в JSON; 17 - Проверка ошибки в XML; 18 - Проверка ошибки с использованием регулярного выражения; 19 - Отбрасывать неизменившееся; 20 - Отбрасывать неизменившееся с heartbeat; 21 - JavaScript; 22 - Шаблон Prometheus; 23 - Prometheus в JSON; 24 - CSV в JSON; 25 - Замена; 26 - Проверка неподдерживаемого; 27 - XML в JSON; 28 - Значение обхода SNMP; 29 - Обход SNMP в JSON; 30 - Получение значения SNMP. Property behavior: - required |
| params | string | Дополнительные параметры, используемые опцией предобработки. Несколько параметров разделяются символом новой строки (\n). Если type установлен в "Check unsupported", параметры следуют синтаксису <scope>[\n<pattern>], где pattern - регулярное выражение, а scope - одно из:-1 - сопоставить любую ошибку; \ 0 - проверить, совпадает ли сообщение об ошибке с pattern; \ 1 - проверить, не совпадает ли сообщение об ошибке с pattern. Property behavior: - required if type is set to "Custom multiplier" (1), "Right trim" (2), "Left trim" (3), "Trim" (4), "Regular expression" (5), "XML XPath" (11), "JSONPath" (12), "In range" (13), "Matches regular expression" (14), "Does not match regular expression" (15), "Check for error in JSON" (16), "Check for error in XML" (17), "Check for error using regular expression" (18), "Discard unchanged with heartbeat" (20), "JavaScript" (21), "Prometheus pattern" (22), "Prometheus to JSON" (23), "CSV to JSON" (24), "Replace" (25), "Check unsupported" (26), "SNMP walk value" (28), "SNMP walk to JSON" (29), or "SNMP get value" (30) |
| error_handler | integer | Тип действия, используемый в случае сбоя шага предобработки. Возможные значения: 0 - Сообщение об ошибке задается сервером Zabbix; 1 - Отбросить значение; 2 - Установить пользовательское значение; 3 - Установить пользовательское сообщение об ошибке. Возможные значения, если type установлен в "Check unsupported":1 - Отбросить значение; 2 - Установить пользовательское значение; 3 - Установить пользовательское сообщение об ошибке. Property behavior: - required if type is set to "Custom multiplier" (1), "Regular expression" (5), "Boolean to decimal" (6), "Octal to decimal" (7), "Hexadecimal to decimal" (8), "Simple change" (9), "Change per second" (10), "XML XPath" (11), "JSONPath" (12), "In range" (13), "Matches regular expression" (14), "Does not match regular expression" (15), "Check for error in JSON" (16), "Check for error in XML" (17), "Check for error using regular expression" (18), "Prometheus pattern" (22), "Prometheus to JSON" (23), "CSV to JSON" (24), "Check unsupported" (26), "XML to JSON" (27), "SNMP walk value" (28), "SNMP walk to JSON" (29), or "SNMP get value" (30) |
| error_handler_params | string | Параметры обработчика ошибок. Property behavior: - required if error_handler is set to "Set custom value" or "Set custom error message" |
Для каждого типа предобработки поддерживаются следующие параметры и обработчики ошибок.
| Preprocessing type | Name | Parameter 1 | Parameter 2 | Parameter 3 | Supported error handlers |
|---|---|---|---|---|---|
| 1 | Custom multiplier | number1, 6 | 0, 1, 2, 3 | ||
| 2 | Right trim | list of characters2 | |||
| 3 | Left trim | list of characters2 | |||
| 4 | Trim | list of characters2 | |||
| 5 | Regular expression | pattern3 | output2 | 0, 1, 2, 3 | |
| 6 | Boolean to decimal | 0, 1, 2, 3 | |||
| 7 | Octal to decimal | 0, 1, 2, 3 | |||
| 8 | Hexadecimal to decimal | 0, 1, 2, 3 | |||
| 9 | Simple change | 0, 1, 2, 3 | |||
| 10 | Change per second | 0, 1, 2, 3 | |||
| 11 | XML XPath | path4 | 0, 1, 2, 3 | ||
| 12 | JSONPath | path4 | 0, 1, 2, 3 | ||
| 13 | In range | min1, 6 | max1, 6 | 0, 1, 2, 3 | |
| 14 | Matches regular expression | pattern3 | 0, 1, 2, 3 | ||
| 15 | Does not match regular expression | pattern3 | 0, 1, 2, 3 | ||
| 16 | Check for error in JSON | path4 | 0, 1, 2, 3 | ||
| 17 | Check for error in XML | path4 | 0, 1, 2, 3 | ||
| 18 | Check for error using regular expression | pattern3 | output2 | 0, 1, 2, 3 | |
| 19 | Discard unchanged | ||||
| 20 | Discard unchanged with heartbeat | seconds5, 6 | |||
| 21 | JavaScript | script2 | |||
| 22 | Prometheus pattern | pattern6, 7 | value, label, function |
output8, 9 | 0, 1, 2, 3 |
| 23 | Prometheus to JSON | pattern6, 7 | 0, 1, 2, 3 | ||
| 24 | CSV to JSON | character2 | character2 | 0,1 | 0, 1, 2, 3 |
| 25 | Replace | search string2 | replacement2 | ||
| 26 | Check unsupported | scope1 | pattern3, 6 | 1, 2, 3 | |
| 27 | XML to JSON | 0, 1, 2, 3 | |||
| 28 | SNMP walk value | OID2 | Format: 0 - Unchanged 1 - UTF-8 from Hex-STRING 2 - MAC from Hex-STRING 3 - Integer from BITS |
0, 1, 2, 3 | |
| 29 | SNMP walk to JSON10 | Field name2 | OID prefix2 | Format: 0 - Unchanged 1 - UTF-8 from Hex-STRING 2 - MAC from Hex-STRING 3 - Integer from BITS |
0, 1, 2, 3 |
| 30 | SNMP get value | Format: 1 - UTF-8 from Hex-STRING 2 - MAC from Hex-STRING 3 - Integer from BITS |
0, 1, 2, 3 | ||
1 целое или число с плавающей точкой
2 строка
3 регулярное выражение
4 JSONPath или XML XPath
5 положительное целое число (с поддержкой суффиксов времени, например 30s, 1m, 2h,
1d)
6 пользовательский макрос, макрос LLD
7 шаблон Prometheus в синтаксисе:
<metric name>{<label name>="<label value>", ...} == <value>. Каждый
компонент шаблона Prometheus (метрика, имя метки, значение метки и значение метрики)
может быть пользовательским макросом или макросом LLD.
8 вывод Prometheus в синтаксисе: <label name> (может быть пользовательским макросом или макросом LLD), если label выбран в качестве
второго параметра.
9 Одна из функций агрегации: sum, min, max, avg, count, если function выбран в качестве второго
параметра.
10 Поддерживает несколько записей "Field name,OID prefix,Format records", разделенных символом новой строки.