MINOR: stats: indicate it when a server is down due to resolution

The server's state is now "MAINT (resolution)" just like we also have
"MAINT (via x/y)" when servers are tracked. The HTML stats page reports
"resolution" in the checks field similarly to what is done for the "via"
entry.
This commit is contained in:
Willy Tarreau 2016-11-09 14:45:51 +01:00
parent e659973bfe
commit b96dd28477
2 changed files with 8 additions and 3 deletions

View File

@ -933,7 +933,7 @@ S (Servers).
16. wredis [..BS]: number of times a request was redispatched to another
server. The server value counts the number of times that server was
switched away from.
17. status [LFBS]: status (UP/DOWN/NOLB/MAINT/MAINT(via)...)
17. status [LFBS]: status (UP/DOWN/NOLB/MAINT/MAINT(via)/MAINT(resolution)...)
18. weight [..BS]: total weight (backend), server weight (server)
19. act [..BS]: number of active servers (backend), server is active (server)
20. bck [..BS]: number of backup servers (backend), server is backup (server)

View File

@ -3799,7 +3799,10 @@ static int stats_dump_fields_html(struct chunk *out, const struct field *stats,
stats[ST_F_BCK].u.u32 ? "Y" : "-");
/* check failures: unique, fatal, down time */
if (stats[ST_F_CHKFAIL].type) {
if (strcmp(field_str(stats, ST_F_STATUS), "MAINT (resolution)") == 0) {
chunk_appendf(out, "<td class=ac colspan=3>resolution</td>");
}
else if (stats[ST_F_CHKFAIL].type) {
chunk_appendf(out, "<td><u>%lld", (long long)stats[ST_F_CHKFAIL].u.u64);
if (stats[ST_F_HANAFAIL].type)
@ -4286,7 +4289,9 @@ int stats_fill_sv_stats(struct proxy *px, struct server *sv, int flags,
/* status */
fld_status = chunk_newstr(out);
if (sv->admin & SRV_ADMF_IMAINT)
if (sv->admin & SRV_ADMF_RMAINT)
chunk_appendf(out, "MAINT (resolution)");
else if (sv->admin & SRV_ADMF_IMAINT)
chunk_appendf(out, "MAINT (via %s/%s)", via->proxy->id, via->id);
else if (sv->admin & SRV_ADMF_MAINT)
chunk_appendf(out, "MAINT");