Plugin PostgreSQL

Panoramica

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

Si consiglia di specificarli in un file di configurazione separato (ad esempio postgresql.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 PostgreSQL è un plugin caricabile ed è disponibile e descritto in modo completo nel repository del plugin PostgreSQL.

Tutti i parametri sono opzionali, 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 forniti.
  • I valori supportano 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.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

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

Parameter Mandatory Range Default Description
Plugins.PostgreSQL.Default.CacheMode no prepare Modalità cache per la connessione PostgreSQL.
Valori supportati:
prepare (predefinito) - creerà statement preparati sul server PostgreSQL;
describe - utilizzerà lo statement preparato anonimo per descrivere uno statement senza crearne uno sul server.
Si noti che "describe" è utile soprattutto quando l'ambiente non consente statement preparati, ad esempio quando si usa un connection pooler come PgBouncer.
Plugins.PostgreSQL.CallTimeout no 1-30 global timeout Tempo massimo di attesa (in secondi) per il completamento di una richiesta.
Plugins.PostgreSQL.CustomQueriesPath no /usr/local/share/zabbix/custom-queries/postgreSQL per sistemi Unix

*:\Program Files\Zabbix Agent 2\Custom Queries\PostgreSQL per sistemi Windows, dove * è il nome dell'unità dalla variabile di ambiente ProgramFiles
Percorso completo di una directory contenente file .sql con query personalizzate.
Plugins.PostgreSQL.CustomQueriesEnabled no false Se impostato, abilita l'esecuzione della chiave item postgresql.custom.query. Se disabilitato, non verrà caricato alcun query dalla directory delle query personalizzate.
Plugins.PostgreSQL.Default.Database no Database predefinito per la connessione a PostgreSQL; usato se non viene specificato alcun valore in una chiave item o in una sessione denominata.
Plugins.PostgreSQL.Default.Password no Password predefinita per la connessione a PostgreSQL; usata se non viene specificato alcun valore in una chiave item o in una sessione denominata.
Plugins.PostgreSQL.Default.TLSCAFile no
(yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full)
Percorso completo di un file contenente il certificato della CA di livello superiore per la verifica del certificato del peer nelle comunicazioni cifrate tra Zabbix agent 2 e i database monitorati; usato se non viene specificato alcun valore in una sessione denominata.
Plugins.PostgreSQL.Default.TLSCertFile no
(yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full)
Percorso completo di un file contenente il certificato PostgreSQL o la catena di certificati per le comunicazioni cifrate tra Zabbix agent 2 e i database monitorati; usato se non viene specificato alcun valore in una sessione denominata.
Plugins.PostgreSQL.Default.TLSConnect no Tipo di cifratura per le comunicazioni tra Zabbix agent 2 e i database monitorati; usato se non viene specificato alcun valore in una sessione denominata.
Valori supportati:
required - connessione tramite TLS come modalità di trasporto senza controlli di identità;
verify_ca - connessione tramite TLS e verifica del certificato;
verify_full - connessione tramite TLS, verifica del certificato e verifica che l'identità del database (CN) specificata da DBHost corrisponda al suo certificato.
Un tipo di cifratura non definito indica una connessione non cifrata.
Plugins.PostgreSQL.Default.TLSKeyFile no
(yes, if Plugins.PostgreSQL.Default.TLSConnect is set to verify_ca or verify_full)
Percorso completo di un file contenente la chiave privata PostgreSQL per le comunicazioni cifrate tra Zabbix agent 2 e i database monitorati; usato se non viene specificato alcun valore in una sessione denominata.
Plugins.PostgreSQL.Default.Uri no URI predefinito per la connessione a PostgreSQL; usato se non viene specificato alcun valore in una chiave item o in una sessione denominata.

Non deve includere credenziali incorporate (verranno ignorate).
Deve corrispondere al formato URI.
Schemi supportati: tcp, unix.
Esempi: tcp://127.0.0.1:5432
tcp://localhost
unix:/var/run/postgresql/.s.PGSQL.5432
Plugins.PostgreSQL.Default.User no Nome utente predefinito per la connessione a PostgreSQL; usato se non viene specificato alcun valore in una chiave item o in una sessione denominata.
Plugins.PostgreSQL.KeepAlive no 60-900 300 Tempo massimo di attesa (in secondi) prima che le connessioni del plugin non utilizzate vengano chiuse.
Plugins.PostgreSQL.Sessions.<SessionName>.CacheMode no prepare Modalità cache per la connessione PostgreSQL.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Valori supportati:
prepare (predefinito) - creerà statement preparati sul server PostgreSQL;
describe - utilizzerà lo statement preparato anonimo per descrivere uno statement senza crearne uno sul server.
Si noti che "describe" è utile soprattutto quando l'ambiente non consente statement preparati, ad esempio quando si usa un connection pooler come PgBouncer.
Plugins.PostgreSQL.Sessions.<SessionName>.Database no Database per la connessione della sessione.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.PostgreSQL.Sessions.<SessionName>.Password no Must match the password format. Password per la connessione della sessione.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSCAFile no
(yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSConnect is set to verify_ca or verify_full)
Percorso completo di un file contenente il certificato della CA di livello superiore per la verifica del certificato del peer.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSCertFile yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSKeyFile is specified Percorso completo di un file contenente il certificato PostgreSQL o la catena di certificati.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSConnect no Tipo di cifratura per la connessione PostgreSQL.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.

Valori supportati:
required - connessione tramite TLS come modalità di trasporto senza controlli di identità;
verify_ca - connessione tramite TLS e verifica del certificato;
verify_full - connessione tramite TLS, verifica del certificato e verifica che l'identità del database (CN) specificata da DBHost corrisponda al suo certificato.
Un tipo di cifratura non definito indica una connessione non cifrata.
Plugins.PostgreSQL.Sessions.<SessionName>.TLSKeyFile yes, if Plugins.PostgreSQL.Sessions.<SessionName>.TLSCertFile is specified Percorso completo di un file contenente la chiave privata PostgreSQL.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.PostgreSQL.Sessions.<SessionName>.Uri no Stringa di connessione di una sessione denominata.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.

Non deve includere credenziali incorporate (verranno ignorate).
Deve corrispondere al formato URI.
Schemi supportati: tcp, unix.
Esempi: tcp://127.0.0.1:5432
tcp://localhost
unix:/var/run/postgresql/.s.PGSQL.5432
Plugins.PostgreSQL.Sessions.<SessionName>.User no Nome utente della sessione denominata.
<SessionName> - definisce il nome di una sessione da usare nelle chiavi item.
Plugins.PostgreSQL.System.Path yes Percorso dell'eseguibile del plugin PostgreSQL.
Esempio di utilizzo: Plugins.PostgreSQL.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-postgresql
Plugins.PostgreSQL.Timeout no 1-30 global timeout Timeout di esecuzione della richiesta (la durata, in secondi, da attendere per il completamento di una richiesta prima di interromperla).

Vedi anche: