Oggetto elemento
I seguenti oggetti sono direttamente correlati all'API item.
Item
Gli web item non possono essere creati, aggiornati o eliminati direttamente tramite la Zabbix API.
L'oggetto item ha le seguenti proprietà.
| Property | Type | Description |
|---|---|---|
| itemid | ID | ID dell'item. Property behavior: - sola lettura - obbligatorio per le operazioni di aggiornamento |
| delay | string | Intervallo di aggiornamento dell'item. Accetta secondi o unità di tempo con suffisso (ad esempio, 30s, 1m, 2h, 1d) e, facoltativamente, uno o più intervalli personalizzati, tutti separati da punto e virgola. Gli intervalli personalizzati possono essere una combinazione di intervalli flessibili e di pianificazione. Accetta macro utente. Se utilizzato, il valore deve essere una singola macro. Non sono supportate macro multiple o macro combinate con testo. Gli intervalli flessibili possono essere scritti come due macro separate da una barra obliqua (ad esempio, {$FLEX_INTERVAL}/{$FLEX_PERIOD}).Esempio: 1h;wd1-5h9-18;{$Macro1}/1-7,00:00-24:00;0/6-7,12:00-24:00;{$Macro2}/{$Macro3}Property behavior: - obbligatorio se type è impostato su "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), oppure se type è impostato su "Zabbix agent (active)" (7) e key_ non contiene "mqtt.get" |
| hostid | ID | ID dell'host o del template a cui appartiene l'item. Property behavior: - costante - obbligatorio per le operazioni di creazione |
| interfaceid | ID | ID dell'interfaccia host dell'item. Property behavior: - obbligatorio se l'item appartiene a un host e type è impostato su "Zabbix agent", "IPMI agent", "JMX agent", "SNMP trap" o "SNMP agent"- supportato se l'item appartiene a un host e type è impostato su "Simple check", "External check", "SSH agent", "TELNET agent" o "HTTP agent"- sola lettura per gli oggetti rilevati |
| key_ | string | Chiave dell'item. Property behavior: - obbligatorio per le operazioni di creazione - sola lettura per gli oggetti ereditati o rilevati |
| name | string | Nome dell'item. Supporta macro utente. Property behavior: - obbligatorio per le operazioni di creazione - sola lettura per gli oggetti ereditati o rilevati |
| name_resolved | string | Nome dell'item con le macro utente risolte. Property behavior: - sola lettura |
| type | integer | Tipo dell'item. Valori possibili: 0 - Zabbix agent; 2 - Zabbix trapper; 3 - Simple check; 5 - Zabbix internal; 7 - Zabbix agent (active); 9 - Web item; 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: - obbligatorio per le operazioni di creazione - sola lettura per gli oggetti ereditati o rilevati |
| url | string | Stringa URL. Supporta macro utente, {HOST.IP}, {HOST.CONN}, {HOST.DNS}, {HOST.HOST}, {HOST.NAME}, {HOST.PORT}, {ITEM.ID}, {ITEM.KEY}. Property behavior: - obbligatorio se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| value_type | integer | Tipo di informazione dell'item. Valori possibili: 0 - numeric float; 1 - character; 2 - log; 3 - numeric unsigned; 4 - text; 5 - binary. Property behavior: - obbligatorio per le operazioni di creazione - sola lettura per gli oggetti ereditati o rilevati |
| allow_traps | integer | Consente di popolare il valore in modo simile all'item trapper. 0 - (predefinito) Non consentire l'accettazione di dati in ingresso; 1 - Consentire l'accettazione di dati in ingresso. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti rilevati |
| authtype | integer | Metodo di autenticazione. Valori possibili se type è impostato su "SSH agent":0 - (predefinito) password; 1 - public key. Valori possibili se type è impostato su "HTTP agent":0 - (predefinito) none; 1 - basic; 2 - NTLM; 3 - Kerberos; 4 - Digest. Property behavior: - supportato se type è impostato su "SSH agent" o "HTTP agent"- sola lettura per gli oggetti ereditati (se type è impostato su "HTTP agent") o rilevati |
| description | string | Descrizione dell'item. Property behavior: - sola lettura per gli oggetti rilevati |
| error | string | Testo dell'errore se si verificano problemi durante l'aggiornamento del valore dell'item. Property behavior: - sola lettura |
| flags | integer | Origine dell'item. Valori possibili: 0 - un item normale; 4 - un item convertito da prototype. Property behavior: - sola lettura |
| follow_redirects | integer | Segui i redirect della risposta durante il polling dei dati. Valori possibili: 0 - Non seguire i redirect; 1 - (predefinito) Segui i redirect. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| headers | array | Array di header che verranno inviati durante l'esecuzione di una richiesta HTTP. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| history | string | Unità di tempo per quanto a lungo devono essere conservati i dati storici. Accetta anche macro utente. Predefinito: 31d. Property behavior: - sola lettura per gli oggetti rilevati |
| http_proxy | string | Stringa di connessione del proxy HTTP(S). Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| inventory_link | integer | ID del campo di inventario dell'host popolato dall'item. Per un elenco dei campi di inventario host supportati e dei relativi ID, fare riferimento alla pagina dell'inventario host. Predefinito: 0. Property behavior: - supportato se value_type è impostato su "numeric float", "character", "numeric unsigned" o "text"- sola lettura per gli oggetti rilevati |
| ipmi_sensor | string | Sensore IPMI. Property behavior: - obbligatorio se type è impostato su "IPMI agent" e key_ non è impostato su "ipmi.get"- supportato se type è impostato su "IPMI agent"- sola lettura per gli oggetti ereditati o rilevati |
| jmx_endpoint | string | Stringa di connessione personalizzata dell'agent JMX. Valore predefinito: service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi Property behavior: - supportato se type è impostato su "JMX agent"- sola lettura per gli oggetti rilevati |
| lastclock | timestamp | Ora dell'ultimo aggiornamento del valore dell'item. Per impostazione predefinita, vengono visualizzati solo i valori rientranti nelle ultime 24 ore. È possibile estendere questo intervallo modificando il valore del parametro Max history display period nella sezione di menu Administration → General. Property behavior: - sola lettura |
| lastns | integer | Nanosecondi dell'ultimo aggiornamento del valore dell'item. Per impostazione predefinita, vengono visualizzati solo i valori rientranti nelle ultime 24 ore. È possibile estendere questo intervallo modificando il valore del parametro Max history display period nella sezione di menu Administration → General. Property behavior: - sola lettura |
| lastvalue | string | Ultimo valore dell'item. Per impostazione predefinita, vengono visualizzati solo i valori rientranti nelle ultime 24 ore. È possibile estendere questo intervallo modificando il valore del parametro Max history display period nella sezione di menu Administration → General. Property behavior: - sola lettura |
| logtimefmt | string | Formato dell'ora nelle voci di log. Property behavior: - supportato se value_type è impostato su "log"- sola lettura per gli oggetti ereditati o rilevati |
| master_itemid | ID | ID dell'item master. Property behavior: - obbligatorio se type è impostato su "Dependent item"- sola lettura per gli oggetti ereditati o rilevati |
| output_format | integer | Indica se la risposta deve essere convertita in JSON. 0 - (predefinito) Memorizza i dati grezzi; 1 - Converti in JSON. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| params | string | Parametri aggiuntivi a seconda del tipo di item: - script eseguito per gli item SSH agent e TELNET agent; - query SQL per gli item database monitor; - formula per gli item calculated; - lo script per gli item script e browser. Property behavior: - obbligatorio se type è impostato su "Database monitor", "SSH agent", "TELNET agent", "Calculated", "Script" o "Browser"- sola lettura per gli oggetti ereditati (se type è impostato su "Script" o "Browser") o rilevati |
| parameters | object/array | Parametri aggiuntivi se type è impostato su "Script" o "Browser". Array di oggetti con proprietà name e value, dove name deve essere univoco.Property behavior: - supportato se type è impostato su "Script" o "Browser"- sola lettura per gli oggetti ereditati o rilevati |
| password | string | Password per l'autenticazione. Property behavior: - obbligatorio se type è impostato su "JMX agent" e username è impostato- supportato se type è impostato su "Simple check", "SSH agent", "TELNET agent", "Database monitor" o "HTTP agent"- sola lettura per gli oggetti ereditati (se type è impostato su "HTTP agent") o rilevati |
| post_type | integer | Tipo del corpo dei dati POST memorizzato nella proprietà posts.Valori possibili: 0 - (predefinito) Dati grezzi; 2 - Dati JSON; 3 - Dati XML. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| posts | string | Dati del corpo della richiesta HTTP(S). Property behavior: - obbligatorio se type è impostato su "HTTP agent" e post_type è impostato su "JSON data" o "XML data"- supportato se type è impostato su "HTTP agent" e post_type è impostato su "Raw data"- sola lettura per gli oggetti ereditati o rilevati |
| prevvalue | string | Valore precedente dell'item. Per impostazione predefinita, vengono visualizzati solo i valori rientranti nelle ultime 24 ore. È possibile estendere questo intervallo modificando il valore del parametro Max history display period nella sezione di menu Administration → General. Property behavior: - sola lettura |
| privatekey | string | Nome del file della chiave privata. Property behavior: - obbligatorio se type è impostato su "SSH agent" e authtype è impostato su "public key"- sola lettura per gli oggetti rilevati |
| publickey | string | Nome del file della chiave pubblica. Property behavior: - obbligatorio se type è impostato su "SSH agent" e authtype è impostato su "public key"- sola lettura per gli oggetti rilevati |
| query_fields | array | Array di campi di query che verranno inviati durante l'esecuzione di una richiesta HTTP. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| request_method | integer | Tipo di metodo di richiesta. Valori possibili: 0 - (predefinito) GET; 1 - POST; 2 - PUT; 3 - HEAD. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| retrieve_mode | integer | Parte della risposta che deve essere memorizzata. Valori possibili se request_method è impostato su "GET", "POST" o "PUT":0 - (predefinito) Body; 1 - Headers; 2 - Verranno memorizzati sia body che headers. Valori possibili se request_method è impostato su "HEAD":1 - Headers. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| snmp_oid | string | OID SNMP. Property behavior: - obbligatorio se type è impostato su "SNMP agent"- sola lettura per gli oggetti ereditati o rilevati |
| ssl_cert_file | string | Percorso del file della chiave SSL pubblica. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| ssl_key_file | string | Percorso del file della chiave SSL privata. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| ssl_key_password | string | Password per il file della chiave SSL. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| state | integer | Stato dell'item. Valori possibili: 0 - (predefinito) normale; 1 - non supportato. Property behavior: - sola lettura |
| status | integer | Stato dell'item. Valori possibili: 0 - (predefinito) item abilitato; 1 - item disabilitato. |
| status_codes | string | Intervalli dei codici di stato HTTP richiesti, separati da virgole. Supporta anche macro utente come parte di un elenco separato da virgole. Esempio: 200,200-{$M},{$M},200-400 Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| templateid | ID | ID dell'item template padre. Suggerimento: usare la proprietà hostid per specificare il template a cui appartiene l'item.Property behavior: - sola lettura |
| timeout | string | Timeout della richiesta di polling dei dati dell'item. Accetta secondi o unità di tempo con suffisso (ad esempio, 30s, 1m). Accetta anche macro utente. Intervallo di valori possibile: 1-600s. Predefinito: "" - usa le impostazioni del proxy/globali. Property behavior: - supportato se type è impostato su "Zabbix agent" (0), "Simple check" (3) e key_ non inizia con "vmware." e "icmpping", "Zabbix agent (active)" (7), "External check" (10), "Database monitor" (11), "SSH agent" (13), "TELNET agent" (14), "HTTP agent" (19), "SNMP agent" (20) e snmp_oid inizia con "walk[" o "get[", "Script" (21), "Browser" (22)- sola lettura per gli oggetti ereditati e rilevati |
| trapper_hosts | string | Host consentiti. Property behavior: - readonly per gli oggetti rilevati - supportato se type è impostato su "Zabbix trapper", oppure se type è impostato su "HTTP agent" e allow_traps è impostato su "Allow to accept incoming data" |
| trends | string | Unità di tempo per quanto a lungo devono essere conservati i dati di trend. Accetta anche macro utente. Predefinito: 365d. Property behavior: - supportato se value_type è impostato su "numeric float" o "numeric unsigned"- sola lettura per gli oggetti rilevati |
| units | string | Unità del valore. Property behavior: - supportato se value_type è impostato su "numeric float" o "numeric unsigned"- sola lettura per gli oggetti ereditati o rilevati |
| username | string | Nome utente per l'autenticazione. Property behavior: - obbligatorio se type è impostato su "SSH agent", "TELNET agent" o se type è impostato su "JMX agent" e password è impostato- supportato se type è impostato su "Simple check", "Database monitor" o "HTTP agent"- sola lettura per gli oggetti ereditati (se type è impostato su "HTTP agent") o rilevati |
| uuid | string | Identificatore univoco universale, usato per collegare l'item importato a quelli già esistenti. Generato automaticamente se non specificato. Property behavior: - supportato se l'item appartiene a un template |
| valuemapid | ID | ID della value map associata. Property behavior: - supportato se value_type è impostato su "numeric float", "character" o "numeric unsigned"- sola lettura per gli oggetti ereditati o rilevati |
| verify_host | integer | Indica se verificare che il nome host della connessione corrisponda a quello nel certificato dell'host. Valori possibili: 0 - (predefinito) Non verificare; 1 - Verificare. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
| verify_peer | integer | Indica se verificare che il certificato dell'host sia autentico. Valori possibili: 0 - (predefinito) Non verificare; 1 - Verificare. Property behavior: - supportato se type è impostato su "HTTP agent"- sola lettura per gli oggetti ereditati o rilevati |
Intestazione HTTP
L'oggetto header ha le seguenti proprietà:
| Proprietà | Tipo | Descrizione |
|---|---|---|
| name | string | Nome dell'intestazione HTTP. Comportamento della proprietà: - obbligatorio |
| value | string | Valore dell'intestazione. Comportamento della proprietà: - obbligatorio |
Campo della query HTTP
L'oggetto del campo della query definisce un nome e un valore utilizzati per specificare un parametro URL. Ha le seguenti proprietà:
| Proprietà | Type | Descrizione |
|---|---|---|
| name | string | Nome del parametro. Comportamento della proprietà: - obbligatorio |
| value | string | Valore del parametro. Comportamento della proprietà: - obbligatorio |
Tag dell'item
L'oggetto tag dell'item ha le seguenti proprietà.
| Property | Type | Description |
|---|---|---|
| tag | string | Nome del tag dell'item. Property behavior: - required |
| value | string | Valore del tag dell'item. |
Preprocessing dell'item
L'oggetto di preprocessing dell'item ha le seguenti proprietà.
| Property | Type | Description |
|---|---|---|
| type | integer | Il tipo di opzione di preprocessing. Valori possibili: 1 - Moltiplicatore personalizzato; 2 - Rimozione a destra; 3 - Rimozione a sinistra; 4 - Rimozione; 5 - Espressione regolare; 6 - Booleano in decimale; 7 - Ottale in decimale; 8 - Esadecimale in decimale; 9 - Variazione semplice; 10 - Variazione per secondo; 11 - XML XPath; 12 - JSONPath; 13 - Nell'intervallo; 14 - Corrisponde all'espressione regolare; 15 - Non corrisponde all'espressione regolare; 16 - Controlla errore in JSON; 17 - Controlla errore in XML; 18 - Controlla errore usando espressione regolare; 19 - Scarta invariato; 20 - Scarta invariato con heartbeat; 21 - JavaScript; 22 - Pattern Prometheus; 23 - Prometheus in JSON; 24 - CSV in JSON; 25 - Sostituisci; 26 - Controlla non supportato; 27 - XML in JSON; 28 - Valore SNMP walk; 29 - SNMP walk in JSON; 30 - Valore SNMP get. Property behavior: - required |
| params | string | Parametri aggiuntivi usati dall'opzione di preprocessing. I parametri multipli sono separati dal carattere di nuova riga (\n). Se type è impostato su "Check unsupported", i parametri seguono la sintassi <scope>[\n<pattern>], dove pattern è un'espressione regolare e scope è uno dei seguenti:-1 - corrisponde a qualsiasi errore; \ 0 - verifica se il messaggio di errore corrisponde a pattern; \ 1 - verifica se il messaggio di errore non corrisponde a pattern. Property behavior: - required se type è impostato su "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 | Tipo di azione usata in caso di errore di un passaggio di preprocessing. Valori possibili: 0 - Il messaggio di errore è impostato dal server Zabbix; 1 - Scarta valore; 2 - Imposta valore personalizzato; 3 - Imposta messaggio di errore personalizzato. Valori possibili se type è impostato su "Check unsupported":1 - Scarta valore; 2 - Imposta valore personalizzato; 3 - Imposta messaggio di errore personalizzato. Property behavior: - required se type è impostato su "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 | Parametri del gestore degli errori. Property behavior: - required se error_handler è impostato su "Set custom value" o "Set custom error message" |
I seguenti parametri e gestori degli errori sono supportati per ciascun tipo di preprocessing.
| 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 numero in virgola mobile (gli interi vengono convertiti implicitamente in valori float)
2 stringa
3 espressione regolare
4 JSONPath o XML XPath
5 intero positivo (con supporto dei suffissi di tempo, ad esempio 30s, 1m, 2h,
1d)
6 macro utente
7 pattern Prometheus secondo la sintassi:
<metric name>{<label name>="<label value>", ...} == <value>. Ogni
componente del pattern Prometheus (metrica, nome etichetta, valore etichetta e valore della metrica) può essere una macro utente.
8 output Prometheus secondo la sintassi: <label name> (può essere una macro utente) se label è selezionato come secondo parametro.
9 Una delle funzioni di aggregazione: sum, min, max, avg, count se function è selezionato come secondo parametro.
10 Supporta più record "Field name,OID prefix,Format" delimitati da un carattere di nuova riga.