]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: indicate it when a server is down due to resolution
authorWilly Tarreau <w@1wt.eu>
Wed, 9 Nov 2016 13:45:51 +0000 (14:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 9 Nov 2016 14:30:47 +0000 (15:30 +0100)
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.

doc/management.txt
src/dumpstats.c

index 4aaed2e7958a5bb3e41e87593a5bf256c37c5f20..b5e041a0bd6fe154de529ab5231b5f4ded5507e0 100644 (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)
index 8d43ce559cf83479cd8f1bb79a1c9f88ad9f1a51..d6db29a53b3f32c3fb4122a805700a4e53d6ed4c 100644 (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");