Plugin PostgreSQL

Visão geral

Os parâmetros de configuração permitem personalizar o comportamento do plugin PostgreSQL.

Recomenda-se especificá-los em seu próprio arquivo de configuração (por exemplo, postgresql.conf), em vez de no arquivo de configuração do agent 2. Em seguida, use a diretiva Include para incluir esse arquivo na configuração do Zabbix agent 2.

O plugin PostgreSQL é um plugin carregável e está disponível, com descrição completa, no repositório do plugin PostgreSQL.

Todos os parâmetros são opcionais, a menos que seja explicitamente indicado que o parâmetro é obrigatório.

Observe que:

  • Os valores padrão refletem os padrões do processo, não os valores nos arquivos de configuração fornecidos.
  • Os valores suportam variáveis de ambiente;
  • O Zabbix suporta arquivos de configuração somente em codificação UTF-8, sem BOM.
  • Comentários que começam com "#" são suportados apenas no início da linha.

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

Opções

Parameter Description
-V --version Exibe a versão do plugin e as informações de licença.
-h --help Exibe as informações de ajuda (atalho).
-t, --test <item key> Inicia o plugin para teste (a configuração do plugin é ignorada).

Parâmetros

Parameter Mandatory Range Default Description
Plugins.PostgreSQL.Default.CacheMode no prepare Modo de cache para a conexão PostgreSQL.
Valores suportados:
prepare (padrão) - criará instruções preparadas no server PostgreSQL;
describe - usará a instrução preparada anônima para descrever uma instrução sem criar uma instrução no server.
Observe que "describe" é útil principalmente quando o ambiente não permite instruções preparadas, como ao usar um pooler de conexões como o PgBouncer.
Plugins.PostgreSQL.CallTimeout no 1-30 global timeout Tempo máximo de espera (em segundos) para que uma solicitação seja concluída.
Plugins.PostgreSQL.CustomQueriesPath no /usr/local/share/zabbix/custom-queries/postgreSQL para sistemas Unix

*:\Program Files\Zabbix Agent 2\Custom Queries\PostgreSQL para sistemas Windows, onde * é o nome da unidade da variável de ambiente ProgramFiles
Caminho completo de um diretório que contém arquivos .sql com consultas personalizadas.
Plugins.PostgreSQL.CustomQueriesEnabled no false Se definido, habilita a execução da chave de item postgresql.custom.query. Se desabilitado, nenhuma consulta será carregada do caminho do diretório de consultas personalizadas.
Plugins.PostgreSQL.Default.Database no Banco de dados padrão para conexão com o PostgreSQL; usado se nenhum valor for especificado em uma chave de item ou sessão nomeada.
Plugins.PostgreSQL.Default.Password no Senha padrão para conexão com o PostgreSQL; usada se nenhum valor for especificado em uma chave de item ou sessão nomeada.
Plugins.PostgreSQL.Default.TLSCAFile no
(yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full)
Caminho completo de um arquivo que contém o certificado da(s) CA(s) de nível superior para verificação do certificado do par em comunicações criptografadas entre o Zabbix agent 2 e os bancos de dados monitorados; usado se nenhum valor for especificado em uma sessão nomeada.
Plugins.PostgreSQL.Default.TLSCertFile no
(yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full)
Caminho completo de um arquivo que contém o certificado do PostgreSQL ou a cadeia de certificados para comunicações criptografadas entre o Zabbix agent 2 e os bancos de dados monitorados; usado se nenhum valor for especificado em uma sessão nomeada.
Plugins.PostgreSQL.Default.TLSConnect no Tipo de criptografia para comunicações entre o Zabbix agent 2 e os bancos de dados monitorados; usado se nenhum valor for especificado em uma sessão nomeada.
Valores suportados:
required - conecta usando TLS como modo de transporte sem verificações de identidade;
verify_ca - conecta usando TLS e verifica o certificado;
verify_full - conecta usando TLS, verifica o certificado e verifica se a identidade do banco de dados (CN) especificada por DBHost corresponde ao certificado.
Tipo de criptografia indefinido significa conexão sem criptografia.
Plugins.PostgreSQL.Default.TLSKeyFile no
(yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full)
Caminho completo de um arquivo que contém a chave privada do PostgreSQL para comunicações criptografadas entre o Zabbix agent 2 e os bancos de dados monitorados; usado se nenhum valor for especificado em uma sessão nomeada.
Plugins.PostgreSQL.Default.Uri no URI padrão para conexão com o PostgreSQL; usado se nenhum valor for especificado em uma chave de item ou sessão nomeada.

