Wtyczka PostgreSQL

Przegląd

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

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

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

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 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.PostgreSQL.CallTimeout

Set the maximum wait time in seconds for a request to be completed.

Default: global timeout
Range: 1-30

Plugins.PostgreSQL.CustomQueriesPath

Specify full pathname of the directory containing .sql files with custom queries.

Defaults:
/usr/local/share/zabbix/custom-queries/postgreSQL - for Unix systems,
*:\Program Files\Zabbix Agent 2\Custom Queries\PostgreSQL - for Windows systems (where * is the drive name from the ProgramFiles environment variable)

Example:

/etc/zabbix/oracle/sql
Plugins.PostgreSQL.CustomQueriesEnabled

Enable execution of the postgresql.custom.query item key.
If disabled, no queries will be loaded from the custom query directory path.

Default: false
Range: true/false

Plugins.PostgreSQL.Default.CacheMode

Specify the default cache mode for the PostgreSQL connection.

Default: prepare
Range:
prepare - create prepared statements on the PostgreSQL server;
describe - use the anonymous prepared statement to describe a statement without creating a statement on the server.

Note that describe is primarily useful when the environment does not allow prepared statements such as when running a connection pooler like PgBouncer.

Plugins.PostgreSQL.Default.Database

Specify the default database for connecting to PostgreSQL.
Used if no value is specified in an item key or named session.

Plugins.PostgreSQL.Default.Password

Specify the default password for connecting to PostgreSQL.
Used if no value is specified in an item key or named session.

Plugins.PostgreSQL.Default.TLSCAFile

Specify full pathname of the file containing the top-level CA(s) certificate for peer certificate verification for encrypted communications between Zabbix agent 2 and monitored databases.
Used if no value is specified in a named session.

Mandatory: yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full

Plugins.PostgreSQL.Default.TLSCertFile

Specify full pathname of the file containing the PostgreSQL certificate or certificate chain for encrypted communications between Zabbix agent 2 and monitored databases.
Used if no value is specified in a named session.

Mandatory: yes, if Plugins.PostgreSQL.Default.TLSKeyFile is specified

Plugins.PostgreSQL.Default.TLSConnect

Specify the default level of encryption for communications between Zabbix agent 2 and monitored databases.
Used if no value is specified in a named session.

Range:
required - connect using TLS as transport mode without identity checks;
verify_ca - connect using TLS and verify certificate;
verify_full - connect using TLS, verify certificate and verify that database identity (CN) specified by DBHost matches its certificate.

Undefined encryption type means unencrypted connection.

Plugins.PostgreSQL.Default.TLSKeyFile

Specify full pathname of the file containing the PostgreSQL private key for encrypted communications between Zabbix agent 2 and monitored databases.
Used if no value is specified in a named session.

Mandatory: yes, if Plugins.PostgreSQL.Default.TLSCertFile is specified

Plugins.PostgreSQL.Default.Uri

Specify the default URI for connecting to PostgreSQL.
Used if no value is specified in an item key or named session.
Embedded credentials will be ignored.
Must match the URI format.
Supported schemes: tcp, unix

Examples:

tcp://127.0.0.1:5432
tcp://localhost
unix:/var/run/postgresql/.s.PGSQL.5432
Plugins.PostgreSQL.Default.User

Specify the default username for connecting to PostgreSQL.
Used if no value is specified in an item key or named session.

Plugins.PostgreSQL.KeepAlive

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

Plugins.PostgreSQL.Sessions.<SessionName>.CacheMode

Specify the named session cache mode for the PostgreSQL connection.
<SessionName> - define name of a session for using in item keys.

Default: prepare
Range:
prepare - create prepared statements on the PostgreSQL server;
describe - use the anonymous prepared statement to describe a statement without creating a statement on the server.

Note that describe is primarily useful when the environment does not allow prepared statements such as when running a connection pooler like PgBouncer.

Plugins.PostgreSQL.Sessions.<SessionName>.Database

Specify the named session database for connecting to PostgreSQL.
<SessionName> - define name of a session for using in item keys.

Plugins.PostgreSQL.Sessions.<SessionName>.Password

Specify the named session password for connecting to PostgreSQL.
<SessionName> - define name of a session for using in item keys.
Must match the password format.

Plugins.PostgreSQL.Sessions.<SessionName>.TLSCAFile

Specify full pathname of the file containing the top-level CA(s) certificate for peer certificate verification 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.PostgreSQL.Sessions.<SessionName>.TLSConnect is set to verify_ca or verify_full

Plugins.PostgreSQL.Sessions.<SessionName>.TLSCertFile

Specify full pathname of the file containing the PostgreSQL certificate or certificate chain 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.PostgreSQL.Sessions.<SessionName>.TLSKeyFile is specified

Plugins.PostgreSQL.Sessions.<SessionName>.TLSConnect

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

Range:
required - connect using TLS as transport mode without identity checks;
verify_ca - connect using TLS and verify certificate;
verify_full - connect using TLS, verify certificate and verify that database identity (CN) specified by DBHost matches its certificate.

Undefined encryption type means unencrypted connection.

Plugins.PostgreSQL.Sessions.<SessionName>.TLSKeyFile

Specify full pathname of the file containing the PostgreSQL private key 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.PostgreSQL.Sessions.<SessionName>.TLSCertFile is specified.

Plugins.PostgreSQL.Sessions.<SessionName>.Uri

Specify the named session URI for connecting to PostgreSQL.
<SessionName> - define name of a session for using in item keys.
Embedded credentials will be ignored.
Must match the URI format.
Supported schemes: tcp, unix

Examples:

tcp://127.0.0.1:5432
tcp://localhost
unix:/var/run/postgresql/.s.PGSQL.5432
Plugins.PostgreSQL.Sessions.<SessionName>.User

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

Plugins.PostgreSQL.System.Path

Specify path to the PostgreSQL plugin executable.

Mandatory: yes

Example:

Plugins.PostgreSQL.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-postgresql
Plugins.PostgreSQL.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świetla wersję wtyczki i informacje o licencji.
-h --help Wyświetla informacje pomocy (skrót).
-t, --test <item key> Uruchamia wtyczkę do testowania (konfiguracja wtyczki jest ignorowana).

Parametry

Parameter Mandatory Range Default Description
Plugins.PostgreSQL.Default.CacheMode no prepare Tryb pamięci podręcznej dla połączenia PostgreSQL.
Obsługiwane wartości:
prepare (domyślnie) - utworzy przygotowane instrukcje na serwerze PostgreSQL;
describe - użyje anonimowej przygotowanej instrukcji do opisania instrukcji bez tworzenia jej na serwerze.
Uwaga: "describe" jest przede wszystkim przydatne, gdy środowisko nie pozwala na przygotowane instrukcje, na przykład podczas korzystania z puli połączeń, takiej jak PgBouncer.
Plugins.PostgreSQL.CallTimeout no 1-30 global timeout Maksymalny czas oczekiwania (w sekundach) na zakończenie żądania.
Plugins.PostgreSQL.CustomQueriesPath no /usr/local/share/zabbix/custom-queries/postgreSQL dla systemów Unix

*:\Program Files\Zabbix Agent 2\Custom Queries\PostgreSQL dla systemów Windows, gdzie * jest nazwą dysku z zmiennej środowiskowej ProgramFiles
Pełna ścieżka do katalogu zawierającego pliki .sql z niestandardowymi zapytaniami.
Plugins.PostgreSQL.CustomQueriesEnabled no false Jeśli ustawione, włącza wykonywanie klucza pozycja postgresql.custom.query. Jeśli wyłączone, żadne zapytania nie będą ładowane z katalogu niestandardowych zapytań.
Plugins.PostgreSQL.Default.Database no Domyślna baza danych do łączenia z PostgreSQL; używana, jeśli nie podano wartości w kluczu pozycji lub nazwanej sesji.
Plugins.PostgreSQL.Default.Password no Domyślne hasło do łączenia z PostgreSQL; używane, jeśli nie podano wartości w kluczu pozycji lub nazwanej sesji.
Plugins.PostgreSQL.Default.TLSCAFile no
(yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full)
Pełna ścieżka do pliku zawierającego certyfikat(y) głównego urzędu CA do weryfikacji certyfikatu peer dla szyfrowanej komunikacji między Zabbix agent 2 a monitorowanymi bazami danych; używana, jeśli nie podano wartości w nazwanej sesji.
Plugins.PostgreSQL.Default.TLSCertFile no
(yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full)
Pełna ścieżka do pliku zawierającego certyfikat PostgreSQL lub łańcuch certyfikatów dla szyfrowanej komunikacji między Zabbix agent 2 a monitorowanymi bazami danych; używana, jeśli nie podano wartości w nazwanej sesji.
Plugins.PostgreSQL.Default.TLSConnect no Typ szyfrowania dla komunikacji między Zabbix agent 2 a monitorowanymi bazami danych; używany, jeśli nie podano wartości w nazwanej sesji.
Obsługiwane wartości:
required - połączenie z użyciem TLS jako trybu transportu bez sprawdzania tożsamości;
verify_ca - połączenie z użyciem TLS i weryfikacją certyfikatu;
verify_full - połączenie z użyciem TLS, weryfikacją certyfikatu oraz sprawdzeniem, czy tożsamość bazy danych (CN) określona przez DBHost zgadza się z jej certyfikatem.
Nieokreślony typ szyfrowania oznacza połączenie nieszyfrowane.
Plugins.PostgreSQL.Default.TLSKeyFile no
(yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full)
Pełna ścieżka do pliku zawierającego prywatny klucz PostgreSQL dla szyfrowanej komunikacji między Zabbix agent 2 a monitorowanymi bazami danych; używana, jeśli nie podano wartości w nazwanej sesji.
Plugins.PostgreSQL.Default.Uri no Domyślny URI do łączenia z PostgreSQL; używany, jeśli nie podano wartości w kluczu pozycji lub nazwanej sesji.

