Plugin MongoDB

Panoramica

I parametri di configurazione consentono di personalizzare il comportamento del plugin MongoDB.

Si consiglia di specificarli in un file di configurazione separato (ad esempio mongodb.conf), anziché nel file di configurazione di agent 2. Quindi usare la direttiva Include per includere questo file nella configurazione di Zabbix agent 2.

Il plugin MongoDB è un plugin caricabile ed è disponibile e descritto in modo completo nel repository del plugin MongoDB.

Tutti i parametri sono facoltativi, a meno che non sia esplicitamente indicato che il parametro è obbligatorio.

Nota che:

  • I valori predefiniti riflettono i valori predefiniti del processo, non i valori presenti nei file di configurazione distribuiti.
  • I valori supportano le variabili di ambiente.
  • Zabbix supporta i file di configurazione solo in codifica UTF-8 senza BOM.
  • I commenti che iniziano con "#" sono supportati solo all'inizio della riga.

Parameter details

Plugins.MongoDB.Default.AuthMechanism

Specify the default authentication mechanism for connecting to MongoDB server.
<SessionName> - define name of a session for using in item keys.

Range: SCRAM-SHA-1, SCRAM-SHA-256, or MONGODB-X509

Plugins.MongoDB.Default.AuthSource

Specify the default database for authenticating connection to MongoDB server.
<SessionName> - define name of a session for using in item keys.

Default: admin

If MONGODB-X509 authentication mechanism is used, this parameter is automatically set to $external; modifying it to any other value will cause an error when launching.

Plugins.MongoDB.Default.Direct

Disable automatic discovery of MongoDB replica set nodes.
<SessionName> - define name of a session for using in item keys.

Default: false Range: true - connect only to the specified server, ignoring other members of the replica set, false - automatically discover all nodes in the replica set.

If the tcp:// (deprecated) scheme is used, the parameter is set to true by default.

Plugins.MongoDB.Default.Password

Specify the default password.
<SessionName> - define name of a session for using in item keys.

Plugins.MongoDB.Default.ReplicaSet

Specify the default replica set name, used for automatic discovery of MongoDB replica set nodes.
<SessionName> - define name of a session for using in item keys.
If this parameter is used with the mongodb+srv:// scheme, it will behave as if multiple URLs have been provided; a DNS server may have a TXT record that can override this (or any other) parameter.
Unavailable if the Plugins.MongoDB.Sessions.<SessionName>.Direct parameter is set to true; the agent will fail to start.

Plugins.MongoDB.Default.ReadPreference

Specify the default order for connecting to MongoDB replica set nodes or fallback.
<SessionName> - define name of a session for using in item keys.
Unavailable if the Plugins.MongoDB.Sessions.<SessionName>.Direct parameter is set to true; the agent will fail to start.

Range: PrimaryMode, PrimaryPreferredMode, SecondaryMode, SecondaryPreferredMode, or NearestMode

Plugins.MongoDB.Default.TLSConnect

Specify the level of encryption required for communications between Zabbix agent 2 and monitored databases.
<SessionName> - define name of a session for using in item keys.
Supported since plugin version 1.2.1.

Range: required - require TLS connection, verify_ca - verify certificates, verify_full - verify certificates and IP address

Plugins.MongoDB.Default.TLSCAFile

Specify full pathname of the file containing the top-level CA(s) certificates for peer certificate verification, used for encrypted communications between Zabbix agent 2 and monitored databases.
<SessionName> - define name of a session for using in item keys.

Mandatory: yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSConnect is set to verify_ca or verify_full

Plugins.MongoDB.Default.TLSCertFile

Specify full pathname of the file containing the agent certificate or certificate chain, used for encrypted communications between Zabbix agent 2 and monitored databases.
<SessionName> - define name of a session for using in item keys.

Mandatory: yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSKeyFile is specified

Plugins.MongoDB.Default.TLSKeyFile

Specify full pathname of the file containing the database private key, used for encrypted communications between Zabbix agent 2 and monitored databases.
<SessionName> - define name of a session for using in item keys.

Mandatory: yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSCertFile is specified

Plugins.MongoDB.Default.Uri

Specify the default URI.
<SessionName> - define name of a session for using in item keys.
Must match the URI format.
Supported schemes: mongodb:// and mongodb+srv://; the tcp:// scheme is deprecated and kept for backward compatibility with existing configurations.
A port can be omitted (default=27017).
Examples: ``

Default: tcp://127.0.0.1:27017

Examples:

mongodb://127.0.0.1:27017
mongodb+srv://example.com
localhost
Plugins.MongoDB.Default.User

Specify the default username.
<SessionName> - define name of a session for using in item keys.

Plugins.MongoDB.KeepAlive

Set the maximum time of waiting (in seconds) before unused plugin connections are closed.

Default: 300 Range: 60-900

Plugins.MongoDB.Sessions.<SessionName>.AuthMechanism

Specify the named session authentication mechanism for connecting to MongoDB server.
<SessionName> - define name of a session for using in item keys.

Range: SCRAM-SHA-1, SCRAM-SHA-256, or MONGODB-X509

Plugins.MongoDB.Sessions.<SessionName>.AuthSource

Specify the named session database for authenticating connection to MongoDB server.
<SessionName> - define name of a session for using in item keys.

Default: admin

If MONGODB-X509 authentication mechanism is used, this parameter is automatically set to $external; modifying it to any other value will cause an error when launching.

Plugins.MongoDB.Sessions.<SessionName>.Direct

Disable automatic discovery of MongoDB replica set nodes for named session.
<SessionName> - define name of a session for using in item keys.

Default: false Range: true - connect only to the specified server, ignoring other members of the replica set, false - automatically discover all nodes in the replica set.

If the tcp:// (deprecated) scheme is used, the parameter is set to true by default.

Plugins.MongoDB.Sessions.<SessionName>.Password

Specify the named session password.
<SessionName> - define name of a session for using in item keys.

Plugins.MongoDB.Sessions.<SessionName>.ReplicaSet

Specify the named session replica set name, used for automatic discovery of MongoDB replica set nodes.
<SessionName> - define name of a session for using in item keys.
If this parameter is used with the mongodb+srv:// scheme, it will behave as if multiple URLs have been provided; a DNS server may have a TXT record that can override this (or any other) parameter.
Unavailable if the Plugins.MongoDB.Sessions.<SessionName>.Direct parameter is set to true; the agent will fail to start.

Plugins.MongoDB.Sessions.<SessionName>.ReadPreference

Specify the named session order for connecting to MongoDB replica set nodes or fallback.
<SessionName> - define name of a session for using in item keys.
Unavailable if the Plugins.MongoDB.Sessions.<SessionName>.Direct parameter is set to true; the agent will fail to start.

Range: PrimaryMode, PrimaryPreferredMode, SecondaryMode, SecondaryPreferredMode, or NearestMode

Plugins.MongoDB.Sessions.<SessionName>.TLSConnect

Specify the level of encryption required for communications between Zabbix agent 2 and monitored databases for named session.
<SessionName> - define name of a session for using in item keys.
Supported since plugin version 1.2.1.

Range: required - require TLS connection, verify_ca - verify certificates, verify_full - verify certificates and IP address

Plugins.MongoDB.Sessions.<SessionName>.TLSCAFile

Specify full pathname of the file containing the top-level CA(s) certificates for peer certificate verification, used for encrypted communications between Zabbix agent 2 and monitored databases for named session.
<SessionName> - define name of a session for using in item keys.

Mandatory: yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSConnect is set to verify_ca or verify_full

Plugins.MongoDB.Sessions.<SessionName>.TLSCertFile

Specify full pathname of the file containing the agent certificate or certificate chain, used for encrypted communications between Zabbix agent 2 and monitored databases for named session.
<SessionName> - define name of a session for using in item keys.

Mandatory: yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSKeyFile is specified

Plugins.MongoDB.Sessions.<SessionName>.TLSKeyFile

