> Item prototype object

The following objects are directly related to the itemprototype API.

Item prototype

The item prototype object has the following properties.

PropertyTypeDescription
itemidstring(readonly) ID of the item prototype.
delay
(required)
stringUpdate interval of the item prototype. Accepts seconds or a time unit with suffix (30s,1m,2h,1d).
Optionally one or more custom intervals can be specified either as flexible intervals or scheduling.
Multiple intervals are separated by a semicolon.
User macros and LLD macros may be used. A single macro has to fill the whole field. Multiple macros in a field or macros mixed with text are not supported.
Flexible intervals may be written as two macros separated by a forward slash (e.g. {$FLEXINTERVAL}/{$FLEX_PERIOD}).

Optional for Zabbix trapper, dependent items and for Zabbix agent (active) with mqtt.get key.
hostid
(required)
stringID of the host that the item prototype belongs to.

For update operations this field is readonly.
ruleid
(required)
stringID of the LLD rule that the item belongs to.

For update operations this field is readonly.
interfaceid
(required)
stringID of the item prototype’s host interface. Used only for host item prototypes.

Optional for Zabbix agent (active), Zabbix internal, Zabbix trapper, Dependent item, Zabbix aggregate, database monitor and calculated item prototypes.
key
(required)
stringItem prototype key.
name
(required)
stringName of the item prototype.
type
(required)
integerType of the item prototype.

Possible values:
0 - Zabbix agent;
2 - Zabbix trapper;
3 - simple check;
5 - Zabbix internal;
7 - Zabbix agent (active);
8 - Zabbix aggregate;
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.
url
(required)
stringURL string required only for HTTP agent item prototypes. Supports LLD macros, user macros, {HOST.IP}, {HOST.CONN}, {HOST.DNS}, {HOST.HOST}, {HOST.NAME}, {ITEM.ID}, {ITEM.KEY}.
value_type
(required)
integerType of information of the item prototype.

Possible values:
0 - numeric float;
1 - character;
2 - log;
3 - numeric unsigned;
4 - text.
allow_trapsintegerHTTP agent item prototype field. Allow to populate value as in trapper item type also.

0 - (default) Do not allow to accept incoming data.
1 - Allow to accept incoming data.
authtypeintegerUsed only by SSH agent item prototypes or HTTP agent item prototypes.

SSH agent authentication method possible values:
0 - (default) password;
1 - public key.

HTTP agent authentication method possible values:
0 - (default) none
1 - basic
2 - NTLM
3 - Kerberos
descriptionstringDescription of the item prototype.
follow_redirectsintegerHTTP agent item prototype field. Follow respose redirects while pooling data.

0 - Do not follow redirects.
1 - (default) Follow redirects.
headersobjectHTTP agent item prototype field. Object with HTTP(S) request headers, where header name is used as key and header value as value.

Example:
{ “User-Agent”: “Zabbix” }
historystringA time unit of how long the history data should be stored. Also accepts user macro and LLD macro.

Default: 90d.
http_proxystringHTTP agent item prototype field. HTTP(S) proxy connection string.
ipmi_sensorstringIPMI sensor. Used only by IPMI item prototypes.
jmx_endpointstringJMX agent custom connection string.

Default value:
service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi
logtimefmtstringFormat of the time in log entries. Used only by log item prototypes.
master_itemidintegerMaster item ID.
Recursion up to 3 dependent items and item prototypes and maximum count of dependent items and item prototypes equal to 29999 are allowed.

Required by Dependent items.
output_formatintegerHTTP agent item prototype field. Should response converted to JSON.

0 - (default) Store raw.
1 - Convert to JSON.
paramsstringAdditional parameters depending on the type of the item prototype:
- executed script for SSH and Telnet item prototypes;
- SQL query for database monitor item prototypes;
- formula for calculated item prototypes.
parametersarrayAdditional parameters for script item prototypes. Array of objects with ‘name’ and ‘value’ properties, where name must be unique.
passwordstringPassword for authentication. Used by simple check, SSH, Telnet, database monitor, JMX and HTTP agent item prototypes.
post_typeintegerHTTP agent item prototype field. Type of post data body stored in posts property.

0 - (default) Raw data.
2 - JSON data.
3 - XML data.
postsstringHTTP agent item prototype field. HTTP(S) request body data. Used with post_type.
privatekeystringName of the private key file.
publickeystringName of the public key file.
query_fieldsarrayHTTP agent item prototype field. Query parameters. Array of objects with ‘key’:’value’ pairs, where value can be empty string.
request_methodintegerHTTP agent item prototype field. Type of request method.

0 - (default) GET
1 - POST
2 - PUT
3 - HEAD
retrieve_modeintegerHTTP agent item prototype field. What part of response should be stored.

0 - (default) Body.
1 - Headers.
2 - Both body and headers will be stored.

