Wtyczka MongoDB

Przegląd

Parametry konfiguracyjne umożliwiają dostosowanie działania wtyczki MongoDB.

Zaleca się określanie ich w osobnym pliku konfiguracyjnym (np. mongodb.conf), a nie w pliku konfiguracyjnym agent 2. Następnie użyj dyrektywy Include, aby dołączyć ten plik do konfiguracji Zabbix agent 2.

Wtyczka MongoDB jest wtyczką ładowaną i jest dostępna oraz w pełni opisana w repozytorium wtyczki MongoDB.

Wszystkie parametry są opcjonalne, chyba że wyraźnie zaznaczono, że dany parametr jest obowiązkowy.

Należy pamiętać, że:

  • Wartości domyślne odzwierciedlają domyślne ustawienia procesu, a nie wartości zawarte w dostarczonych plikach konfiguracyjnych.
  • Wartości obsługują zmienne środowiskowe.
  • Zabbix obsługuje pliki konfiguracyjne wyłącznie w kodowaniu UTF-8 bez BOM.
  • Komentarze zaczynające się od "#" są obsługiwane tylko na początku wiersza.

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

Opcje

Parameter Description
-V --version Wyświetl wersję wtyczki i informacje o licencji.
-h --help Wyświetl informacje pomocy (skrót).
-t, --test <item key> Uruchom wtyczkę do testów (konfiguracja wtyczki jest ignorowana).

Parametry

Podczas łączenia z MongoDB wtyczka sprawdza swoją konfigurację w określonej kolejności, co decyduje o tym, której wartości użyć. Kolejność, od najwyższego do najniższego priorytetu, jest następująca:

  1. Parametry określone w URI połączenia (np. parametry zapytania zdefiniowane po ? w Plugins.MongoDB.Sessions.<session_name>.Uri mają najwyższy priorytet).
  2. Parametry w kluczu pozycji agenta Zabbix 2 (np. mongodb.collection.stats).
  3. Parametry zdefiniowane w nazwanej sesji (np. Plugins.MongoDB.Sessions.<SessionName>.User, Plugins.MongoDB.Sessions.<SessionName>.Password).
  4. Wartości domyślne (np. Plugins.MongoDB.Default.User, Plugins.MongoDB.Default.Password).