Nie powinien zawierać osadzonych poświadczeń (zostaną zignorowane).
Musi odpowiadać formatowi URI.
Obsługiwane schematy: tcp, unix.
Przykłady: tcp://127.0.0.1:5432
tcp://localhost
unix:/var/run/postgresql/.s.PGSQL.5432
Plugins.PostgreSQL.Default.User no Domyślna nazwa użytkownika do łączenia z PostgreSQL; używana, jeśli nie podano wartości w kluczu pozycji lub nazwanej sesji.
Plugins.PostgreSQL.KeepAlive no 60-900 300 Maksymalny czas oczekiwania (w sekundach) przed zamknięciem nieużywanych połączeń wtyczki.
Plugins.PostgreSQL.Sessions.<SessionName>.CacheMode no prepare Tryb pamięci podręcznej dla połączenia PostgreSQL.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Obsługiwane wartości:
prepare (domyślnie) - utworzy przygotowane instrukcje na serwerze PostgreSQL;
describe - użyje anonimowej przygotowanej instrukcji do opisania instrukcji bez tworzenia jej na serwerze.
Uwaga: "describe" jest przede wszystkim przydatne, gdy środowisko nie pozwala na przygotowane instrukcje, na przykład podczas korzystania z puli połączeń, takiej jak PgBouncer.
Plugins.PostgreSQL.Sessions.<SessionName>.Database no Baza danych dla połączenia sesji.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.PostgreSQL.Sessions.<SessionName>.Password no Must match the password format. Hasło dla połączenia sesji.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSCAFile no
(yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSConnect is set to verify_ca or verify_full)
Pełna ścieżka do pliku zawierającego certyfikat(y) głównego urzędu CA do weryfikacji certyfikatu peer.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSCertFile yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSKeyFile is specified Pełna ścieżka do pliku zawierającego certyfikat PostgreSQL lub łańcuch certyfikatów.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSConnect no Typ szyfrowania dla połączenia PostgreSQL.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.

Obsługiwane wartości:
required - połączenie z użyciem TLS jako trybu transportu bez sprawdzania tożsamości;
verify_ca - połączenie z użyciem TLS i weryfikacją certyfikatu;
verify_full - połączenie z użyciem TLS, weryfikacją certyfikatu oraz sprawdzeniem, czy tożsamość bazy danych (CN) określona przez DBHost zgadza się z jej certyfikatem.
Nieokreślony typ szyfrowania oznacza połączenie nieszyfrowane.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSKeyFile yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSCertFile is specified Pełna ścieżka do pliku zawierającego prywatny klucz PostgreSQL.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.PostgreSQL.Sessions.<SessionName>.Uri no Ciąg połączenia nazwanej sesji.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.

Nie powinien zawierać osadzonych poświadczeń (zostaną zignorowane).
Musi odpowiadać formatowi URI.
Obsługiwane schematy: tcp, unix.
Przykłady: tcp://127.0.0.1:5432
tcp://localhost
unix:/var/run/postgresql/.s.PGSQL.5432
Plugins.PostgreSQL.Sessions.<SessionName>.User no Nazwa użytkownika nazwanej sesji.
<SessionName> - zdefiniuj nazwę sesji do użycia w kluczach pozycji.
Plugins.PostgreSQL.System.Path yes Ścieżka do pliku wykonywalnego wtyczki PostgreSQL.
Przykład użycia: Plugins.PostgreSQL.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-postgresql
Plugins.PostgreSQL.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).

Zobacz także: