]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stats: do not report "via" on tracking servers in maintenance
authorWilly Tarreau <w@1wt.eu>
Thu, 28 Nov 2013 09:50:06 +0000 (10:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Nov 2013 10:52:11 +0000 (11:52 +0100)
When a server tracks another one, its state on the stats page always reports
"via xx/yy". That's convenient to know what server to act on to change the
state. But it is also possible to force the tracking server itself into
maintenance mode and in this case we should not report "via xx/yy" because
the tracked server can't do anything to change the server's state, which
is confusing. In practice there is nothing wrong in leaving it as-is,
except that it's highly misleading when looking at the stats page.

Note that we only change the HTML output, not the CSV one. The states are
already different : "MAINT" vs "MAINT(via)" and we expect anyone coding a
monitoring system based on the CSV output to know the differences between
all possible states.

src/dumpstats.c

index b721c5874d08190bf8ea7bec1bb14fc81e26c429..2cfd39a9494ff3d21c90a9952f1f6ec726aa4b29 100644 (file)
@@ -2349,10 +2349,16 @@ static int stats_dump_sv_stats(struct stream_interface *si, struct proxy *px, in
                                      ref->observe ? "/Health Analyses" : "",
                                      ref->counters.down_trans, human_time(srv_downtime(sv), 1));
                }
-               else if (sv != ref)
-                       chunk_appendf(&trash,
-                                     "<td class=ac colspan=3><a class=lfsb href=\"#%s/%s\">via %s/%s<a></td>",
-                                     ref->proxy->id, ref->id, ref->proxy->id, ref->id);
+               else if (sv != ref) {
+                       if (sv->state & SRV_MAINTAIN)
+                               chunk_appendf(&trash,
+                                             "<td class=ac colspan=3><a class=lfsb href=\"#%s/%s\"><a></td>",
+                                             ref->proxy->id, ref->id);
+                       else
+                               chunk_appendf(&trash,
+                                             "<td class=ac colspan=3><a class=lfsb href=\"#%s/%s\">via %s/%s<a></td>",
+                                             ref->proxy->id, ref->id, ref->proxy->id, ref->id);
+               }
                else
                        chunk_appendf(&trash, "<td colspan=3></td>");