Specify full pathname of the file containing the database private key, used for encrypted communications between Zabbix agent 2 and monitored databases for named session.
<SessionName> - define name of a session for using in item keys.

Mandatory: yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSCertFile is specified

Plugins.MongoDB.Sessions.<SessionName>.Uri

Specify the named session URI.
<SessionName> - define name of a session for using in item keys.
Must match the URI format.
Supported schemes: mongodb:// and mongodb+srv://; the tcp:// scheme is deprecated and kept for backward compatibility with existing configurations.
A port can be omitted (default=27017).
Examples: ``

Default: tcp://127.0.0.1:27017

Examples:

mongodb://127.0.0.1:27017
mongodb+srv://example.com
localhost
Plugins.MongoDB.Sessions.<SessionName>.User

Specify the named session username.
<SessionName> - define name of a session for using in item keys.

Plugins.MongoDB.System.Path

Specify path to the MongoDB plugin executable.

Example usage: Plugins.MongoDB.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-mongodb

Plugins.MongoDB.Timeout

Set the request execution timeout (the duration, in seconds, to wait for a request to complete before shutting it down).

Default: global timeout Range: 1-30

Opzioni

Parameter Description
-V --version Stampa la versione del plugin e le informazioni sulla licenza.
-h --help Stampa le informazioni di aiuto (scorciatoia).
-t, --test <item key> Avvia il plugin per il test (la configurazione del plugin viene ignorata).

Parametri

Quando ci si connette a MongoDB, il plugin controlla la propria configurazione in un ordine specifico, che determina quale valore usare. L'ordine, dalla priorità più alta alla più bassa, è il seguente:

  1. Parametri specificati nell'URI di connessione (ad esempio, i parametri di query definiti dopo ? in Plugins.MongoDB.Sessions.<session_name>.Uri hanno la priorità più alta).
  2. Parametri nella chiave item di Zabbix agent 2 (ad esempio, mongodb.collection.stats).
  3. Parametri definiti in una sessione denominata (ad esempio, Plugins.MongoDB.Sessions.<SessionName>.User, Plugins.MongoDB.Sessions.<SessionName>.Password).
  4. Valori predefiniti (ad esempio, Plugins.MongoDB.Default.User, Plugins.MongoDB.Default.Password).

Ad esempio:

  • Se si specifica il database per l'autenticazione di una connessione al server MongoDB nel parametro *.<SessionName>.Uri (ad esempio, Plugins.MongoDB.Sessions.<session_name>.Uri=mongodb://user:[email protected]:27017/?authSource=admin), il plugin considererà il parametro *.<SessionName>.AuthSource impostato su admin, anche se il parametro *.<SessionName>.AuthSource è impostato su un valore diverso.
  • Se si specifica l'URI nel parametro *.<SessionName>.Uri (ad esempio, Plugins.MongoDB.Sessions.<session_name>.Uri=mongodb://127.0.0.1:27017), ma si forniscono nome utente e password nella chiave item di Zabbix agent 2, il plugin userà il nome utente e la password dalla chiave item, anche se Plugins.MongoDB.Sessions.<SessionName>.User e Plugins.MongoDB.Sessions.<SessionName>.Password sono configurati.

Se viene usato lo schema mongodb+srv://, l'URI può recuperare i parametri da un record DNS TXT. I parametri ottenuti da questo record TXT sostituiscono tutte le altre configurazioni, inclusi i parametri URI, i parametri della chiave item di Zabbix Agent 2 e i parametri della sessione.
Per il nome host usato nella stringa di connessione può esistere un solo record TXT.

Parameter Mandatory Range Default Description
Plugins.MongoDB.System.Path no Percorso dell'eseguibile del plugin MongoDB.
Esempio di utilizzo: Plugins.MongoDB.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-mongodb
Plugins.MongoDB.Timeout no 1-30 global timeout Timeout di esecuzione della richiesta (la durata, in secondi, da attendere il completamento di una richiesta prima di interromperla).
Plugins.MongoDB.KeepAlive no 60-900 300 Tempo massimo di attesa (in secondi) prima che le connessioni del plugin non utilizzate vengano chiuse.
Plugins.MongoDB.Sessions.<SessionName>.Uri no tcp://127.0.0.1:27017 Stringa di connessione di una sessione denominata.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.