Na przykład:

  • Jeśli określisz bazę danych do uwierzytelniania połączenia z serwerem MongoDB w parametrze *.<SessionName>.Uri (np. Plugins.MongoDB.Sessions.<session_name>.Uri=mongodb://user:[email protected]:27017/?authSource=admin), wtyczka uzna, że parametr *.<SessionName>.AuthSource ma wartość admin, nawet jeśli parametr *.<SessionName>.AuthSource jest ustawiony na inną wartość.
  • Jeśli określisz URI w parametrze *.<SessionName>.Uri (np. Plugins.MongoDB.Sessions.<session_name>.Uri=mongodb://127.0.0.1:27017), ale podasz nazwę użytkownika i hasło w kluczu pozycji agenta Zabbix 2, wtyczka użyje nazwy użytkownika i hasła z klucza pozycji, nawet jeśli skonfigurowano Plugins.MongoDB.Sessions.<SessionName>.User i Plugins.MongoDB.Sessions.<SessionName>.Password.

Jeśli używany jest schemat mongodb+srv://, URI może pobierać parametry z rekordu DNS TXT. Parametry uzyskane z tego rekordu TXT zastępują wszystkie inne konfiguracje, w tym parametry URI, parametry klucza pozycji agenta Zabbix 2 oraz parametry sesji.
Dla nazwy hosta używanej w ciągu połączenia może istnieć tylko jeden rekord TXT.

Parameter Mandatory Range Default Description
Plugins.MongoDB.System.Path no Ścieżka do pliku wykonywalnego wtyczki MongoDB.
Przykład użycia: Plugins.MongoDB.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-mongodb
Plugins.MongoDB.Timeout no 1-30 global timeout Limit czasu wykonania żądania (czas w sekundach, przez jaki należy czekać na zakończenie żądania przed jego przerwaniem).
Plugins.MongoDB.KeepAlive no 60-900 300 Maksymalny czas oczekiwania (w sekundach) przed zamknięciem nieużywanych połączeń wtyczki.
Plugins.MongoDB.Sessions.<SessionName>.Uri no tcp://127.0.0.1:27017 Ciąg połączenia nazwanej sesji.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.

Musi być zgodny z formatem URI.
Obsługiwane schematy: mongodb:// i mongodb+srv://; schemat tcp:// jest przestarzały i zachowany ze względu na zgodność wsteczną z istniejącymi konfiguracjami.
Port można pominąć (domyślnie=27017).
Przykłady: mongodb://127.0.0.1:27017, mongodb+srv://example.com, localhost.
Plugins.MongoDB.Sessions.<SessionName>.User no Nazwa użytkownika nazwanej sesji.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.MongoDB.Sessions.<SessionName>.Password no Hasło nazwanej sesji.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.MongoDB.Sessions.<SessionName>.Direct no false Metoda połączenia używana do określenia, czy automatyczne wykrywanie węzłów zestawu replik MongoDB ma być włączone, czy wyłączone.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.

Obsługiwane wartości:
true - wtyczka połączy się tylko z określonym serwerem, ignorując pozostałych członków zestawu replik;
false - wtyczka automatycznie wykryje wszystkie węzły w zestawie replik.
Jeśli używany jest schemat tcp:// (przestarzały), parametr jest domyślnie ustawiony na true.
Plugins.MongoDB.Sessions.<SessionName>.AuthMechanism no Mechanizm uwierzytelniania do łączenia z serwerem MongoDB.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.

Obsługiwane wartości: SCRAM-SHA-1, SCRAM-SHA-256 i MONGODB-X509.
Plugins.MongoDB.Sessions.<SessionName>.AuthSource no admin Baza danych do uwierzytelniania połączenia z serwerem MongoDB.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.

Jeśli używany jest mechanizm uwierzytelniania MONGODB-X509, ten parametr jest automatycznie ustawiany na $external; zmiana go na jakąkolwiek inną wartość spowoduje błąd podczas uruchamiania.
Plugins.MongoDB.Sessions.<SessionName>.ReplicaSet no Nazwa zestawu replik, używana do automatycznego wykrywania węzłów zestawu replik MongoDB.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.

Jeśli ten parametr jest używany ze schematem mongodb+srv://, będzie działał tak, jakby podano wiele adresów URL; serwer DNS może mieć rekord TXT, który może zastąpić ten (lub dowolny inny) parametr.

Niedostępny, jeśli parametr Plugins.MongoDB.Sessions.<SessionName>.Direct jest ustawiony na true, agent nie uruchomi się.
Plugins.MongoDB.Sessions.<SessionName>.ReadPreference no Kolejność łączenia z węzłami zestawu replik MongoDB lub tryb awaryjny.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.

Obsługiwane wartości: PrimaryMode, PrimaryPreferredMode, SecondaryMode, SecondaryPreferredMode i NearestMode.
Niedostępny, jeśli parametr Plugins.MongoDB.Sessions.<SessionName>.Direct jest ustawiony na true, agent nie uruchomi się.
Plugins.MongoDB.Sessions.<SessionName>.TLSConnect no Typ szyfrowania komunikacji między agentem Zabbix 2 a monitorowanymi bazami danych.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.

Obsługiwane wartości:
required - wymagaj połączenia TLS;
verify\_ca - weryfikuj certyfikaty;
verify\_full - weryfikuj certyfikaty i adres IP.

Obsługiwane od wersji wtyczki 1.2.1.
Plugins.MongoDB.Sessions.<SessionName>.TLSCAFile yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSConnect is set to one of: verify_ca, verify_full Pełna ścieżka do pliku zawierającego certyfikaty głównego urzędu CA używane do weryfikacji certyfikatu peer, stosowana w szyfrowanej komunikacji między agentem Zabbix 2 a monitorowanymi bazami danych.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.MongoDB.Sessions.<SessionName>.TLSCertFile yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSKeyFile is specified Pełna ścieżka do pliku zawierającego certyfikat agenta lub łańcuch certyfikatów, używana w szyfrowanej komunikacji między agentem Zabbix 2 a monitorowanymi bazami danych.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.MongoDB.Sessions.<SessionName>.TLSKeyFile yes, if Plugins.MongoDB.Sessions.<SessionName>.TLSCertFile is specified Pełna ścieżka do pliku zawierającego prywatny klucz bazy danych używany w szyfrowanej komunikacji między agentem Zabbix 2 a monitorowanymi bazami danych.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.MongoDB.Default.Uri no tcp://127.0.0.1:27017 Domyślny URI do łączenia z MongoDB.

Musi być zgodny z formatem URI.
Obsługiwane schematy: mongodb:// i mongodb+srv://.
Schemat przestarzały: tcp:// (używany jako domyślny ze względu na zgodność wsteczną z istniejącymi konfiguracjami).
Port można pominąć (domyślnie=27017).
Przykłady: mongodb://127.0.0.1:27017, mongodb+srv://example.com, localhost.
Plugins.MongoDB.Default.User no Domyślna nazwa użytkownika do łączenia z MongoDB.
Plugins.MongoDB.Default.Password no Domyślne hasło do łączenia z MongoDB.
Plugins.MongoDB.Default.Direct no false Domyślna metoda połączenia używana do określenia, czy automatyczne wykrywanie węzłów zestawu replik MongoDB ma być włączone, czy wyłączone.

Obsługiwane wartości:
true - wtyczka połączy się tylko z określonym serwerem, ignorując pozostałych członków zestawu replik;
false - wtyczka automatycznie wykryje wszystkie węzły w zestawie replik.
Jeśli używany jest schemat tcp:// (przestarzały), parametr jest domyślnie ustawiony na true.
Plugins.MongoDB.Default.AuthMechanism no Domyślny mechanizm uwierzytelniania do łączenia z serwerem MongoDB.

Obsługiwane wartości: SCRAM-SHA-1, SCRAM-SHA-256 i MONGODB-X509.
Jeśli nie zostanie podana żadna wartość ani tutaj, ani w kluczu pozycji, ani w nazwanej sesji, ani w URI, używany jest mechanizm oparty na SCRAM (jeśli podano nazwę użytkownika; w przeciwnym razie uwierzytelnianie nie będzie używane).
Plugins.MongoDB.Default.AuthSource no admin Domyślna baza danych do uwierzytelniania połączenia z serwerem MongoDB.

Jeśli używany jest mechanizm uwierzytelniania MONGODB-X509, ten parametr jest automatycznie ustawiany na $external; zmiana go na jakąkolwiek inną wartość spowoduje błąd podczas uruchamiania.
Plugins.MongoDB.Default.ReplicaSet no Domyślna nazwa zestawu replik; używana do automatycznego wykrywania węzłów zestawu replik MongoDB.

Jeśli ten parametr jest używany ze schematem mongodb+srv://, będzie działał tak, jakby podano wiele adresów URL; serwer DNS może mieć rekord TXT, który może zastąpić ten (lub dowolny inny) parametr.
Niedostępny, jeśli parametr Plugins.MongoDB.Default.Direct jest ustawiony na true, agent nie uruchomi się.
Plugins.MongoDB.Default.ReadPreference no Domyślna kolejność łączenia z węzłami zestawu replik MongoDB lub tryb awaryjny.

Obsługiwane wartości: PrimaryMode, PrimaryPreferredMode, SecondaryMode, SecondaryPreferredMode i NearestMode.
Niedostępny, jeśli parametr Plugins.MongoDB.Default.Direct jest ustawiony na true, agent nie uruchomi się.
Plugins.MongoDB.Default.TLSConnect no Domyślny typ szyfrowania komunikacji między agentem Zabbix 2 a monitorowanymi bazami danych.

Obsługiwane wartości:
required - wymaga połączenia TLS;
verify\_ca - weryfikuje certyfikaty;
verify\_full - weryfikuje certyfikaty i adres IP.
Jeśli nie zostanie podana żadna wartość ani tutaj, ani w kluczu pozycji, ani w nazwanej sesji, ani w URI, połączenie TLS nie zostanie ustanowione.
Plugins.MongoDB.Default.TLSCAFile no Domyślna pełna ścieżka do pliku zawierającego certyfikaty głównego urzędu CA używane do weryfikacji certyfikatu peer. Używana w szyfrowanej komunikacji między agentem Zabbix 2 a monitorowanymi bazami danych.
Plugins.MongoDB.Default.TLSCertFile no Domyślna pełna ścieżka do pliku zawierającego certyfikat klienta MongoDB lub łańcuch certyfikatów. Używana w szyfrowanej komunikacji między agentem Zabbix 2 a monitorowanymi bazami danych.
Plugins.MongoDB.Default.TLSKeyFile no Domyślna pełna ścieżka do pliku zawierającego prywatny klucz klienta MongoDB używany w szyfrowanej komunikacji między agentem Zabbix 2 a monitorowanymi bazami danych.

Zobacz także: