1.\" $OpenBSD: relayctl.8,v 1.26 2009/10/22 15:02:12 sobrado Exp $ 2.\" 3.\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: October 22 2009 $ 18.Dt RELAYCTL 8 19.Os 20.Sh NAME 21.Nm relayctl 22.Nd control the relay daemon 23.Sh SYNOPSIS 24.Nm 25.Ar command 26.Op Ar argument ... 27.Sh DESCRIPTION 28The 29.Nm 30program controls the 31.Xr relayd 8 32daemon. 33.Pp 34The following commands are available: 35.Bl -tag -width Ds 36.It Cm host disable Op Ar name | id 37Disable a host. 38Treat it as though it were always down. 39.It Cm host enable Op Ar name | id 40Enable the host. 41Start checking its health again. 42.It Cm monitor 43Continuously report any changes in the host checking engine and the 44.Xr pf 4 45engine. 46.It Cm poll 47Schedule an immediate check of all hosts. 48.It Cm redirect disable Op Ar name | id 49Disable a redirection. 50If it has 51.Xr pf 4 52redirection rules installed, remove them. 53Mark the redirection's main table and \(en 54if applicable \(en disable the backup table as well. 55.It Cm redirect enable Op Ar name | id 56Enable a redirection. 57Mark the redirection's main table and \(en if applicable \(en enable 58the backup table as well. 59.It Cm reload 60Reload the configuration file. 61.It Cm show hosts 62Show detailed status of hosts and tables. 63It will also print the last error for failed host checks; 64see the 65.Sx ERRORS 66section below. 67.It Cm show redirects 68Show detailed status of redirections including the current and average 69access statistics. 70The statistics will be updated every minute. 71Redirections using the 72.Ic sticky-address 73option will count the number of sticky states, 74not the total number of redirected connections. 75.It Cm show relays 76Show detailed status of relays including the current and average 77access statistics. 78The statistics will be updated every minute. 79.It Cm show routers 80Show detailed status of routers including the configured network 81routes. 82.It Cm show sessions 83Dump the complete list of running relay sessions. 84.It Cm show summary 85Display a list of all relays, redirections, routers, tables, and hosts. 86.It Cm table disable Op Ar name | id 87Disable a table. 88Consider all hosts disabled. 89If it is a main table of a redirection which has a non-empty backup table, 90swap the contents of the 91.Xr pf 4 92table with those of the backup table. 93.It Cm table enable Op Ar name | id 94Enable a table. 95Start doing checks for all hosts that aren't individually disabled 96again. 97.El 98.Sh FILES 99.Bl -tag -width "/var/run/relayd.sockXX" -compact 100.It /var/run/relayd.sock 101.Ux Ns -domain 102socket used for communication with 103.Xr relayd 8 . 104.El 105.Sh ERRORS 106If a host is down and a previous check failed, 107.Nm 108will display the last error in the output of the 109.Cm show hosts 110command. 111This is especially useful for debugging server or configuration failures. 112The following errors will be reported: 113.Pp 114.Bl -tag -width Ds -compact 115.It Em none 116No specific error was reported by the check engine. 117.Pp 118.It Em aborted 119All checks were aborted by an external event, like a configuration reload. 120.Pp 121.It Em interval timeout 122The check did not finish in the configured time of an interval. 123This can happen if there are too many hosts that have to be checked by 124.Xr relayd 8 125and can be avoided by increasing the global 126.Ic interval 127option in 128.Xr relayd.conf 5 . 129.Pp 130.It Em icmp read timeout 131.It Em ssl read timeout 132.It Em tcp read timeout 133The check failed because the remote host did not send a reply within 134the configured timeout. 135.Pp 136.It Em icmp write timeout 137.It Em ssl write timeout 138.It Em tcp write timeout 139.It Em ssl connect timeout 140.It Em tcp connect timeout 141The check failed because 142.Xr relayd 8 143was not ready to send the request within the configured timeout. 144.Pp 145.It Em ssl connect error 146.It Em ssl read error 147.It Em ssl write error 148.It Em tcp connect error 149.It Em tcp read failed 150.It Em tcp write failed 151An I/O error occurred. 152This indicates that 153.Xr relayd 8 154was running low on resources, 155file descriptors, or was too busy to run the request. 156It can also indicate that an SSL/TCP protocol error occurred or that the 157connection was unexpectedly aborted. 158.Pp 159.It Em ssl connect failed 160.It Em tcp connect failed 161The check failed because the protocol handshake did not succeed in 162opening a stateful connection with the remote host. 163.Pp 164.It Em script failed 165The external script executed by the check did not return a valid return code. 166.Pp 167.It Em send/expect failed 168The payload data returned by the remote host did not match the 169expected pattern. 170.Pp 171.It Em http code malformed 172.It Em http digest malformed 173The remote host did not return a valid HTTP header or body. 174.Pp 175.It Em http code mismatch 176The remote host did not return a matching HTTP error code. 177This may indicate a real server problem (a server error, the page was 178not found, permission was denied) or a configuration error. 179For example, it is a very common mistake that 180.Xr relayd 8 181was configured to expect a 182HTTP 200 OK 183status but the host is returning a 184HTTP 302 Found 185redirection. 186See 187.Xr relayd.conf 5 188for more information on validating the HTTP return code. 189.Pp 190.It Em http digest mismatch 191The remote host did not return the expected content and the computed 192digest was different to the configured value. 193See 194.Xr relayd.conf 5 195for more information on validating the digest. 196.El 197.Sh SEE ALSO 198.Xr relayd 8 199.Sh HISTORY 200The 201.Nm 202program, formerly known as 203.Ic hoststatectl , 204first appeared in 205.Ox 4.1 . 206It was renamed to 207.Nm 208in 209.Ox 4.3 . 210