Deve corrispondere al formato URI.
Schema supportati: mongodb:// e mongodb+srv://; lo schema tcp:// è deprecato e mantenuto per compatibilità con configurazioni esistenti.
La porta può essere omessa (predefinita=27017).
Esempi: mongodb://127.0.0.1:27017, mongodb+srv://example.com, localhost.
Plugins.MongoDB.Sessions.<SessionName>.User no Nome utente della sessione denominata.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.MongoDB.Sessions.<SessionName>.Password no Password della sessione denominata.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.MongoDB.Sessions.<SessionName>.Direct no false Metodo di connessione usato per determinare se il rilevamento automatico dei nodi del replica set MongoDB deve essere abilitato o disabilitato.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.

Valori supportati:
true - il plugin si connetterà solo al server specificato, ignorando gli altri membri del replica set;
false - il plugin rileverà automaticamente tutti i nodi nel replica set.
Se viene usato lo schema tcp:// (deprecato), il parametro è impostato su true per impostazione predefinita.
Plugins.MongoDB.Sessions.<SessionName>.AuthMechanism no Meccanismo di autenticazione per la connessione al server MongoDB.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.

Valori supportati: SCRAM-SHA-1, SCRAM-SHA-256 e MONGODB-X509.
Plugins.MongoDB.Sessions.<SessionName>.AuthSource no admin Database per l'autenticazione della connessione al server MongoDB.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.

Se viene usato il meccanismo di autenticazione MONGODB-X509, questo parametro viene impostato automaticamente su $external; modificarlo in qualsiasi altro valore causerà un errore all'avvio.
Plugins.MongoDB.Sessions.<SessionName>.ReplicaSet no Nome del replica set, usato per il rilevamento automatico dei nodi del replica set MongoDB.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.

Se questo parametro viene usato con lo schema mongodb+srv://, si comporterà come se fossero stati forniti più URL; un server DNS può avere un record TXT che può sostituire questo parametro (o qualsiasi altro).

Non disponibile se il parametro Plugins.MongoDB.Sessions.<SessionName>.Direct è impostato su true, l'agent non riuscirà ad avviarsi.
Plugins.MongoDB.Sessions.<SessionName>.ReadPreference no Ordine per la connessione ai nodi del replica set MongoDB o per il fallback.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.

Valori supportati: PrimaryMode, PrimaryPreferredMode, SecondaryMode, SecondaryPreferredMode e NearestMode.
Non disponibile se il parametro Plugins.MongoDB.Sessions.<SessionName>.Direct è impostato su true, l'agent non riuscirà ad avviarsi.
Plugins.MongoDB.Sessions.<SessionName>.TLSConnect no Tipo di crittografia per le comunicazioni tra Zabbix agent 2 e i database monitorati.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.

Valori supportati:
required - richiede una connessione TLS;
verify\_ca - verifica i certificati;
verify\_full - verifica i certificati e l'indirizzo IP.

Supportato dalla versione 1.2.1 del plugin.
Plugins.MongoDB.Sessions.<SessionName>.TLSCAFile yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSConnect is set to one of: verify_ca, verify_full Percorso completo di un file contenente i certificati CA di livello superiore per la verifica del certificato del peer, usato per le comunicazioni crittografate tra Zabbix agent 2 e i database monitorati.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.MongoDB.Sessions.<SessionName>.TLSCertFile yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSKeyFile is specified Percorso completo di un file contenente il certificato dell'agent o la catena di certificati, usato per le comunicazioni crittografate tra Zabbix agent 2 e i database monitorati.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.MongoDB.Sessions.<SessionName>.TLSKeyFile yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSCertFile is specified Percorso completo di un file contenente la chiave privata del database usata per le comunicazioni crittografate tra Zabbix agent 2 e i database monitorati.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.MongoDB.Default.Uri no tcp://127.0.0.1:27017 URI predefinito per la connessione a MongoDB.

Deve corrispondere al formato URI.
Schema supportati: mongodb:// e mongodb+srv://.
Schema deprecato: tcp:// (usato come predefinito per compatibilità con configurazioni esistenti).
La porta può essere omessa (predefinita=27017).
Esempi: mongodb://127.0.0.1:27017, mongodb+srv://example.com, localhost.
Plugins.MongoDB.Default.User no Nome utente predefinito per la connessione a MongoDB.
Plugins.MongoDB.Default.Password no Password predefinita per la connessione a MongoDB.
Plugins.MongoDB.Default.Direct no false Metodo di connessione predefinito usato per determinare se il rilevamento automatico dei nodi del replica set MongoDB deve essere abilitato o disabilitato.

Valori supportati:
true - il plugin si connetterà solo al server specificato, ignorando gli altri membri del replica set;
false - il plugin rileverà automaticamente tutti i nodi nel replica set.
Se viene usato lo schema tcp:// (deprecato), il parametro è impostato su true per impostazione predefinita.
Plugins.MongoDB.Default.AuthMechanism no Meccanismo di autenticazione predefinito per la connessione al server MongoDB.

Valori supportati: SCRAM-SHA-1, SCRAM-SHA-256 e MONGODB-X509.
Se non viene specificato alcun valore qui, in una chiave item, in una sessione denominata o nell'URI, viene usato un meccanismo basato su SCRAM (se è fornito un nome utente; in caso contrario, non verrà usata alcuna autenticazione).
Plugins.MongoDB.Default.AuthSource no admin Database predefinito per l'autenticazione della connessione al server MongoDB.

Se viene usato il meccanismo di autenticazione MONGODB-X509, questo parametro viene impostato automaticamente su $external; modificarlo in qualsiasi altro valore causerà un errore all'avvio.
Plugins.MongoDB.Default.ReplicaSet no Nome predefinito del replica set; usato per il rilevamento automatico dei nodi del replica set MongoDB.

Se questo parametro viene usato con lo schema mongodb+srv://, si comporterà come se fossero stati forniti più URL; un server DNS può avere un record TXT che può sostituire questo parametro (o qualsiasi altro).

Non disponibile se il parametro Plugins.MongoDB.Default.Direct è impostato su true, l'agent non riuscirà ad avviarsi.
Plugins.MongoDB.Default.ReadPreference no Ordine predefinito per la connessione ai nodi del replica set MongoDB o per il fallback.

Valori supportati: PrimaryMode, PrimaryPreferredMode, SecondaryMode, SecondaryPreferredMode e NearestMode.
Non disponibile se il parametro Plugins.MongoDB.Default.Direct è impostato su true, l'agent non riuscirà ad avviarsi.
Plugins.MongoDB.Default.TLSConnect no Tipo di crittografia predefinito per le comunicazioni tra Zabbix agent 2 e i database monitorati.

Valori supportati:
required - richiede una connessione TLS.
verify\_ca - verifica i certificati.
verify\_full - verifica i certificati e l'indirizzo IP.
Se non viene specificato alcun valore qui, in una chiave item, in una sessione denominata o nell'URI, non verrà stabilita alcuna connessione TLS.
Plugins.MongoDB.Default.TLSCAFile no Percorso predefinito di un file contenente i certificati CA di livello superiore per la verifica del certificato del peer. Usato per le comunicazioni crittografate tra Zabbix agent 2 e i database monitorati.
Plugins.MongoDB.Default.TLSCertFile no Percorso predefinito di un file contenente il certificato client MongoDB o la catena di certificati. Usato per le comunicazioni crittografate tra Zabbix agent 2 e i database monitorati.
Plugins.MongoDB.Default.TLSKeyFile no Percorso predefinito di un file contenente la chiave privata client MongoDB usata per le comunicazioni crittografate tra Zabbix agent 2 e i database monitorati.

Vedi anche: