Oggetto prototipo di elemento
I seguenti oggetti sono direttamente correlati all'API itemprototype.
Prototipo di item
L'oggetto prototipo di item ha le seguenti proprietà.
| Property | Type | Description |
|---|---|---|
| itemid | ID | ID del prototipo di item. Property behavior: - read-only - required per le operazioni di aggiornamento |
| delay | string | Intervallo di aggiornamento del prototipo di 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 e macro LLD. Se utilizzato, il valore deve essere una singola macro. Non sono supportate più macro 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: - required 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 a cui appartiene il prototipo di item. Property behavior: - constant - required per le operazioni di creazione |
| interfaceid | ID | ID dell'interfaccia host del prototipo di item. Property behavior: - required se il prototipo di item appartiene a un host e type è impostato su "Zabbix agent", "IPMI agent", "JMX agent", "SNMP trap" o "SNMP agent"- supported se il prototipo di item appartiene a un host e type è impostato su "Simple check", "External check", "SSH agent", "TELNET agent" o "HTTP agent" |
| key_ | string | Chiave del prototipo di item. Property behavior: - required per le operazioni di creazione - read-only per gli oggetti ereditati |
| name | string | Nome del prototipo di item. Supporta macro utente. Property behavior: - required per le operazioni di creazione - read-only per gli oggetti ereditati |
| type | integer | Tipo del prototipo di item. Valori possibili: 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 per le operazioni di creazione - read-only per gli oggetti ereditati |
| url | string | Stringa URL. Supporta macro LLD, macro utente, {HOST.IP}, {HOST.CONN}, {HOST.DNS}, {HOST.HOST}, {HOST.NAME}, {ITEM.ID}, {ITEM.KEY}. Property behavior: - required se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| value_type | integer | Tipo di informazione del prototipo di item. Valori possibili: 0 - numeric float; 1 - character; 2 - log; 3 - numeric unsigned; 4 - text; 5 - binary. Property behavior: - required per le operazioni di creazione - read-only per gli oggetti ereditati |
| allow_traps | integer | Consente di popolare il valore in modo simile all'item trapper. 0 - (default) Non consentire l'accettazione di dati in ingresso; 1 - Consentire l'accettazione di dati in ingresso. Property behavior: - supported se type è impostato su "HTTP agent" |
| authtype | integer | Metodo di autenticazione. Valori possibili se type è impostato su "SSH agent":0 - (default) password; 1 - public key. Valori possibili se type è impostato su "HTTP agent":0 - (default) none; 1 - basic; 2 - NTLM; 3 - Kerberos; 4 - Digest. Property behavior: - supported se type è impostato su "SSH agent" o "HTTP agent"- read-only per gli oggetti ereditati (se type è impostato su "HTTP agent") |
| description | string | Descrizione del prototipo di item. |
| follow_redirects | integer | Segui i redirect della risposta durante il polling dei dati. Valori possibili: 0 - Non seguire i redirect; 1 - (default) Segui i redirect. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| headers | array | Array di header che verranno inviati durante l'esecuzione di una richiesta HTTP. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| history | string | Unità di tempo per la durata di conservazione dei dati storici. Accetta anche macro utente e macro LLD. Default: 31d. |
| http_proxy | string | Stringa di connessione del proxy HTTP(S). Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| ipmi_sensor | string | Sensore IPMI. Property behavior: - required se type è impostato su "IPMI agent" e key_ non è impostato su "ipmi.get"- supported se type è impostato su "IPMI agent"- read-only per gli oggetti ereditati |
| jmx_endpoint | string | Stringa di connessione personalizzata dell'agent JMX. Default: service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi Property behavior: - supported se type è impostato su "JMX agent" |
| logtimefmt | string | Formato dell'ora nelle voci di log. Property behavior: - supported se value_type è impostato su "log"- read-only per gli oggetti ereditati |
| master_itemid | ID | ID dell'item master. Sono consentite ricorsioni fino a 3 dependent item e item prototype e un numero massimo di dependent item e item prototype pari a 29999. Property behavior: - required se type è impostato su "Dependent item"- read-only per gli oggetti ereditati |
| output_format | integer | Indica se la risposta deve essere convertita in JSON. Valori possibili: 0 - (default) Store raw; 1 - Convert to JSON. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| params | string | Parametri aggiuntivi a seconda del tipo di prototipo di item: - script eseguito per i prototipi di item SSH agent e TELNET agent; - query SQL per i prototipi di item database monitor; - formula per i prototipi di item calculated; - lo script per i prototipi di item script e browser. Property behavior: - required se type è impostato su "Database monitor", "SSH agent", "TELNET agent", "Calculated", "Script" o "Browser"- read-only per gli oggetti ereditati (se type è impostato su "Script" o "Browser") |
| 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: - supported se type è impostato su "Script" o "Browser"- read-only per gli oggetti ereditati |
| password | string | Password per l'autenticazione. Property behavior: - required se type è impostato su "JMX agent" e username è impostato- supported se type è impostato su "Simple check", "SSH agent", "TELNET agent", "Database monitor" o "HTTP agent"- read-only per gli oggetti ereditati (se type è impostato su "HTTP agent") |
| post_type | integer | Tipo del corpo dei dati POST memorizzato nella proprietà posts.Valori possibili: 0 - (default) Dati raw; 2 - Dati JSON; 3 - Dati XML. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| posts | string | Dati del corpo della richiesta HTTP(S). Property behavior: - required se type è impostato su "HTTP agent" e post_type è impostato su "JSON data" o "XML data"- supported se type è impostato su "HTTP agent" e post_type è impostato su "Raw data"- read-only per gli oggetti ereditati |
| privatekey | string | Nome del file della chiave privata. Property behavior: - required se type è impostato su "SSH agent" e authtype è impostato su "public key" |
| publickey | string | Nome del file della chiave pubblica. Property behavior: - required se type è impostato su "SSH agent" e authtype è impostato su "public key" |
| query_fields | array | Array di campi di query che verranno inviati durante l'esecuzione di una richiesta HTTP. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| request_method | integer | Tipo di metodo della richiesta. Valori possibili: 0 - (default) GET; 1 - POST; 2 - PUT; 3 - HEAD. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| retrieve_mode | integer | Parte della risposta che deve essere memorizzata. Valori possibili se request_method è impostato su "GET", "POST" o "PUT":0 - (default) Body; 1 - Headers; 2 - Verranno memorizzati sia body sia headers. Valori possibili se request_method è impostato su "HEAD":1 - Headers. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| snmp_oid | string | OID SNMP. Property behavior: - required se type è impostato su "SNMP agent"- read-only per gli oggetti ereditati |
| ssl_cert_file | string | Percorso del file della chiave SSL pubblica. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| ssl_key_file | string | Percorso del file della chiave SSL privata. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| ssl_key_password | string | Password per il file della chiave SSL. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| status | integer | Stato del prototipo di item. Valori possibili: 0 - (default) prototipo di item abilitato; 1 - prototipo di item disabilitato; 3 - prototipo di item non supportato. |
| status_codes | string | Intervalli dei codici di stato HTTP richiesti, separati da virgole. Supporta anche macro utente o macro LLD come parte dell'elenco separato da virgole. Esempio: 200,200-{$M},{$M},200-400 Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| templateid | ID | ID del prototipo di item del template padre. Property behavior: - read-only |
| 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 e macro LLD. Intervallo di valori possibili: 1-600s. Default: "" - usa le impostazioni di proxy/globali. Property behavior: - supported 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)- read-only per gli oggetti ereditati |
| trapper_hosts | string | Host consentiti. Property behavior: - supported 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 la durata di conservazione dei dati di trend. Accetta anche macro utente e macro LLD. Default: 365d. Property behavior: - supported se value_type è impostato su "numeric float" o "numeric unsigned" |
| units | string | Unità del valore. Property behavior: - supported se value_type è impostato su "numeric float" o "numeric unsigned"- read-only per gli oggetti ereditati |
| username | string | Nome utente per l'autenticazione. Property behavior: - required se type è impostato su "SSH agent" o "TELNET agent", oppure se type è impostato su "JMX agent" e password è impostato- supported se type è impostato su "Simple check", "Database monitor" o "HTTP agent"- read-only per gli oggetti ereditati (se type è impostato su "HTTP agent") |
| uuid | string | Identificatore univoco universale, usato per collegare i prototipi di item importati a quelli già esistenti. Viene generato automaticamente se non specificato. Property behavior: - supported se il prototipo di item appartiene a un template |
| valuemapid | ID | ID della value map associata. Property behavior: - supported se value_type è impostato su "numeric float", "character" o "numeric unsigned"- read-only per gli oggetti ereditati |
| verify_host | integer | Indica se verificare che il nome host della connessione corrisponda a quello nel certificato dell'host. Valori possibili: 0 - (default) Non verificare; 1 - Verificare. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| verify_peer | integer | Indica se verificare che il certificato dell'host sia autentico. Valori possibili: 0 - (default) Non verificare; 1 - Verificare. Property behavior: - supported se type è impostato su "HTTP agent"- read-only per gli oggetti ereditati |
| discover | integer | Stato di discovery del prototipo di item. Valori possibili: 0 - (default) verranno scoperti nuovi item; 1 - i nuovi item non verranno scoperti e gli item esistenti verranno contrassegnati come persi. |
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 di query HTTP
L'oggetto campo di 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 del prototipo di item
L'oggetto tag del prototipo di item ha le seguenti proprietà.
| Property | Type | Description |
|---|---|---|
| tag | string | Nome del tag del prototipo di item. Comportamento della proprietà: - required |
| value | string | Valore del tag del prototipo di item. |
Preprocessing del prototipo di item
L'oggetto di preprocessing del prototipo di 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 del 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" |
Sono supportati i seguenti parametri e gestori degli errori 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 - Invariato 1 - UTF-8 da Hex-STRING 2 - MAC da Hex-STRING 3 - Intero da BITS |
0, 1, 2, 3 | |
| 29 | SNMP walk to JSON10 | Field name2 | OID prefix2 | Format: 0 - Invariato 1 - UTF-8 da Hex-STRING 2 - MAC da Hex-STRING 3 - Intero da BITS |
0, 1, 2, 3 |
| 30 | SNMP get value | Format: 1 - UTF-8 da Hex-STRING 2 - MAC da Hex-STRING 3 - Intero da BITS |
0, 1, 2, 3 | ||
1 numero intero o in virgola mobile
2 stringa
3 espressione regolare
4 JSONPath o XML XPath
5 intero positivo (con supporto dei suffissi temporali, ad esempio 30s, 1m, 2h,
1d)
6 macro utente, macro LLD
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 o una macro LLD.
8 output Prometheus secondo la sintassi: <label name> (può essere una macro utente o una macro LLD) 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.