For request_method HEAD only 1 is allowed value.
snmp_oidstringSNMP OID.
ssl_cert_filestringHTTP agent item prototype field. Public SSL Key file path.
ssl_key_filestringHTTP agent item prototype field. Private SSL Key file path.
ssl_key_passwordstringHTTP agent item prototype field. Password for SSL Key file.
statusintegerStatus of the item prototype.

Possible values:
0 - (default) enabled item prototype;
1 - disabled item prototype;
3 - unsupported item prototype.
status_codesstringHTTP agent item prototype field. Ranges of required HTTP status codes separated by commas. Also supports user macros or LLD macros as part of comma separated list.

Example: 200,200-{$M},{$M},200-400
templateidstring(readonly) ID of the parent template item prototype.
timeoutstringItem data polling request timeout. Used for HTTP agent and script item prototypes. Supports user macros and LLD macros.

default: 3s
maximum value: 60s
trapper_hostsstringAllowed hosts. Used by trapper item prototypes or HTTP item prototypes.
trendsstringA time unit of how long the trends data should be stored. Also accepts user macro and LLD macro.

Default: 365d.
unitsstringValue units.
usernamestringUsername for authentication. Used by simple check, SSH, Telnet, database monitor, JMX and HTTP agent item prototypes.

Required by SSH and Telnet item prototypes.
valuemapidstringID of the associated value map.
verify_hostintegerHTTP agent item prototype field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate.

0 - (default) Do not validate.
1 - Validate.
verify_peerintegerHTTP agent item prototype field. Validate is host certificate authentic.

0 - (default) Do not validate.
1 - Validate.
discoverintegerItem prototype discovery status.

Possible values:
0 - (default) new items will be discovered;
1 - new items will not be discovered and existing items will be marked as lost.

Item prototype preprocessing

The item prototype preprocessing object has the following properties.

PropertyTypeDescription
type
(required)
integerThe preprocessing option type.

Possible values:
1 - Custom multiplier;
2 - Right trim;
3 - Left trim;
4 - Trim;
5 - Regular expression matching;
6 - Boolean to decimal;
7 - Octal to decimal;
8 - Hexadecimal to decimal;
9 - Simple change;
10 - Change per second;
11 - XML XPath;
12 - JSONPath;
13 - In range;
14 - Matches regular expression;
15 - Does not match regular expression;
16 - Check for error in JSON;
17 - Check for error in XML;
18 - Check for error using regular expression;
19 - Discard unchanged;
20 - Discard unchanged with heartbeat;
21 - JavaScript;
22 - Prometheus pattern;
23 - Prometheus to JSON;
24 - CSV to JSON;
25 - Replace;
26 - Check unsupported.
params
(required)
stringAdditional parameters used by preprocessing option. Multiple parameters are separated by LF (\n) character.
error_handler
(required)
integerAction type used in case of preprocessing step failure.

Possible values:
0 - Error message is set by Zabbix server;
1 - Discard value;
2 - Set custom value;
3 - Set custom error message.
error_handler_params
(required)
stringError handler parameters. Used with error_handler.

Must be empty, if error_handler is 0 or 1.
Can be empty if, error_handler is 2.
Cannot be empty, if error_handler is 3.

The following parameters and error handlers are supported for each preprocessing type.

Preprocessing typeNameParameter 1Parameter 2Parameter 3Supported error handlers
1Custom multipliernumber1, 60, 1, 2, 3
2Right trimlist of characters2
3Left trimlist of characters2
4Trimlist of characters2
5Regular expressionpattern3output20, 1, 2, 3
6Boolean to decimal0, 1, 2, 3
7Octal to decimal0, 1, 2, 3
8Hexadecimal to decimal0, 1, 2, 3
9Simple change0, 1, 2, 3
10Change per second0, 1, 2, 3
11XML XPathpath40, 1, 2, 3
12JSONPathpath40, 1, 2, 3
13In rangemin1, 6max1, 60, 1, 2, 3
14Matches regular expressionpattern30, 1, 2, 3
15Does not match regular expressionpattern30, 1, 2, 3
16Check for error in JSONpath40, 1, 2, 3
17Check for error in XMLpath40, 1, 2, 3
18Check for error using regular expressionpattern3output20, 1, 2, 3
19Discard unchanged
20Discard unchanged with heartbeatseconds5, 6
21JavaScriptscript2
22Prometheus patternpattern6, 7output6, 80, 1, 2, 3
23Prometheus to JSONpattern6, 70, 1, 2, 3
24CSV to JSONcharacter2character20,10, 1, 2, 3
25Replacesearch string2replacement2
26Check unsupported0, 1, 2, 3

1 integer or floating-point number
2 string
3 regular expression
4 JSONPath or XML XPath
5 positive integer (with support of time suffixes, e.g. 30s, 1m, 2h, 1d)
6 user macro, LLD macro
7 Prometheus pattern following the syntax: <metric name>{<label name>=“<label value>”, …} == <value>. Each Prometheus pattern component (metric, label name, label value and metric value) can be user macro or LLD macro.
8 Prometheus output following the syntax: <label name>.