pgexporter-cli
pgexporter-cli exists to control pgexporter, especially when pgexporter is running as a daemon.
Usage:
pgexporter-cli -c <config-file> [options] [command]
pgexporter-cli -h <host> -p <port> [options] [command]
pgexporter-cli -?
pgexporter-cli -Vpgexporter-cli -c <config-file> [options] [command]
pgexporter-cli -h <host> -p <port> [options] [command]
pgexporter-cli -?
pgexporter-cli -VCommands:
ping: Check ifpgexporteris alive.shutdown: Shutdownpgexporter.status: Status ofpgexporter.status details: Alias forstatus.reload: Reload the configuration.
NOTE
The notation standard used for describing usage can be found here.
Meta Options
Help
$ pgexporter-cli --help$ pgexporter-cli --helppgexporter-cli 0.7.0
Command line utility for pgexporter
USAGE:
pgexporter-cli -c <config-file> [options] <command>
pgexporter-cli -h <host> -p <port> [options] <command>
pgexporter-cli -?
pgexporter-cli -V
OPTIONS:
Usage:
pgexporter-cli [ -c CONFIG_FILE ] [ COMMAND ]
Options:
-c, --config CONFIG_FILE Set the path to the pgexporter.conf file
-h, --host HOST Set the host name
-p, --port PORT Set the port number
-U, --user USERNAME Set the user name
-P, --password PASSWORD Set the password
-L, --logfile FILE Set the log file
-v, --verbose Output text string of result
-V, --version Display version information
-F, --format text|json|raw Set the output format
-C, --compress none|gz|zstd|lz4|bz2 Compress the wire protocol
-E, --encrypt none|aes|aes256|aes192|aes128 Encrypt the wire protocol
-?, --help Display help
COMMANDS:
ping Check if pgexporter is alive
shutdown Shutdown pgexporter
status [details] Status of pgexporter, with optional details
conf <action> Manage the configuration, with one of subcommands:
- 'reload' to reload the configuration
- 'ls' to print the configurations used
- 'get' to obtain information about a runtime configuration value
- 'set' to modify a configuration value;
clear <what> Clear data, with:
- 'prometheus' to reset the Prometheus statisticspgexporter-cli 0.7.0
Command line utility for pgexporter
USAGE:
pgexporter-cli -c <config-file> [options] <command>
pgexporter-cli -h <host> -p <port> [options] <command>
pgexporter-cli -?
pgexporter-cli -V
OPTIONS:
Usage:
pgexporter-cli [ -c CONFIG_FILE ] [ COMMAND ]
Options:
-c, --config CONFIG_FILE Set the path to the pgexporter.conf file
-h, --host HOST Set the host name
-p, --port PORT Set the port number
-U, --user USERNAME Set the user name
-P, --password PASSWORD Set the password
-L, --logfile FILE Set the log file
-v, --verbose Output text string of result
-V, --version Display version information
-F, --format text|json|raw Set the output format
-C, --compress none|gz|zstd|lz4|bz2 Compress the wire protocol
-E, --encrypt none|aes|aes256|aes192|aes128 Encrypt the wire protocol
-?, --help Display help
COMMANDS:
ping Check if pgexporter is alive
shutdown Shutdown pgexporter
status [details] Status of pgexporter, with optional details
conf <action> Manage the configuration, with one of subcommands:
- 'reload' to reload the configuration
- 'ls' to print the configurations used
- 'get' to obtain information about a runtime configuration value
- 'set' to modify a configuration value;
clear <what> Clear data, with:
- 'prometheus' to reset the Prometheus statisticsVersion
$ pgexporter-cli --version
# or
$ pgexporter-cli -V$ pgexporter-cli --version
# or
$ pgexporter-cli -Vpgexporter-cli 0.7.0pgexporter-cli 0.7.0Commands
ping
Description: Checks if pgexporter is successfully running.
NOTE
It needs verbose flag to output anything.
$ pgexporter-cli ping # -c <config-file> [options] --verbose
# or
$ pgexporter-cli ping # -h <host> -p port [options] --verbose$ pgexporter-cli ping # -c <config-file> [options] --verbose
# or
$ pgexporter-cli ping # -h <host> -p port [options] --verbosepgexporter is running.pgexporter is running.pgexporter is not running.pgexporter is not running.shutdown
Description: Shutdown pgexporter.
$ pgexporter-cli shutdown # -c <config-file> [options]
# or
$ pgexporter-cli shutdown # -h <host> -p port [options]$ pgexporter-cli shutdown # -c <config-file> [options]
# or
$ pgexporter-cli shutdown # -h <host> -p port [options]status
Description: Provides status of the servers pgexporter is listening to for metrics.
$ pgexporter-cli status # -c <config-file> [options]
# or
$ pgexporter-cli status # -h <host> -p port [options]$ pgexporter-cli status # -c <config-file> [options]
# or
$ pgexporter-cli status # -h <host> -p port [options]Number of servers: 8
Server : own
Active : Yes
Server : v10
Active : No
Server : v11
Active : No
Server : v12
Active : No
Server : v13
Active : Yes
Server : v14
Active : No
Server : v15
Active : Yes
Server : v16beta2
Active : NoNumber of servers: 8
Server : own
Active : Yes
Server : v10
Active : No
Server : v11
Active : No
Server : v12
Active : No
Server : v13
Active : Yes
Server : v14
Active : No
Server : v15
Active : Yes
Server : v16beta2
Active : Nostatus details
Description: See status.
$ pgexporter-cli status details # -c <config-file> [options]
# or
$ pgexporter-cli status details # -h <host> -p port [options]$ pgexporter-cli status details # -c <config-file> [options]
# or
$ pgexporter-cli status details # -h <host> -p port [options]Number of servers: 8
Server : own
Active : Yes
Server : v10
Active : No
Server : v11
Active : No
Server : v12
Active : No
Server : v13
Active : Yes
Server : v14
Active : No
Server : v15
Active : Yes
Server : v16beta2
Active : NoNumber of servers: 8
Server : own
Active : Yes
Server : v10
Active : No
Server : v11
Active : No
Server : v12
Active : No
Server : v13
Active : Yes
Server : v14
Active : No
Server : v15
Active : Yes
Server : v16beta2
Active : Noconf reload
Description: Reload the configuration of pgexporter (in case of changes).
$ pgexporter-cli conf reload # -c <config-file> [options]$ pgexporter-cli conf reload # -c <config-file> [options]WARNING
conf reload can only be done in local connections.
Options
Config File
Description:
Specify the pgexporter.conf file.
$ pgexporter-cli -c <path-of-config-file> # [options] [command]
# or
$ pgexporter-cli --config <path-of-config-file> # [options] [command]$ pgexporter-cli -c <path-of-config-file> # [options] [command]
# or
$ pgexporter-cli --config <path-of-config-file> # [options] [command]# Assuming path to config is ./pgexporter.conf
$ pgexporter-cli -c ./pgexporter.conf # [options] [command]# Assuming path to config is ./pgexporter.conf
$ pgexporter-cli -c ./pgexporter.conf # [options] [command]Host
Description:
Specify the host of pgexporter.
$ pgexporter-cli -h <host> # -p <port> [options] [command]
# or
$ pgexporter-cli --host <host> # -p <port> [options] [command]$ pgexporter-cli -h <host> # -p <port> [options] [command]
# or
$ pgexporter-cli --host <host> # -p <port> [options] [command]# Assuming host is localhost
$ pgexporter-cli -h localhost # -p <port> [options] [command]
# or
# Assuming host is 127.0.0.1
$ pgexporter-cli -h 127.0.0.1 # -p <port> [options] [command]# Assuming host is localhost
$ pgexporter-cli -h localhost # -p <port> [options] [command]
# or
# Assuming host is 127.0.0.1
$ pgexporter-cli -h 127.0.0.1 # -p <port> [options] [command]Port
Description:
Speicfy the port of pgexporter.
$ pgexporter-cli -p <port> # -h <host> [options] [command]
# or
$ pgexporter-cli --port <port> # -h <host> [options] [command]$ pgexporter-cli -p <port> # -h <host> [options] [command]
# or
$ pgexporter-cli --port <port> # -h <host> [options] [command]# Assuming port is 8080
$ pgexporter-cli -p 8080 # -h <host> [options] [command]# Assuming port is 8080
$ pgexporter-cli -p 8080 # -h <host> [options] [command]NOTE
The port mentioned here is the port at which management is open.
Username
Description:
Username of the user trying to interact with pgexporter.
$ pgexporter-cli -U <username> # -P <password> [options] [command]
# or
$ pgexporter-cli --user <username> # -P <password> [options] [command]$ pgexporter-cli -U <username> # -P <password> [options] [command]
# or
$ pgexporter-cli --user <username> # -P <password> [options] [command]$ pgexporter-cli -U pgexporter # -P <password> [options] [command]$ pgexporter-cli -U pgexporter # -P <password> [options] [command]NOTE
If you do not provide your credentials in the arguments, you will be prompted to provide them later.
NOTE
Steps for registering a username and password to access pgexporter through pgexporter-cli can be viewed here.
Password
Description:
Password of the user trying to interact with pgexporter.
$ pgexporter-cli -P <password> # -U <username> [options] [command]
# or
$ pgexporter-cli --password <password> # --user <username> [options] [command]$ pgexporter-cli -P <password> # -U <username> [options] [command]
# or
$ pgexporter-cli --password <password> # --user <username> [options] [command]$ pgexporter-cli -P pgexporter # -U pgexporter [options] [command]$ pgexporter-cli -P pgexporter # -U pgexporter [options] [command]NOTE
If you do not provide your credentials in the arguments, you will be prompted to provide them later.
NOTE
Steps for registering a username and password to access pgexporter through pgexporter-cli can be viewed here.
Log File
Description:
Specify the log file for pgexporter_config.
$ pgexporter-cli -L <path-to-log-file> # -U <username> [options] [command]
# or
$ pgexporter-cli --logfile <path-to-log-file> # -U <username> [options] [command]$ pgexporter-cli -L <path-to-log-file> # -U <username> [options] [command]
# or
$ pgexporter-cli --logfile <path-to-log-file> # -U <username> [options] [command]# Assuming wanting a logfile ./log.out
$ pgexporter-cli -L ./log.out # -U <username> [options] [command]# Assuming wanting a logfile ./log.out
$ pgexporter-cli -L ./log.out # -U <username> [options] [command]Verbose
Description:
Outputs more verbose information.
$ pgexporter-cli -v # [options] [command]
# or
$ pgexporter-cli --verbose # [options] [command]$ pgexporter-cli -v # [options] [command]
# or
$ pgexporter-cli --verbose # [options] [command]