Não deve incluir credenciais embutidas (elas serão ignoradas).
Deve corresponder ao formato de URI.
Esquemas suportados: tcp, unix.
Exemplos: tcp://127.0.0.1:5432
tcp://localhost
unix:/var/run/postgresql/.s.PGSQL.5432
Plugins.PostgreSQL.Default.User no Nome de usuário padrão para conexão com o PostgreSQL; usado se nenhum valor for especificado em uma chave de item ou sessão nomeada.
Plugins.PostgreSQL.KeepAlive no 60-900 300 Tempo máximo de espera (em segundos) antes que conexões não utilizadas do plugin sejam fechadas.
Plugins.PostgreSQL.Sessions.<SessionName>.CacheMode no prepare Modo de cache para a conexão PostgreSQL.
<SessionName> - define o nome de uma sessão para uso em chaves de item.
Valores suportados:
prepare (padrão) - criará instruções preparadas no server PostgreSQL;
describe - usará a instrução preparada anônima para descrever uma instrução sem criar uma instrução no server.
Observe que "describe" é útil principalmente quando o ambiente não permite instruções preparadas, como ao usar um pooler de conexões como o PgBouncer.
Plugins.PostgreSQL.Sessions.<SessionName>.Database no Banco de dados para a conexão da sessão.
<SessionName> - define o nome de uma sessão para uso em chaves de item.
Plugins.PostgreSQL.Sessions.<SessionName>.Password no Must match the password format. Senha para a conexão da sessão.
<SessionName> - define o nome de uma sessão para uso em chaves de item.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSCAFile no
(yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSConnect is set to verify_ca or verify_full)
Caminho completo de um arquivo que contém o certificado da(s) CA(s) de nível superior para verificação do certificado do par.
<SessionName> - define o nome de uma sessão para uso em chaves de item.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSCertFile yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSKeyFile is specified Caminho completo de um arquivo que contém o certificado ou a cadeia de certificados do PostgreSQL.
<SessionName> - define o nome de uma sessão para uso em chaves de item.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSConnect no Tipo de criptografia para a conexão PostgreSQL.
<SessionName> - define o nome de uma sessão para uso em chaves de item.

Valores suportados:
required - conecta usando TLS como modo de transporte sem verificações de identidade;
verify_ca - conecta usando TLS e verifica o certificado;
verify_full - conecta usando TLS, verifica o certificado e verifica se a identidade do banco de dados (CN) especificada por DBHost corresponde ao certificado.
Tipo de criptografia indefinido significa conexão sem criptografia.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSKeyFile yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSCertFile is specified Caminho completo de um arquivo que contém a chave privada do PostgreSQL.
<SessionName> - define o nome de uma sessão para uso em chaves de item.
Plugins.PostgreSQL.Sessions.<SessionName>.Uri no String de conexão de uma sessão nomeada.
<SessionName> - define o nome de uma sessão para uso em chaves de item.

Não deve incluir credenciais embutidas (elas serão ignoradas).
Deve corresponder ao formato de URI.
Esquemas suportados: tcp, unix.
Exemplos: tcp://127.0.0.1:5432
tcp://localhost
unix:/var/run/postgresql/.s.PGSQL.5432
Plugins.PostgreSQL.Sessions.<SessionName>.User no Nome de usuário da sessão nomeada.
<SessionName> - define o nome de uma sessão para uso em chaves de item.
Plugins.PostgreSQL.System.Path yes Caminho para o executável do plugin PostgreSQL.
Exemplo de uso: Plugins.PostgreSQL.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-postgresql
Plugins.PostgreSQL.Timeout no 1-30 global timeout Tempo limite de execução da solicitação (a duração, em segundos, para aguardar a conclusão de uma solicitação antes de encerrá-la).

Veja também: