Note: XCONLY: The following description applies only to Postgres-XC.
pgxc_monitor has the following synopsis.
pgxc_monitor [ option ]
pgxc_monitor is a Postgres-XC utility to test if the target node is running.
The target node is specified by option.
If the target node is running, it exits with exit code zero. If not, it exits with non-zero exit code.
If invalid options are specified, it exits with exit code 3.
Type of node type to test. Specify gtm as nodetype for gtm and gtm_proxy and node as nodetype for a Coordinator or a Datanode.
Hostname of the test target.
Node name to use when testing gtm or gtm_proxy. Default value is pgxc_monitor.
Specifies the port number to test target.
Specifies the database username to connect as.
Specifies the database name to connect to. Default is "postgres".
Quiet mode. Supress messages as much as possible.
Verbose mode. Prints as many messages as possible.
Show help about pgxc_monitor command line arguments, and exit.
When monitoring Coordinator or Datanode, -p and -h options can be supplied using .pgpass file. If you use non-default target database name, and username, as well as password, they must also be supplied using .pgpass file.
If password is needed, it must also be supplied using .pgpass file too.
Monitoring Coordinator and Datanode uses system(3) function. Therefore,you should not use set-userid bit or set-groupid bit. Also, because this uses psql command, psql must be in your PATH.
The username and database name can be specified via command line options too. If password is needed, it must be supplied via .pgpass file though.
If invalid parameters are given, error message will be printed even if -q is specified.