Hi Martin,
Le 25/07/2016 à 15:08, Martin Šindler a écrit :
Hi,
I hope, that I'm writing the correct person, if not please forward this
question to correct one.
We are try to implement HAProxy and we are performing some tests, one of
our requirement is automatic management of HAProxy during server
maintenance, this need reading status of servers and put nods to
appropriate state.
I'm faced to problem regarding some missing information in documentation
(maybe this information is present but i can't find it).
_Problem:_
when i prompt command: *show servers state Test-cluster*
It returns me output which can be reformated to someting like:
be_id : 5
be_name : Test-cluster
srv_id : 2
srv_name : clstrnod2
srv_addr : 192.168.10.6
srv_op_state : *2*
srv_admin_state : 0
srv_uweight : 8
srv_iweight : 10
srv_time_since_last_change : 264872
srv_check_status : 9
srv_check_result : 3
srv_check_health : 7
srv_check_state : 6
srv_agent_state : 22
bk_f_forced_id : 0
srv_f_forced_id : 0
I found in documentation that for example :
srv_op_state: Server operational state (UP/DOWN/...).
But there is no clue to realize what means INTEGER value 2. I have this
problem for all other status values as well. Could you please help me to
find documentation where is written what INTEGER values represents?
If Willy is OK with the patch, here is a documentation update to include
the different values found in the source code.
--
Cyril Bonté
>From 093584f88e01c585e7a7cf71e771f6f0a69100ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cyril=20Bont=C3=A9?= <[email protected]>
Date: Mon, 25 Jul 2016 22:18:27 +0200
Subject: [PATCH] DOC: stats: provide state details for show servers state
Add the state values to the documentation instead of adding a reference to the
source code.
---
doc/management.txt | 60 +++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 55 insertions(+), 5 deletions(-)
diff --git a/doc/management.txt b/doc/management.txt
index caf7eb0..74c5a41 100644
--- a/doc/management.txt
+++ b/doc/management.txt
@@ -1848,20 +1848,70 @@ show servers state [<backend>]
srv_name: Server label.
srv_addr: Server IP address.
srv_op_state: Server operational state (UP/DOWN/...).
- In source code: SRV_ST_*.
+ 0 = SRV_ST_STOPPED
+ The server is down.
+ 1 = SRV_ST_STARTING
+ The server is warming up (up but
+ throttled).
+ 2 = SRV_ST_RUNNING
+ The server is fully up.
+ 3 = SRV_ST_STOPPING
+ The server is up but soft-stopping
+ (eg: 404).
srv_admin_state: Server administrative state (MAINT/DRAIN/...).
- In source code: SRV_ADMF_*.
+ The state is actually a mask of values :
+ 0x01 = SRV_ADMF_FMAINT
+ The server was explicitly forced into
+ maintenance.
+ 0x02 = SRV_ADMF_IMAINT
+ The server has inherited the maintenance
+ status from a tracked server.
+ 0x04 = SRV_ADMF_CMAINT
+ The server is in maintenance because of
+ the configuration.
+ 0x08 = SRV_ADMF_FDRAIN
+ The server was explicitly forced into
+ drain state.
+ 0x10 = SRV_ADMF_IDRAIN
+ The server has inherited the drain status
+ from a tracked server.
srv_uweight: User visible server's weight.
srv_iweight: Server's initial weight.
srv_time_since_last_change: Time since last operational change.
srv_check_status: Last health check status.
srv_check_result: Last check result (FAILED/PASSED/...).
- In source code: CHK_RES_*.
+ 0 = CHK_RES_UNKNOWN
+ Initialized to this by default.
+ 1 = CHK_RES_NEUTRAL
+ Valid check but no status information.
+ 2 = CHK_RES_FAILED
+ Check failed.
+ 3 = CHK_RES_PASSED
+ Check succeeded and server is fully up
+ again.
+ 4 = CHK_RES_CONDPASS
+ Check reports the server doesn't want new
+ sessions.
srv_check_health: Checks rise / fall current counter.
srv_check_state: State of the check (ENABLED/PAUSED/...).
- In source code: CHK_ST_*.
+ The state is actually a mask of values :
+ 0x01 = CHK_ST_INPROGRESS
+ A check is currently running.
+ 0x02 = CHK_ST_CONFIGURED
+ This check is configured and may be
+ enabled.
+ 0x04 = CHK_ST_ENABLED
+ This check is currently administratively
+ enabled.
+ 0x08 = CHK_ST_PAUSED
+ Checks are paused because of maintenance
+ (health only).
srv_agent_state: State of the agent check (ENABLED/PAUSED/...).
- In source code: CHK_ST_*.
+ This state uses the same mask values as
+ "srv_check_state", adding this specific one :
+ 0x10 = CHK_ST_AGENT
+ Check is an agent check (otherwise it's a
+ health check).
bk_f_forced_id: Flag to know if the backend ID is forced by
configuration.
srv_f_forced_id: Flag to know if the server's ID is forced by
--
2.8.1