Zabbix Documentation 2.0

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


manual:appendix:api:item:definitions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:appendix:api:item:definitions [2012/10/10 12:48]
zalex_ua added "flags" and its description
manual:appendix:api:item:definitions [2018/12/17 10:02] (current)
martins-v 'hostid' clarified to include both hosts and templates
Line 1: Line 1:
-===== > definitions ​=====+===== > Item object ​=====
  
-==== Object details ====+The following objects are directly related to the ''​item''​ API.
  
-The table contains complete list of Item attributes.+==== Item ====
  
-^  Parameter ​ ^  Type  ^  Description ​ ^  Details ​ ^ +<​note>​Web items cannot be directly created, updated ​or deleted via the Zabbix API.</note>
-|itemid ​ |//​int// ​ |Item ID  |  | +
-|type  |//​int// ​ |Type  |  | +
-|snmp_community ​ |//​string// ​ |SNMP Community name |  | +
-|snmp_oid ​ |//​string// ​ |SNMP OID  |  | +
-|port| ​ //​int// ​ |Item custom port  |  | +
-|hostid ​ |//​int// ​ |Host ID  |  | +
-|name  |//​string// ​ |Item name  |  | +
-|key_  |//​string// ​ |Item key  |  | +
-|delay ​ |//​int// ​ |Check interval ​ |  | +
-|history ​ |//​int// ​ |How long to keep item history (days) ​ |  | +
-|trends ​ |//​int// ​ |How long to keep item trends (days) ​ |  | +
-|lastvalue ​ |//​string// ​ |Last value  |  | +
-|lastclock ​ |//​int// ​ |Last check  |  | +
-|prevvalue ​ |//​string// ​ |Previous value  |  | +
-|status ​ |//​int// ​ |Item status ​ |  | +
-|value_type ​ |//​int// ​ |Value type  |  | +
-|trapper_hosts ​ |//​string// ​ |  |  | +
-|units ​ |//​string// ​ |Value units  |  | +
-|multiplier ​ |//​int// ​ |Value multiplier ​ |  | +
-|delta ​ |//​int// ​ |Store values as delta  |  | +
-|prevorgvalue ​ |//​string// ​ |  |  | +
-|snmpv3_securityname ​ |//​string// ​ |SNMPv3 security name  |  | +
-|snmpv3_securitylevel ​ |//​int// ​ |SNMPv3 security level  |  | +
-|snmpv3_authpassphrase ​ |//​string// ​ |SNMPv3 authentication phrase ​ |  | +
-|snmpv3_privpassphrase ​ |//​string// ​ |SNMPv3 private phrase ​ |  | +
-|formula ​ |//​string// ​ |  |  | +
-|error ​ |//​string// ​ | Item check error  |  | +
-|lastlogsize ​ |//​int// ​ |Last log size  |  | +
-|logtimefmt ​ |//​string// ​ |Log time format ​ |  | +
-|templateid ​ |//​int// ​ |Parent item ID  |  | +
-|valuemapid ​ |//​int// ​ |Value map ID  |  | +
-|delay_flex ​ |//​string// ​ |Flexible delay  |  | +
-|params ​ |//​string// ​ |  |  | +
-|ipmi_sensor ​ |//​string// ​ |IPMI sensor ​ |   | +
-|data_type ​ |//​int// ​ |  |  | +
-|authtype ​ |//​int// ​ |  |  | +
-|username ​ |//​string// ​ |  |  | +
-|password ​ |//​string// ​ |  |  | +
-|publickey ​ |//​string// ​ |  |  | +
-|privatekey ​ |//​string// ​ |  |  | +
-|mtime ​ |//​int// ​ |Micro time  |  | +
-|interfaceid ​ |//​int// ​ |Host interface ID  |  | +
-|description ​ |//​string// ​ |Item description ​ |  | +
-|inventory_link ​ |//​int// ​ |Host inventory field numberthat will be updated ​with the value returned by the item  |  | +
-|flags ​ |//int/ ​|Discovery flag  |  |+
  
-==== Field values ==== +The item object has the following properties.
- +
-=== Type === +
- +
-^  Value  ^  Type  ^ +
-|0    |Zabbix agent  | +
-|1    |SNMPv1 ​ | +
-|2    |Trapper ​ | +
-|3    |Simple check  | +
-|4    |SNMPv2 ​ | +
-|5    |Internal ​ | +
-|6    |SNMPv3 ​ | +
-|7    |Zabbix agent (active) ​ | +
-|8    |Aggregate ​ | +
-|9    |HTTP test (web monitoring scenario step)  | +
-|10   ​|External ​ | +
-|11   ​|Database monitor ​ | +
-|12   ​|IPMI ​ | +
-|13   ​|SSH ​ | +
-|14   ​|telnet ​ | +
-|15   ​|Calculated ​ | +
-|16   ​|JMX ​ | +
-|17   |SNMP trap  | +
- +
-=== Status === +
- +
-^  Value  ^  Type  ^ +
-|0    |active ​ | +
-|1    |disabled ​ | +
-|3    |not supported ​ | +
- +
-=== Value type === +
- +
-^  Value  ^  Type  ^ +
-|0    |Numeric (float) ​ | +
-|1    |Character ​ | +
-|2    |Log  | +
-|3    |Numeric (unsigned) ​ | +
-|4    |Text  | +
- +
-=== Data type === +
- +
-^  Value  ^  Type  ^ +
-|0    |Decimal ​ | +
-|1    |Octal ​ | +
-|2    |Hexadecimal ​ | +
-|3    |Boolean ​ | +
- +
- +
-=== Delta === +
- +
-^  Value  ^  Status ​ ^ +
-|0    |As is  | +
-|1    |Delta (speed per second) ​ | +
-|2    |Delta (simple change) ​ | +
- +
-=== Discovery flags === +
-^  Value  ^  Type  ^  +
-|0  |Normal item  | +
-|1  |Discovery rule  |  +
-|2  |Item prototype. Note - there is an //​ItemPrototype//​ class to manage item prototypes ​ |  +
-|4  |Auto-created item  | +
- +
-==== Common tasks ==== +
-The table contains list of common item-related tasks and possible implementation using Zabbix API +
-^  Task  ^  HOWTO  ^ +
-|Add an item  | Use method **item.create** ​ | +
-|Add a bunch of new items  |Use method **item.create** with array of Item objects ​ | +
-|Enable an item  |Use method **item.update**,​ set **"​status":​0** ​ | +
-|Disable an item  |Use method **item.update**,​ set **"​status":​1** ​ | +
-|Retrieve item details by Item IDs  |Use method **item.get** with parameter **itemids** ​ | +
-|Retrieve items details by Host name  |Use method **item.get** with parameter **filter**, specify **"​host":​ ["<​your host1>"​]** ​ |+
  
 +^  Property ​ ^  Type  ^  Description ​ ^
 +| itemid ​ | string ​ | //​(readonly)//​ ID of the item.  |
 +| **delay** \\ (required) | integer | Update interval of the item in seconds. |
 +| **hostid** \\ (required) | string | ID of the host or template that the item belongs to. |
 +| **interfaceid** \\ (required) | string ​ | ID of the item's host interface.\\ \\ Not required for template items. Optional for Zabbix agent (active), Zabbix internal, Zabbix trapper, Zabbix aggregate, database monitor and calculated items. |
 +| **key_** \\ (required) | string | Item key. |
 +| **name** \\ (required) | string | Name of the item. |
 +| **type** \\ (required) | integer | Type of the item. \\ \\ Possible values: \\ 0 - Zabbix agent; \\ 1 - SNMPv1 agent; \\ 2 - Zabbix trapper; \\ 3 - simple check; \\ 4 - SNMPv2 agent; \\ 5 - Zabbix internal; \\ 6 - SNMPv3 agent; \\ 7 - Zabbix agent (active); \\ 8 - Zabbix aggregate; \\ 9 - web item; \\ 10 - external check; \\ 11 - database monitor; \\ 12 - IPMI agent; \\ 13 - SSH agent; \\ 14 - TELNET agent; \\ 15 - calculated; \\ 16 - JMX agent. |
 +| **value_type** \\ (required) | integer | Type of information of the item. \\ \\ Possible values: \\ 0 - numeric float; \\ 1 - character; \\ 2 - log; \\ 3 - numeric unsigned; \\ 4 - text. |
 +| authtype | integer | SSH authentication method. Used only by SSH agent items. \\ \\ Possible values: \\ 0 - //​(default)//​ password; \\ 1 - public key. |
 +| data_type | integer | Data type of the item. \\ \\ Possible values: \\ 0 - //​(default)//​ decimal; \\ 1 - octal; \\ 2 - hexadecimal;​ \\ 3 - boolean. |
 +| delay_flex | string | Flexible intervals as a serialized string. \\ \\ Each serialized flexible interval consists of an update interval and a [[manual:​appendix:​time_period|time period]] separated by a forward slash. Multiple intervals are separated by a colon. |
 +| delta | integer | Value that will be stored. \\ \\ Possible values: \\ 0 - //​(default)//​ as is; \\ 1 - Delta, speed per second; \\ 2 - Delta, simple change. |
 +| 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. \\ \\ Possible values: \\ 0 - a plain item; \\ 4 - a discovered item. |
 +| formula | integer/​float | Custom multiplier. \\ \\ Default: 1. |
 +| history | integer | Number of days to keep item's history data. \\ \\ Default: 90. |
 +| inventory_link | integer | ID of the host inventory field that is populated by the item. \\ \\ Refer to the [[manual:​appendix:​api:​host:​definitions#​host_inventory|host inventory page]] for a list of supported host inventory fields and their IDs. \\ \\ Default: 0. |
 +| ipmi_sensor | string | IPMI sensor. Used only by IPMI items. |
 +| lastclock | timestamp | //​(readonly)//​ Time when the item was last updated. |
 +| lastns | integer | //​(readonly)//​ Nanoseconds when the item was last updated. |
 +| lastvalue | string | //​(readonly)//​ Last value of the item. |
 +| logtimefmt | string | Format of the time in log entries. Used only by log items. |
 +| mtime | timestamp | Time when the monitored log file was last updated. Used only by log items. |
 +| multiplier | integer | Whether to use a custom multiplier. |
 +| params | string | Additional parameters depending on the type of the item: \\ - executed script for SSH and telnet items; \\ - additional parameters for database monitor items; \\ - formula for calculated items. |
 +| password | string | Password for authentication. Used only by SSH, telnet and JMX items. |
 +| port | string | Port monitored by the item. Used only by SNMP items. |
 +| prevorgvalue | string | //​(readonly)//​ Raw previous value of the item. |
 +| prevvalue | string | //​(readonly)//​ Previous value of the item. |
 +| privatekey | string | Name of the private key file. |
 +| publickey | string | Name of the public key file. |
 +| snmp_community | string | SNMP community. |
 +| snmp_oid | string | SNMP OID. |
 +| snmpv3_authpassphrase | string | SNMPv3 auth passphrase. Used only by SNMPv3 items. |
 +| snmpv3_privpassphrase | string | SNMPv3 priv passphrase. Used only by SNMPv3 items. ​ |
 +| snmpv3_securitylevel | integer | SNMPv3 security level. Used only by SNMPv3 items. \\ \\ Possible values: \\ 0 - noAuthNoPriv;​ \\ 1 - authNoPriv; \\ 2 - authPriv. |
 +| snmpv3_securityname | string | SNMPv3 security name. Used only by SNMPv3 items. |
 +| status | integer | Status of the item. \\ \\ Possible values: \\ 0 - //​(default)//​ enabled item; \\ 1 - disabled item; \\ 3 - unsupported item. |
 +| templateid | string | (readonly) ID of the parent template item.\\ \\ //Hint//: Use the ''​hostid''​ property to specify the template that the item belongs to. |
 +| trapper_hosts | string | Allowed hosts. Used only by trapper items. |
 +| trends | integer | Number of days to keep item's trends data. \\ \\ Default: 365. |
 +| units | string | Value units. |
 +| username | string | Username for authentication. Used only by SSH, telnet and JMX items. \\ \\ Required by SSH and telnet items. |
 +| valuemapid | string | ID of the associated value map. |