Reference

show cli sockets

Display information about all CLI sockets defined in the configuration.

Description Jump to heading

The load balancer’s runtime API supports Unix domain sockets, as well as IPv4 and IPv6 network sockets for interprocess communication. Any of these sockets can be configured with different levels of administrative access, from unrestricted admin to more limited operator and user roles.

Querying the runtime API with show cli sockets will display information about any and all sockets available.

Examples Jump to heading

In the following examples, both configuration directives and query output are shown.

Single socket configuration Jump to heading

Example configuration file section with a single socket configured with admin access:

haproxy
global
stats socket /var/run/hapee-2.9/hapee-lb.sock user hapee-lb group hapee mode 660 level admin expose-fd listeners
stats timeout 2m
haproxy
global
stats socket /var/run/hapee-2.9/hapee-lb.sock user hapee-lb group hapee mode 660 level admin expose-fd listeners
stats timeout 2m

Querying the load balancer’s domain or network socket with the string show cli sockets will produce a list of all sockets in the running configuration, a single socket in this case.

nix
echo "show cli sockets" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show cli sockets" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
# socket lvl processes
unix@/var/run/hapee-2.9/hapee-lb.sock admin all
sockpair@6 admin 1
output
text
# socket lvl processes
unix@/var/run/hapee-2.9/hapee-lb.sock admin all
sockpair@6 admin 1

Multiple socket configuration: Jump to heading

The load balancer supports having multiple domain and network sockets in a single configuration, with one or more levels of access.

Example configuration file section with multiple sockets configured with admin, operator and user access levels:

haproxy
global
stats socket /var/run/hapee-2.9/hapee-lb.sock user hapee-lb group hapee mode 660 level admin expose-fd listeners
stats socket ipv4@127.0.0.1:9999 level operator expose-fd listeners
stats socket ipv6@0:0:0:0:0:0:0:1:9966 level user expose-fd listeners
stats timeout 2m
haproxy
global
stats socket /var/run/hapee-2.9/hapee-lb.sock user hapee-lb group hapee mode 660 level admin expose-fd listeners
stats socket ipv4@127.0.0.1:9999 level operator expose-fd listeners
stats socket ipv6@0:0:0:0:0:0:0:1:9966 level user expose-fd listeners
stats timeout 2m

Querying the load balancer’s domain or network socket with the string show cli sockets will produce a list of all sockets in the running configuration.

nix
echo "show cli sockets" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show cli sockets" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
# socket lvl processes
unix@/var/run/hapee-2.9/hapee-lb.sock admin all
ipv4@127.0.0.1:9999 operator all
ipv6@[::1]:9966 user all
sockpair@7 admin 1
output
text
# socket lvl processes
unix@/var/run/hapee-2.9/hapee-lb.sock admin all
ipv4@127.0.0.1:9999 operator all
ipv6@[::1]:9966 user all
sockpair@7 admin 1
Output Description
unix@/var/run/hapee-2.9/hapee-lb.sock: Address of Unix domain socket
ipv4@127.0.0.1:9999 Address and port of IPv4 (localhost) socket
ipv6@[::1]:9966 Address and port of IPv6 (localhost) socket
admin operator
all processes upon which the socket is bound

sockpair@ refers to the file descriptor of a connected unix socket or of a socketpair. During a connection, the backend creates a pair of connected sockets, and passes one of them over the file descriptor.

See also Jump to heading

Do you have any suggestions on how we can improve the content of this page?