---
name: "wd_cli"
section: "1"
platform: "linux"
package: "pgpool2"
version: "4.6.1-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/wd_cli"
---

# wd\_cli(1)

Watchdog Command Line Interface (CLI) utility for the external health-check system integration.

## NAME

wd\_cli - Watchdog Command Line Interface (CLI) utility for the external health-check system integration.

## SYNOPSIS

**wd\_cli** \[*operation*...\] \[*node search option*...\] \[*option*...\]

## DESCRIPTION

**wd\_cli** Provides a convenient and easy to use interface to interact with watchdog and perform health check related node operations.

## OPERATIONS

**-i**\
 **--info**

Get the node status for node(s) based on node search criteria

**-I** *NEW\_STATUS*\
 **--inform=***NEW\_STATUS*

Update the watchdog node status. Allowed values are DEAD and ALIVE

## NODE SEARCH OPTIONS

- **-a** **--all**

  Select all nodes (only available with --info operation)

- **-n** *WATCHDOG\_NODE\_ID* **--node-id=***WATCHDOG\_NODE\_ID*

  Select watchdog node by node\_id.

- **-N** *NODE\_NAME* **--node-name=***NODE\_NAME*

  Select watchdog node by name.

- **-H** *HOSTNAME* **--node-host=***HOSTNAME*

  Select watchdog node by hostname.

- **-P** *PORT\_NO* **--node-port=***PORT\_NO*

  Select watchdog node by port number.

## OPTIONS

- **-k** *KEY* **--auth-key=***KEY*

  Watchdog auth key. Specifying auth-key over rides the pgpool.conf-\>wd\_authkey value.

- **-f** *CONFIG\_FILE* **--config-file=***CONFIG\_FILE*

  Specifies the pgpool.conf file.

- **-s** *SOCKET\_DIR* **--socket-dir=***SOCKET\_DIR*

  Path to the watchdog IPC socket directory. Specifying socket-dir over rides the pgpool.conf-\>wd\_ipc\_socket\_dir value.

- **-p** *PORT\_NO* **--ipc-port=***PORT\_NO*

  Port number of watchdog IPC socket. Specifying ipc-port over rides the pgpool.conf-\>wd\_port value.

- **-m** *message\_string* **--message=***message\_string*

  Optional message string to be passed to Pgpool-II along with the node status.

- **-v** **--verbose**

  Enable verbose messages.

- **-V** **--version**

  Prints version information.

- **-d** **--debug**

  Enable debug output.

- **-h** **--help**

  Prints the help for wd\_cli.

## EXAMPLE

When some external health-check system is configured to monitor the health of Pgpool-II cluster and it detects a node failure. wd\_cli utility can be used to pass this information to Pgpool-II cluster so that it can take the appropriate actions.

```
    #inform Pgpool-II about node named RN-110 failure
    wd_cli --inform DEAD -N 'RN-110' -p 9001 -m 'Pgpool node with name RN-110 is not reachable'
```

```
    #inform Pgpool-II about node-id 10 failure
    wd_cli --inform DEAD -n 10 -m 'Pgpool node with ID 10 is not responding'
```

Similarly to inform Pgpool-II about the node is alive again.

```
    #inform Pgpool-II about node-id 10 re-joining
    wd_cli --inform ALIVE -n 10 -m 'Pgpool node with ID 10 is reachable again'
```

wd\_cli can also be used to get the current status of cluster nodes.

```
    wd_cli -f simple_conf/watchdog/pgpool_wd1.conf --info -v --all
	Total Watchdog nodes configured for lifecheck:  2
	*****************
	Node ID:           0
	Node Status code   4
	Node Status:       LEADER
	Node Name:         localhost:9991 Linux localhost.localdomain
	Node Host:         localhost
	Node WD Port:      9001
	Node Pgpool Port:  9991
	Node ID:           1
	Node Status code   7
	Node Status:       STANDBY
	Node Name:         localhost:9992 Linux localhost.localdomain
	Node Host:         localhost
	Node WD Port:      9002
	Node Pgpool Port:  9992
```
