Skip to content

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 -V
pgexporter-cli -c <config-file> [options] [command]
pgexporter-cli -h <host> -p <port> [options] [command]
pgexporter-cli -?
pgexporter-cli -V

Commands:

NOTE

The notation standard used for describing usage can be found here.

Meta Options

Help

sh
$ pgexporter-cli --help
$ pgexporter-cli --help
txt
pgexporter-cli 0.5.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:
  -c, --config <config-file>  Set the path to the pgexporter.conf file [default: /etc/pgexporter/pgexporter.conf]
  -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
  -?, --help                  Display help
  -V, --version               Display version information

COMMANDS:
  is-alive                    Is pgexporter alive
  stop                        Stop pgexporter
  status                      Status of pgexporter
  details                     Alias for `status`
  reload                      Reload the configuration
  reset                       Reset the Prometheus statistics

pgexporter: https://pgexporter.github.io/
Report bugs: https://github.com/pgexporter/pgexporter/issues
pgexporter-cli 0.5.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:
  -c, --config <config-file>  Set the path to the pgexporter.conf file [default: /etc/pgexporter/pgexporter.conf]
  -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
  -?, --help                  Display help
  -V, --version               Display version information

COMMANDS:
  is-alive                    Is pgexporter alive
  stop                        Stop pgexporter
  status                      Status of pgexporter
  details                     Alias for `status`
  reload                      Reload the configuration
  reset                       Reset the Prometheus statistics

pgexporter: https://pgexporter.github.io/
Report bugs: https://github.com/pgexporter/pgexporter/issues

Version

sh
$ pgexporter-cli --version
# or
$ pgexporter-cli -V
$ pgexporter-cli --version
# or
$ pgexporter-cli -V
txt
pgexporter-cli 0.5.0
pgexporter-cli 0.5.0

Commands

is-alive

Description: Checks if pgexporter is successfully running.

NOTE

It needs verbose flag to output anything.

sh
$ pgexporter-cli is-alive # -c <config-file> [options] --verbose
# or
$ pgexporter-cli is-alive # -h <host> -p port [options] --verbose
$ pgexporter-cli is-alive # -c <config-file> [options] --verbose
# or
$ pgexporter-cli is-alive # -h <host> -p port [options] --verbose
txt
pgexporter is running.
pgexporter is running.
txt
pgexporter is not running.
pgexporter is not running.

stop

Description: Stop pgexporter.

sh
$ pgexporter-cli stop # -c <config-file> [options]
# or
$ pgexporter-cli stop # -h <host> -p port [options]
$ pgexporter-cli stop # -c <config-file> [options]
# or
$ pgexporter-cli stop # -h <host> -p port [options]

status

Description: Provides status of the servers pgexporter is listening to for metrics.

sh
$ 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]
txt
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         : No
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         : No

details

Description: See status.

sh
$ pgexporter-cli details # -c <config-file> [options]
# or
$ pgexporter-cli details # -h <host> -p port [options]
$ pgexporter-cli details # -c <config-file> [options]
# or
$ pgexporter-cli details # -h <host> -p port [options]
txt
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         : No
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         : No

reload

Description: Reload the configuration of pgexporter (in case of changes).

sh
$ pgexporter-cli reload # -c <config-file> [options]
$ pgexporter-cli reload # -c <config-file> [options]

WARNING

reload can only be done in local connections.

Options

Config File

Description:

Specify the pgexporter.conf file.

sh
$ 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]
sh
# 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.

sh
$ 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]
sh
# 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.

sh
$ 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]
sh
# 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.

sh
$ 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]
sh
$ 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.

sh
$ 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]
sh
$ 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.

sh
$ 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]
sh
# 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.

sh
$ pgexporter-cli -v  # [options] [command]
# or
$ pgexporter-cli --verbose # [options] [command]
$ pgexporter-cli -v  # [options] [command]
# or
$ pgexporter-cli --verbose # [options] [command]