[comment]: # translation:outdated

[comment]: # ({6bb9f60f-6bb9f60f})
# > Objeto de artículo

Los siguientes objetos están directamente relacionados con la API 'item'.

[comment]: # ({/6bb9f60f-6bb9f60f})

[comment]: # ({4eeb6232-385ac8b5})
### Item

::: noteclassic
Web items cannot be directly created, updated or deleted via
the Zabbix API.
:::

The item object has the following properties.

|Property|[Type](/manual/api/reference_commentary#data_types)|Description|
|--------|---------------------------------------------------|-----------|
|itemid|string|*(readonly)* ID of the item.|
|**delay**<br>(required)|string|Update interval of the item. Accepts seconds or a time unit with suffix (30s,1m,2h,1d).<br>Optionally one or more [custom intervals](/manual/config/items/item/custom_intervals) can be specified either as flexible intervals or scheduling.<br>Multiple intervals are separated by a semicolon.<br>User 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.<br>Flexible intervals may be written as two macros separated by a forward slash (e.g. `{$FLEX_INTERVAL}/{$FLEX_PERIOD}`).<br><br>Optional for Zabbix trapper, dependent items and for Zabbix agent (active) with `mqtt.get` key.|
|**hostid**<br>(required)|string|ID of the host or template that the item belongs to.<br><br>For update operations this field is *readonly*.|
|**interfaceid**<br>(required)|string|ID of the item's host interface.<br><br>Not required for template items. Optional for internal, active agent, trapper, calculated, dependent and database monitor items.|
|**key\_**<br>(required)|string|Item key.|
|**name**<br>(required)|string|Name of the item.|
|**type**<br>(required)|integer|Type of the item.<br><br>Possible values:<br>0 - Zabbix agent;<br>2 - Zabbix trapper;<br>3 - Simple check;<br>5 - Zabbix internal;<br>7 - Zabbix agent (active);<br>9 - Web item;<br>10 - External check;<br>11 - Database monitor;<br>12 - IPMI agent;<br>13 - SSH agent;<br>14 - Telnet agent;<br>15 - Calculated;<br>16 - JMX agent;<br>17 - SNMP trap;<br>18 - Dependent item;<br>19 - HTTP agent;<br>20 - SNMP agent;<br>21 - Script|
|**url**<br>(required)|string|URL string, required only for HTTP agent item type. Supports user macros, {HOST.IP}, {HOST.CONN}, {HOST.DNS}, {HOST.HOST}, {HOST.NAME}, {ITEM.ID}, {ITEM.KEY}.|
|**value\_type**<br>(required)|integer|Type of information of the item.<br><br>Possible values:<br>0 - numeric float;<br>1 - character;<br>2 - log;<br>3 - numeric unsigned;<br>4 - text.|
|allow\_traps|integer|HTTP agent item field. Allow to populate value as in trapper item type also.<br><br>0 - *(default)* Do not allow to accept incoming data.<br>1 - Allow to accept incoming data.|
|authtype|integer|Used only by SSH agent items or HTTP agent items.<br><br>SSH agent authentication method possible values:<br>0 - *(default)* password;<br>1 - public key.<br><br>HTTP agent authentication method possible values:<br>0 - *(default)* none<br>1 - basic<br>2 - NTLM<br>3 - Kerberos|
|description|string|Description of the item.|
|error|string|*(readonly)* Error text if there are problems updating the item.|
|flags|integer|*(readonly)* Origin of the item.<br><br>Possible values:<br>0 - a plain item;<br>4 - a discovered item.|
|follow\_redirects|integer|HTTP agent item field. Follow response redirects while pooling data.<br><br>0 - Do not follow redirects.<br>1 - *(default)* Follow redirects.|
|headers|object|HTTP agent item field. Object with HTTP(S) request headers, where header name is used as key and header value as value.<br><br>Example:<br>{ "User-Agent": "Zabbix" }|
|history|string|A time unit of how long the history data should be stored. Also accepts user macro.<br><br>Default: 90d.|
|http\_proxy|string|HTTP agent item field. HTTP(S) proxy connection string.|
|inventory\_link|integer|ID of the host inventory field that is populated by the item.<br><br>Refer to the [host inventory page](/manual/api/reference/host/object#host_inventory) for a list of supported host inventory fields and their IDs.<br><br>Default: 0.|
|ipmi\_sensor|string|IPMI sensor. Used only by IPMI items.|
|jmx\_endpoint|string|JMX agent custom connection string.<br><br>Default value:<br>service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi|
|lastclock|timestamp|*(readonly)* Time when the item was last updated.<br><br>By default, only values that fall within the last 24 hours are displayed. You can extend this time period by changing the value of *Max history display period* parameter in the *[Administration → General](/manual/web_interface/frontend_sections/administration/general#gui)* menu section.|
|lastns|integer|*(readonly)* Nanoseconds when the item was last updated.<br><br>By default, only values that fall within the last 24 hours are displayed. You can extend this time period by changing the value of *Max history display period* parameter in the *[Administration → General](/manual/web_interface/frontend_sections/administration/general#gui)* menu section.|
|lastvalue|string|*(readonly)* Last value of the item.<br><br>By default, only values that fall within the last 24 hours are displayed. You can extend this time period by changing the value of *Max history display period* parameter in the *[Administration → General](/manual/web_interface/frontend_sections/administration/general#gui)* menu section.|
|logtimefmt|string|Format of the time in log entries. Used only by log items.|
|master\_itemid|integer|Master item ID.<br>Recursion up to 3 dependent items and maximum count of dependent items equal to 29999 are allowed.<br><br>Required by dependent items.|
|output\_format|integer|HTTP agent item field. Should response be converted to JSON.<br><br>0 - *(default)* Store raw.<br>1 - Convert to JSON.|
|params|string|Additional parameters depending on the type of the item:<br>- executed script for SSH and Telnet items;<br>- SQL query for database monitor items;<br>- formula for calculated items;<br>- the script for script item.|
|parameters|array|Additional parameters for script items. Array of objects with 'name' and 'value' properties, where name must be unique.|
|password|string|Password for authentication. Used by simple check, SSH, Telnet, database monitor, JMX and HTTP agent items.<br>When used by JMX, username should also be specified together with password or both properties should be left blank.|
|post\_type|integer|HTTP agent item field. Type of post data body stored in posts property.<br><br>0 - *(default)* Raw data.<br>2 - JSON data.<br>3 - XML data.|
|posts|string|HTTP agent item field. HTTP(S) request body data. Used with post\_type.|
|prevvalue|string|*(readonly)* Previous value of the item.<br><br>By default, only values that fall within the last 24 hours are displayed. You can extend this time period by changing the value of *Max history display period* parameter in the *[Administration → General](/manual/web_interface/frontend_sections/administration/general#gui)* menu section.|
|privatekey|string|Name of the private key file.|
|publickey|string|Name of the public key file.|
|query\_fields|array|HTTP agent item field. Query parameters. Array of objects with 'key':'value' pairs, where value can be empty string.|
|request\_method|integer|HTTP agent item field. Type of request method.<br><br>0 - *(default)* GET<br>1 - POST<br>2 - PUT<br>3 - HEAD|
|retrieve\_mode|integer|HTTP agent item field. What part of response should be stored.<br><br>0 - *(default)* Body.<br>1 - Headers.<br>2 - Both body and headers will be stored.<br><br>For request\_method HEAD only 1 is allowed value.|
|snmp\_oid|string|SNMP OID.|
|ssl\_cert\_file|string|HTTP agent item field. Public SSL Key file path.|
|ssl\_key\_file|string|HTTP agent item field. Private SSL Key file path.|
|ssl\_key\_password|string|HTTP agent item field. Password for SSL Key file.|
|state|integer|*(readonly)* State of the item.<br><br>Possible values:<br>0 - *(default)* normal;<br>1 - not supported.|
|status|integer|Status of the item.<br><br>Possible values:<br>0 - *(default)* enabled item;<br>1 - disabled item.|
|status\_codes|string|HTTP agent item field. Ranges of required HTTP status codes separated by commas. Also supports user macros as part of comma separated list.<br><br>Example: 200,200-{$M},{$M},200-400|
|templateid|string|(readonly) ID of the parent template item.<br><br>*Hint*: Use the `hostid` property to specify the template that the item belongs to.|
|timeout|string|Item data polling request timeout. Used for HTTP agent and script items. Supports user macros.<br><br>default: 3s<br>maximum value: 60s|
|trapper\_hosts|string|Allowed hosts. Used by trapper items or HTTP agent items.|
|trends|string|A time unit of how long the trends data should be stored. Also accepts user macro.<br><br>Default: 365d.|
|units|string|Value units.|
|username|string|Username for authentication. Used by simple check, SSH, Telnet, database monitor, JMX and HTTP agent items.<br><br>Required by SSH and Telnet items.<br>When used by JMX, password should also be specified together with username or both properties should be left blank.|
|uuid|string|Universal unique identifier, used for linking imported item to already existing ones. Used only for items on templates. Auto-generated, if not given.<br><br>For update operations this field is *readonly*.|
|valuemapid|string|ID of the associated value map.|
|verify\_host|integer|HTTP agent item field. Validate host name in URL is in Common Name field or a Subject Alternate Name field of host certificate.<br><br>0 - *(default)* Do not validate.<br>1 - Validate.|
|verify\_peer|integer|HTTP agent item field. Validate is host certificate authentic.<br><br>0 - *(default)* Do not validate.<br>1 - Validate.|

[comment]: # ({/4eeb6232-385ac8b5})

[comment]: # ({5146f10c-c1b98afa})
### Etiqueta de la métrica

El objeto de etiqueta de métrica tiene las siguientes propiedades.

|Propiedad|[Tipo](/manual/api/reference_commentary#data_types)|Descripción|
|--|--|------|
|**tag**<br>(obligatorio)|cadena|Nombre de etiqueta de la métrica.|
|value|cadena|Valor de etiqueta de la métrica.|

[comment]: # ({/5146f10c-c1b98afa})

[comment]: # ({d697250d-2169bb78})
### Preprocesamiento de artículos

El objeto de preprocesamiento de elementos tiene las siguientes propiedades.

|Propiedad|[Tipo](/manual/api/reference_commentary#data_types)|Descripción|
|--|--|------|
|**tipo**<br>(obligatorio)|entero|El tipo de opción de preprocesamiento.<br><br>Valores posibles:<br>1 - Multiplicador personalizado;<br>2 - Recorte derecho;<br>3 - Recorte izquierdo;<br>4 - Recortar;<br>5 - Coincidencia de expresiones regulares;<br>6 - Booleano a decimal;<br>7 - Octal a decimal;<br>8 - Hexadecimal a decimal;<br>9 - Cambio simple;<br>10 - Cambio por segundo;<br>11 - XML XPath;<br>12 - JSONPath;<br>13 - Dentro del rango;<br>14 - Coincide con expresiones regulares;<br>15 - No coincide con la expresión regular;<br>16 - Verificar errores en JSON;<br>17 - Verificar errores en XML;<br>18 - Verificar errores usando expresiones regulares;<br>19 - Descartar sin cambios;<br >20 - Descartar sin cambios con latido;<br>21 - JavaScript;<br>22 - Patrón de Prometheus;<br>23 - Prometheus a JSON;<br>24 - CSV a JSON;<br>25 - Reemplazar;<br >26 - Marcar no compatible;<br>27 - XML a JSON.|
|**params**<br>(obligatorio)|cadena|Parámetros adicionales utilizados por la opción de preprocesamiento. Varios parámetros están separados por el carácter LF (\\n).|
|**error\_handler**<br>(obligatorio)|entero|Tipo de acción utilizado en caso de error en el paso de preprocesamiento.<br><br>Valores posibles:<br>0: el servidor Zabbix establece el mensaje de error;< br>1 - Descartar valor;<br>2 - Establecer valor personalizado;<br>3 - Establecer mensaje de error personalizado.|
|**error\_handler\_params**<br>(obligatorio)|cadena|Parámetros del controlador de errores. Se usa con `error_handler`.<br><br>Debe estar vacío, si `error_handler` es 0 o 1.<br>Puede estar vacío si `error_handler` es 2.<br>No puede estar vacío, si `error_handler` es 3.|

Los siguientes parámetros y controladores de errores son compatibles con cada
tipo de preprocesamiento.

|Tipo de preprocesamiento|Nombre|Parámetro 1|Parámetro 2|Parámetro 3|Manejadores de errores admitidos|
|------------------|----|-----------|-----------|- ----------|---------------------------------|
|1|Multiplicador personalizado|número^1,\ 6^|<|<|0, 1, 2, 3|
|2|Recorte derecho|lista de caracteres^2^|<|<|<|
|3|Recorte izquierdo|lista de caracteres^2^|<|<|<|
|4|Recortar|lista de caracteres^2^|<|<|<|
|5|Expresión regular|patrón^3^|salida^2^|<|0, 1, 2, 3|
|6|Booleano a decimal|<|<|<|0, 1, 2, 3|
|7|Octal a decimal|<|<|<|0, 1, 2, 3|
|8|Hexadecimal a decimal|<|<|<|0, 1, 2, 3|
|9|Cambio simple|<|<|<|0, 1, 2, 3|
|10|Cambio por segundo|<|<|<|0, 1, 2, 3|
|11|XML XPath|ruta^4^|<|<|0, 1, 2, 3|
|12|JSONPath|ruta^4^|<|<|0, 1, 2, 3|
|13|En el rango|min^1,\ 6^|max^1,\ 6^|<|0, 1, 2, 3|
|14|Coincide con la expresión regular|patrón^3^|<|<|0, 1, 2, 3|
|15|No coincide con la expresión regular|patrón^3^|<|<|0, 1, 2, 3|
|16|Compruebe si hay errores en JSON|ruta^4^|<|<|0, 1, 2, 3|
|17|Compruebe si hay errores en XML|ruta^4^|<|<|0, 1, 2, 3|
|18|Compruebe si hay errores usando la expresión regular|patrón^3^|salida^2^|<|0, 1, 2, 3|
|19|Descartar sin cambios|<|<|<|<|
|20|Descartar sin cambios con latido|segundos^5,\ 6^|<|<|<|
|21|JavaScript|script^2^|<|<|<|
|22|Patrón de Prometeo|patrón^6,\ 7^|`valor`, `etiqueta`, `función`|salida^8,\ 9^|0, 1, 2, 3|
|23|Prometeo a JSON|patrón^6,\ 7^|<|<|0, 1, 2, 3|
|24|CSV a JSON|carácter^2^|carácter^2^|0,1|0, 1, 2, 3|
|25|Reemplazar|cadena de búsqueda^2^|reemplazo^2^|<|<|
|26|Comprobación no admitida|<|<|<|1, 2, 3|
|27|XML a JSON|<|<|<|0, 1, 2, 3|

^1^ número entero o de punto flotante\
^2^ cadena\
^3^ expresión regular\
^4^ JSONPath o XML XPath\
^5^ entero positivo (con soporte de sufijos de tiempo, por ejemplo, 30s, 1m, 2h,
1d)\
^6^ macro de usuario\
^7^ Patrón de Prometheus siguiendo la sintaxis:
`<nombre de métrica>{<nombre de etiqueta>="<valor de etiqueta>", ...} == <valor>`. Cada
Componente del patrón Prometheus (métrica, nombre de etiqueta, valor de etiqueta y métrica)
valor) puede ser una macro de usuario.\
^8^ Salida de Prometheus siguiendo la sintaxis: `<nombre de etiqueta>` (puede ser una macro de usuario) si se selecciona `etiqueta` como segundo parámetro.\
^9^ Una de las funciones de agregación: `suma`, `min`, `max`, `avg`, `count` si se selecciona `función` como segundo parámetro.

[comment]: # ({/d697250d-2169bb78})
