HAProxy Enterprise Documentation 2.5r1

show cli sockets

Display information about all CLI sockets defined in the configuration.

Description

HAProxy'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

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

Single socket configuration

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

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

Querying an HAProxy Enterprise 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.

$ echo "show cli sockets" | \
   sudo socat stdio unix-connect:/var/run/hapee-2.5/hapee-lb.sock
# socket lvl processes
unix@/var/run/hapee-2.5/hapee-lb.sock admin all
sockpair@6 admin 1

Multiple socket configuration:

HAProxy Enterprise 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:

global
  stats socket       /var/run/hapee-2.5/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 an HAProxy Enterprise domain or network socket with the string show cli sockets will produce a list of all sockets in the running configuration.

$ echo "show cli sockets" | \
   sudo socat stdio unix-connect:/var/run/hapee-2.5/hapee-lb.sock
# socket lvl processes
unix@/var/run/hapee-2.5/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.5/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, user

Access level of the socket

all

processes upon which the socket is bound, either numbers separated by commas, or 'all'.

See also


Next up

show env