Sending UDP commands to Liberator

Liberator includes a UDP command-line tool that enables you to send it UDP messages to reset peer connections after failover, change the verbosity of log messages, and schedule a shutdown of Liberator.

For information on the messages supported by Liberator’s UDP interface, see UDP commands.

Enabling Liberator’s UDP socket

Liberator’s UDP socket is disabled by default. To enable it, follow the steps below:

  1. Set the port number for Liberator’s UDP socket:

    global_config/overrides/servers/Liberator/etc/rttpd.conf
    udp-port       10002
  2. [Optional] Bind Liberator’s UDP socket to a single network interface:

    global_config/overrides/servers/Liberator/etc/rttpd.conf
    udp-interface  127.0.0.1
  3. Restart Liberator:

    ./dfw start Liberator

For more information on the configuration items udp-interface and udp-port, see UDP configuration.

Sending a UDP message to Liberator

Use the udpsend utility, included with Liberator, to send UDP messages to Liberator.

udpsend

Issues a UDP command to Liberator.

The udpsend utility is located in the Liberator’s bin directory.

Syntax: udpsend [-s <server-ip>] [-p <server-port>] <message>

Parameter Type Default Description

server-ip

integer

127.0.01

[optional] The IP address of the machine to which the UDP message is to be sent. This must be an IP address, not a host name, and must match the IP address specified for Liberator’s optional configuration item udp-interface (if specified).

server-port

integer

10001

[optional] Port on which the Liberator listens for UDP messages. This must match the port number specified in the udp-port option in the Liberator’s rttpd.conf file.

message

string

Message to send. The message can include spaces. Any quotation marks in the message must be escaped to prevent the shell’s interpreter from stripping them.

Example: udpsend -s lib1.example.com -p 10001 shutdown 10 \"Shutdown initiated\"

Note that the quotation marks in the UDP message above have been escaped (\) to prevent the shell’s interpreter from stripping them.

For more information on the syntax of individual UDP messages, see UDP commands.


See also: