On this page
Oggetto tipo di supporto
I seguenti oggetti sono direttamente correlati all'API mediatype.
Media type
L'oggetto media type ha le seguenti proprietà.
| Property | Type | Description |
|---|---|---|
| mediatypeid | ID | ID del media type. Property behavior: - sola lettura - obbligatorio per le operazioni di aggiornamento |
| name | string | Nome del media type. Property behavior: - obbligatorio per le operazioni di creazione |
| type | integer | Trasporto utilizzato dal media type. Valori possibili: 0 - Email; 1 - Script; 2 - SMS; 4 - Webhook. Property behavior: - obbligatorio per le operazioni di creazione |
| exec_path | string | Nome del file di script (ad esempio, notification.sh) presente nella directory specificata nel parametro di configurazione del server AlertScriptsPath. Property behavior: - obbligatorio se type è impostato su "Script" |
| gsm_modem | string | Nome del dispositivo seriale del modem GSM. Property behavior: - obbligatorio se type è impostato su "SMS" |
| passwd | string | Password di autenticazione. Property behavior: - supportato se smtp_authentication è impostato su "Normal password" |
| provider | integer | Provider email. Valori possibili: 0 - (predefinito) Generic SMTP; 1 - Gmail; 2 - Gmail relay; 3 - Office365; 4 - Office365 relay. |
| smtp_email | string | Indirizzo email da cui verranno inviate le notifiche. Property behavior: - obbligatorio se type è impostato su "Email" |
| smtp_helo | string | SMTP HELO. Property behavior: - supportato se type è impostato su "Email" |
| smtp_server | string | SMTP server. Property behavior: - obbligatorio se type è impostato su "Email" |
| smtp_port | integer | Porta del server SMTP a cui connettersi. Predefinito: 25. Property behavior: - supportato se type è impostato su "Email" |
| smtp_security | integer | Livello di sicurezza della connessione SMTP da usare. Valori possibili: 0 - (predefinito) Nessuno; 1 - STARTTLS; 2 - SSL/TLS. Property behavior: - supportato se type è impostato su "Email" |
| smtp_verify_host | integer | Verifica host SSL per SMTP. Valori possibili: 0 - (predefinito) No; 1 - Sì. Property behavior: - supportato se smtp_security è impostato su "STARTTLS" o "SSL/TLS" |
| smtp_verify_peer | integer | Verifica peer SSL per SMTP. Valori possibili: 0 - (predefinito) No; 1 - Sì. Property behavior: - supportato se smtp_security è impostato su "STARTTLS" o "SSL/TLS" |
| smtp_authentication | integer | Metodo di autenticazione SMTP da usare. Valori possibili: 0 - (predefinito) Nessuno; 1 - Normal password; 2 - OAuth token. L'autenticazione OAuth non è consentita per il provider email Office365 relay. Property behavior: - supportato se type è impostato su "Email" |
| redirection_url | string | URL del frontend Zabbix a cui reindirizzare l'autorizzazione OAuth. Predefinito: Valore della proprietà url delle impostazioni API con la parte zabbix.php?action=oauth.authorizeProperty behavior: - obbligatorio se smtp_authentication è impostato su "OAuth token" |
| client_id | string | L'identificatore del client registrato nel server di autorizzazione OAuth. Property behavior: - obbligatorio se smtp_authentication è impostato su "OAuth token" |
| client_secret | string | Il segreto del client registrato nel server di autorizzazione OAuth. Accessibile solo all'utente di tipo Super Admin. Property behavior: - obbligatorio se smtp_authentication è impostato su "OAuth token" |
| authorization_url | string | URL OAuth, con parametri, per ottenere i token di accesso e di refresh. Property behavior: - obbligatorio se smtp_authentication è impostato su "OAuth token" |
| token_url | string | URL OAuth per scambiare il token di autorizzazione con i token di accesso e di refresh. Questo URL viene usato anche dal server per aggiornare un token di accesso non valido. Property behavior: - obbligatorio se smtp_authentication è impostato su "OAuth token" |
| tokens_status | integer | Maschera di bit sullo stato dei token. Valori possibili: 0 - (predefinito) Entrambi i token contengono un valore non valido 1 - Il token di accesso contiene un valore valido 2 - Il token di refresh contiene un valore valido 3 - Entrambi i token contengono un valore valido. Property behavior: - supportato se smtp_authentication è impostato su "OAuth token" |
| access_token | string | Valore del token di accesso OAuth. Property behavior: - obbligatorio se smtp_authentication è impostato su "OAuth token" |
| access_token_updated | timestamp | Timestamp dell'ultima modifica di access_token eseguita dal server durante l'aggiornamento con refresh_token o dall'API al cambio dei token.Property behavior: - supportato se smtp_authentication è impostato su "OAuth token" |
| access_expires_in | integer | Tempo in secondi dopo il quale access_token diventerà obsoleto e sarà necessario effettuare una richiesta a refresh_url.Viene impostato dal server Zabbix al refresh di access_token o dall'API al cambio dei token.Il timestamp viene calcolato sommando il valore di access_token_updated.Property behavior: - supportato se smtp_authentication è impostato su "OAuth token" |
| refresh_token | string | Valore del token di refresh OAuth. Property behavior: - obbligatorio se smtp_authentication è impostato su "OAuth token" |
| status | integer | Indica se il media type è abilitato. Valori possibili: 0 - (predefinito) Abilitato; 1 - Disabilitato. |
| username | string | Nome utente. Property behavior: - supportato se smtp_authentication è impostato su "Normal password" |
| maxsessions | integer | Numero massimo di alert che possono essere elaborati in parallelo. Valori possibili se type è impostato su "SMS": 1.Valori possibili se type è impostato su "Email", "Script" o "Webhook": 0-100.Predefinito: 1. |
| maxattempts | integer | Numero massimo di tentativi per inviare un alert. Valori possibili: 1-100. Predefinito: 3. |
| attempt_interval | string | Intervallo tra i tentativi di ripetizione. Accetta secondi e unità di tempo con suffisso. Valori possibili: 0-1h. Predefinito: 10s. |
| message_format | integer | Formato del messaggio. Valori possibili: 0 - Testo semplice; 1 - (predefinito) HTML. Property behavior: - supportato se type è impostato su "Email" |
| script | text | Corpo dello script webhook (JavaScript). Property behavior: - obbligatorio se type è impostato su "Webhook" |
| timeout | string | Timeout dello script webhook. Accetta secondi e unità di tempo con suffisso. Valori possibili: 1-60s. Predefinito: 30s. Property behavior: - supportato se type è impostato su "Webhook" |
| process_tags | integer | Elabora i valori delle proprietà JSON nella risposta dello script webhook come tag. Questi tag vengono aggiunti a eventuali tag di problema già esistenti. Valori possibili: 0 - (predefinito) Ignora la risposta dello script webhook; 1 - Elabora la risposta dello script webhook come tag. Property behavior: - supportato se type è impostato su "Webhook" |
| show_event_menu | integer | Include una voce nel menu eventi che rimanda a un URL personalizzato. Aggiunge anche la proprietà urls all'output di problem.get e event.get.Valori possibili: 0 - (predefinito) Non includere la voce del menu eventi né la proprietà urls;1 - Includere la voce del menu eventi e la proprietà urls.Property behavior: - supportato se type è impostato su "Webhook" |
| event_menu_url | string | URL usato nella voce del menu eventi e nella proprietà urls restituita da problem.get e event.get.Property behavior: - supportato se show_event_menu è impostato su "Include event menu entry and urls property" |
| event_menu_name | string | Nome usato per la voce del menu eventi e nella proprietà urls restituita da problem.get e event.get.Property behavior: - supportato se show_event_menu è impostato su "Include event menu entry and urls property" |
| parameters | array | Parametri Webhook o script. Property behavior: - supportato se type è impostato su "Webhook" o "Script" |
| description | text | Descrizione del media type. |
Parametri webhook
I parametri del webhook hanno le seguenti proprietà.
| Proprietà | Tipo | Descrizione |
|---|---|---|
| name | string | Nome del parametro. Comportamento della proprietà: - obbligatorio |
| value | string | Valore del parametro, supporta le macro. Le macro supportate sono descritte nella pagina Macro supportate. |
Parametri dello script
I parametri dello script hanno le seguenti proprietà.
| Proprietà | Type | Descrizione |
|---|---|---|
| sortorder | integer | L'ordine in cui i valori dei parametri verranno passati allo script come argomenti della riga di comando, a partire da 0 come primo. Comportamento della proprietà: - obbligatorio |
| value | string | Valore del parametro, supporta le macro. Le macro supportate sono descritte nella pagina Macro supportate. |
Modello di messaggio
L'oggetto modello di messaggio definisce un modello che verrà utilizzato come messaggio predefinito per le operazioni di azione per inviare una notifica. Ha le seguenti proprietà.
| Proprietà | Type | Descrizione |
|---|---|---|
| eventsource | integer | Origine dell'evento. Valori possibili: 0 - Trigger; 1 - Individuazione; 2 - Registrazione automatica; 3 - Interno; 4 - Servizi. Comportamento della proprietà: - obbligatoria |
| recovery | integer | Modalità operativa. Valori possibili: 0 - Operazioni; 1 - Operazioni di ripristino; 2 - Operazioni di aggiornamento. Comportamento della proprietà: - obbligatoria |
| subject | string | Oggetto del messaggio. |
| message | string | Testo del messaggio. |