Skip to content

Instantly share code, notes, and snippets.

@bzed
Created February 1, 2022 17:28
Show Gist options
  • Save bzed/22e1d00d89f3f91dd6e196319a2ac671 to your computer and use it in GitHub Desktop.
Save bzed/22e1d00d89f3f91dd6e196319a2ac671 to your computer and use it in GitHub Desktop.
haproxyctl wtf
:~# /usr/bin/haproxyctl help
usage: /usr/bin/haproxyctl <argument>
where <argument> can be:
start : start haproxy unless it is already running
stop : stop an existing haproxy
restart : immediately shutdown and restart
reload : gracefully terminate existing connections, reload /etc/haproxy/haproxy.cfg
status : is haproxy running? on what ports per lsof?
configcheck : check /etc/haproxy/haproxy.cfg
nagios : nagios-friendly status for running process and listener
cloudkick : cloudkick.com-friendly status and metric for connected users
show health : show status of all frontends and backend servers
show backends : show status of backend pools of servers
enable all <server> : re-enable a server previously in maint mode on multiple backends
disable all <server> : disable a server from every backend it exists
enable all EXCEPT <server> : like 'enable all', but re-enables every backend except for <server>
disable all EXCEPT <server> : like 'disable all', but disables every backend except for <server>
clear counters : clear max statistics counters (add 'all' for all counters)
help : this message
prompt : toggle interactive mode with prompt
quit : disconnect
show info : report information about the running process
show stat : report counters for each proxy and server
show errors : report last request and response errors for each proxy
show sess [id] : report the list of current sessions or dump this session
get weight : report a server's current weight
set weight : change a server's weight
set timeout : change a timeout setting
disable server : set a server in maintenance mode
enable server : re-enable a server that was previously in maintenance mode
version : version of this script
:~# /usr/bin/haproxyctl show asdasdasd
help : this message
prompt : toggle interactive mode with prompt
quit : disconnect
show tls-keys [id|*]: show tls keys references or dump tls ticket keys when id specified
set ssl tls-key [id|keyfile] <tlskey>: set the next TLS key for the <id> or <keyfile> listener to <tlskey>
add ssl crt-list <filename> <certfile> [options] : add a line <certfile> to a crt-list <filename>
del ssl crt-list <filename> <certfile[:line]> : delete a line <certfile> in a crt-list <filename>
show ssl crt-list [-n] [<filename>] : show the list of crt-lists or the content of a crt-list <filename>
new ssl cert <certfile> : create a new certificate file to be used in a crt-list or a directory
set ssl cert <certfile> <payload> : replace a certificate file
commit ssl cert <certfile> : commit a certificate file
abort ssl cert <certfile> : abort a transaction for a certificate file
del ssl cert <certfile> : delete an unused certificate file
show ssl cert [<certfile>] : display the SSL certificates used in memory, or the details of a <certfile>
set maxconn global : change the per-process maxconn setting
set rate-limit : change a rate limiting value
set severity-output [none|number|string] : set presence of severity level in feedback information
set timeout : change a timeout setting
show env [var] : dump environment variables known to the process
show cli sockets : dump list of cli sockets
show cli level : display the level of the current CLI session
show fd [num] : dump list of file descriptors in use
show activity : show per-thread activity stats (for support/developers)
operator : lower the level of the current CLI session to operator
user : lower the level of the current CLI session to user
clear counters : clear max statistics counters (add 'all' for all counters)
show info : report information about the running process [desc|json|typed]*
show stat : report counters for each proxy and server [desc|json|typed]*
show schema json : report schema used for stats
show sess [id] : report the list of current sessions or dump this session
shutdown session : kill a specific session
shutdown sessions server : kill sessions on a server
disable agent : disable agent checks (use 'set server' instead)
disable health : disable health checks (use 'set server' instead)
disable server : disable a server for maintenance (use 'set server' instead)
enable agent : enable agent checks (use 'set server' instead)
enable health : enable health checks (use 'set server' instead)
enable server : enable a disabled server (use 'set server' instead)
set maxconn server : change a server's maxconn setting
set server : change a server's state, weight or address
get weight : report a server's current weight
set weight : change a server's weight (deprecated)
show startup-logs : report logs emitted during HAProxy startup
clear table : remove an entry from a table
set table [id] : update or create a table entry's data
show table [id]: report table usage stats or dump this table's contents
add acl : add acl entry
clear acl <id> : clear the content of this acl
del acl : delete acl entry
get acl : report the patterns matching a sample for an ACL
show acl [id] : report available acls or dump an acl's contents
add map : add map entry
clear map <id> : clear the content of this map
del map : delete map entry
get map : report the keys and values matching a sample for a map
set map : modify map entry
show map [id] : report available maps or dump a map's contents
show events [<sink>] : show event sink state
show threads : show some threads debugging information
show peers [peers section]: dump some information about all the peers or this peers section
disable frontend : temporarily disable specific frontend
enable frontend : re-enable specific frontend
set maxconn frontend : change a frontend's maxconn setting
show servers conn [id]: dump server connections status (for backend <id>)
show servers state [id]: dump volatile server information (for backend <id>)
show backend : list backends in the current running config
shutdown frontend : stop a specific frontend
set dynamic-cookie-key backend : change a backend secret key for dynamic cookies
enable dynamic-cookie backend : enable dynamic cookies on a specific backend
disable dynamic-cookie backend : disable dynamic cookies on a specific backend
show errors : report last request and response errors for each proxy
show resolvers [id]: dumps counters from all resolvers section and
associated name servers
show pools : report information about the memory pools usage
show profiling : show CPU profiling options
set profiling : enable/disable CPU profiling
show cache : show cache status
trace <module> [cmd [args...]] : manage live tracing
show trace [<module>] : show live tracing state
:~#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment