- Плагин PostgreSQL
- Parameter details
- Plugins.PostgreSQL.CallTimeout
- Plugins.PostgreSQL.CustomQueriesPath
- Plugins.PostgreSQL.CustomQueriesEnabled
- Plugins.PostgreSQL.Default.CacheMode
- Plugins.PostgreSQL.Default.Database
- Plugins.PostgreSQL.Default.Password
- Plugins.PostgreSQL.Default.TLSCAFile
- Plugins.PostgreSQL.Default.TLSCertFile
- Plugins.PostgreSQL.Default.TLSConnect
- Plugins.PostgreSQL.Default.TLSKeyFile
- Plugins.PostgreSQL.Default.Uri
- Plugins.PostgreSQL.Default.User
- Plugins.PostgreSQL.KeepAlive
- Plugins.PostgreSQL.Sessions.<SessionName>.CacheMode
- Plugins.PostgreSQL.Sessions.<SessionName>.Database
- Plugins.PostgreSQL.Sessions.<SessionName>.Password
- Plugins.PostgreSQL.Sessions.<SessionName>.TLSCAFile
- Plugins.PostgreSQL.Sessions.<SessionName>.TLSCertFile
- Plugins.PostgreSQL.Sessions.<SessionName>.TLSConnect
- Plugins.PostgreSQL.Sessions.<SessionName>.TLSKeyFile
- Plugins.PostgreSQL.Sessions.<SessionName>.Uri
- Plugins.PostgreSQL.Sessions.<SessionName>.User
- Plugins.PostgreSQL.System.Path
- Plugins.PostgreSQL.Timeout
- Параметры
- Параметры
Плагин PostgreSQL
Обзор
Параметры конфигурации позволяют настраивать поведение плагина PostgreSQL.
Рекомендуется указывать их в отдельном файле конфигурации (например, postgresql.conf), а не в файле конфигурации агента 2. Затем используйте директиву Include, чтобы включить этот файл в конфигурацию Zabbix agent 2.
Плагин PostgreSQL является загружаемым плагином и доступен, а также полностью описан в репозитории плагина PostgreSQL.
Все параметры являются необязательными, если явно не указано, что параметр обязателен.
Обратите внимание:
- Значения по умолчанию отражают значения по умолчанию процесса, а не значения в поставляемых файлах конфигурации.
- Значения поддерживают переменные среды;
- Zabbix поддерживает файлы конфигурации только в кодировке UTF-8 без BOM.
- Комментарии, начинающиеся с "#", поддерживаются только в начале строки.
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
Параметры
| Parameter | Description |
|---|---|
| -V --version | Вывести версию плагина и информацию о лицензии. |
| -h --help | Вывести справочную информацию (сокращенный вариант). |
| -t, --test <item key> | Запустить плагин для тестирования (конфигурация плагина игнорируется). |
Параметры
| Parameter | Mandatory | Range | Default | Description |
|---|---|---|---|---|
| Plugins.PostgreSQL.Default.CacheMode | no | prepare | Режим кэширования для подключения PostgreSQL. Поддерживаемые значения: prepare (по умолчанию) - создаст подготовленные выражения на сервере PostgreSQL; describe - будет использовать анонимное подготовленное выражение для описания выражения без создания выражения на сервере. Обратите внимание, что "describe" в первую очередь полезен, когда среда не позволяет использовать подготовленные выражения, например при работе через пул подключений, такой как PgBouncer. |
|
| Plugins.PostgreSQL.CallTimeout | no | 1-30 | global timeout | Максимальное время ожидания (в секундах) завершения запроса. |
| Plugins.PostgreSQL.CustomQueriesPath | no | /usr/local/share/zabbix/custom-queries/postgreSQL для Unix-систем*:\Program Files\Zabbix Agent 2\Custom Queries\PostgreSQL для систем Windows, где * - имя диска из переменной среды ProgramFiles |
Полный путь к каталогу, содержащему файлы .sql с пользовательскими запросами. |
|
| Plugins.PostgreSQL.CustomQueriesEnabled | no | false | Если задано, включает выполнение ключа элемента данных postgresql.custom.query. Если отключено, запросы не будут загружаться из пути каталога пользовательских запросов. |
|
| Plugins.PostgreSQL.Default.Database | no | База данных по умолчанию для подключения к PostgreSQL; используется, если значение не указано в ключе элемента данных или именованной сессии. | ||
| Plugins.PostgreSQL.Default.Password | no | Пароль по умолчанию для подключения к PostgreSQL; используется, если значение не указано в ключе элемента данных или именованной сессии. | ||
| Plugins.PostgreSQL.Default.TLSCAFile | no (yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full) |
Полный путь к файлу, содержащему сертификат(ы) CA верхнего уровня для проверки сертификата узла при зашифрованной связи между агентом 2 Zabbix и контролируемыми базами данных; используется, если значение не указано в именованной сессии. | ||
| Plugins.PostgreSQL.Default.TLSCertFile | no (yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full) |
Полный путь к файлу, содержащему сертификат PostgreSQL или цепочку сертификатов для зашифрованной связи между агентом 2 Zabbix и контролируемыми базами данных; используется, если значение не указано в именованной сессии. | ||
| Plugins.PostgreSQL.Default.TLSConnect | no | Тип шифрования для связи между агентом 2 Zabbix и контролируемыми базами данных; используется, если значение не указано в именованной сессии. Поддерживаемые значения: required - подключение с использованием TLS в качестве транспортного режима без проверки идентичности; verify_ca - подключение с использованием TLS и проверкой сертификата; verify_full - подключение с использованием TLS, проверкой сертификата и проверкой того, что идентичность базы данных (CN), указанная DBHost, совпадает с ее сертификатом. Неопределенный тип шифрования означает незашифрованное соединение. |
||
| Plugins.PostgreSQL.Default.TLSKeyFile | no (yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full) |
Полный путь к файлу, содержащему закрытый ключ PostgreSQL для зашифрованной связи между агентом 2 Zabbix и контролируемыми базами данных; используется, если значение не указано в именованной сессии. | ||
| Plugins.PostgreSQL.Default.Uri | no | URI по умолчанию для подключения к PostgreSQL; используется, если значение не указано в ключе элемента данных или именованной сессии. Не должен включать встроенные учетные данные (они будут проигнорированы). Должен соответствовать формату URI. Поддерживаемые схемы: tcp, unix.Примеры: tcp://127.0.0.1:5432tcp://localhostunix:/var/run/postgresql/.s.PGSQL.5432 |
||
| Plugins.PostgreSQL.Default.User | no | Имя пользователя по умолчанию для подключения к PostgreSQL; используется, если значение не указано в ключе элемента данных или именованной сессии. | ||
| Plugins.PostgreSQL.KeepAlive | no | 60-900 | 300 | Максимальное время ожидания (в секундах) перед закрытием неиспользуемых подключений плагина. |
| Plugins.PostgreSQL.Sessions.<SessionName>.CacheMode | no | prepare | Режим кэширования для подключения PostgreSQL. <SessionName> - задайте имя сессии для использования в ключах элементов данных. Поддерживаемые значения: prepare (по умолчанию) - создаст подготовленные выражения на сервере PostgreSQL; describe - будет использовать анонимное подготовленное выражение для описания выражения без создания выражения на сервере. Обратите внимание, что "describe" в первую очередь полезен, когда среда не позволяет использовать подготовленные выражения, например при работе через пул подключений, такой как PgBouncer. |
|
| Plugins.PostgreSQL.Sessions.<SessionName>.Database | no | База данных для подключения сессии. <SessionName> - задайте имя сессии для использования в ключах элементов данных. |
||
| Plugins.PostgreSQL.Sessions.<SessionName>.Password | no | Must match the password format. | Пароль для подключения сессии. <SessionName> - задайте имя сессии для использования в ключах элементов данных. |
|
| Plugins.PostgreSQL.Sessions.<SessionName>.TLSCAFile | no (yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSConnect is set to verify_ca or verify_full) |
Полный путь к файлу, содержащему сертификат(ы) CA верхнего уровня для проверки сертификата узла. <SessionName> - задайте имя сессии для использования в ключах элементов данных. |
||
| Plugins.PostgreSQL.Sessions.<SessionName>.TLSCertFile | yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSKeyFile is specified | Полный путь к файлу, содержащему сертификат PostgreSQL или цепочку сертификатов. <SessionName> - задайте имя сессии для использования в ключах элементов данных. |
||
| Plugins.PostgreSQL.Sessions.<SessionName>.TLSConnect | no | Тип шифрования для подключения PostgreSQL. <SessionName> - задайте имя сессии для использования в ключах элементов данных. Поддерживаемые значения: required - подключение с использованием TLS в качестве транспортного режима без проверки идентичности; verify_ca - подключение с использованием TLS и проверкой сертификата; verify_full - подключение с использованием TLS, проверкой сертификата и проверкой того, что идентичность базы данных (CN), указанная DBHost, совпадает с ее сертификатом. Неопределенный тип шифрования означает незашифрованное соединение. |
||
| Plugins.PostgreSQL.Sessions.<SessionName>.TLSKeyFile | yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSCertFile is specified | Полный путь к файлу, содержащему закрытый ключ PostgreSQL. <SessionName> - задайте имя сессии для использования в ключах элементов данных. |
||
| Plugins.PostgreSQL.Sessions.<SessionName>.Uri | no | Строка подключения именованной сессии. <SessionName> - задайте имя сессии для использования в ключах элементов данных. Не должен включать встроенные учетные данные (они будут проигнорированы). Должен соответствовать формату URI. Поддерживаемые схемы: tcp, unix.Примеры: tcp://127.0.0.1:5432tcp://localhostunix:/var/run/postgresql/.s.PGSQL.5432 |
||
| Plugins.PostgreSQL.Sessions.<SessionName>.User | no | Имя пользователя именованной сессии. <SessionName> - задайте имя сессии для использования в ключах элементов данных. |
||
| Plugins.PostgreSQL.System.Path | yes | Путь к исполняемому файлу плагина PostgreSQL. Пример использования: Plugins.PostgreSQL.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-postgresql |
||
| Plugins.PostgreSQL.Timeout | no | 1-30 | global timeout | Тайм-аут выполнения запроса (продолжительность ожидания завершения запроса в секундах перед его остановкой). |
См. также:
- Описание общих параметров конфигурации агента 2 Zabbix: Zabbix agent 2 (UNIX) / Zabbix agent 2 (Windows)
- Инструкции по настройке плагинов