[5873] in Athena Bugs
netstat misses some stats (from comp.bugs.4bsd)
daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Tue Aug 28 10:27:40 1990
Date: Tue, 28 Aug 90 10:27:27 -0400
From: Jonathan I. Kamens <jik@PIT-MANAGER.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
Cc: jik@PIT-MANAGER.MIT.EDU
In article <KATSU.90Aug21132218@sran14.sra.co.jp>, katsu@sra.co.jp (WATANABE Katsuhiro) writes:
|>
|> # Sorry for my poor English.
|>
|> Index: ucb/netstat/if.c 4.3BSD
|>
|> Description:
|> "netstat 10" prints a banner each 21 lines. It shows accumlated
|> statistics from system start up time(not periodic status) after every
|> banner, and then sleeps 10sec(in this case). So, you cannot get 21th
|> statistics (one between 200sec and 210sec).
|> I don't know whether it is a bug or not. But I think it is improper.
|>
|> For your reference.....
|> "vmstat 10", "iostat 10" and "netstat 10" all print system internal
|> statistics continuously, and print banner each 19/19/21 lines. However
|> only netstat prints accumlative information after each banner. Vmstat
|> and iostat print system status from init only once at the very first.
|>
|> Fix:
|> *IF* you agree with me that it is improper, here is a patch.
|>
|> *** if.c.orig Tue Aug 21 02:27:57 1990
|> --- if.c Tue Aug 21 03:03:31 1990
|> ***************
|> *** 207,216 ****
|> off = (off_t) ifnet.if_next;
|> }
|> lastif = ip;
|> - banner:
|> - printf(" input %-6.6s output ", interesting->ift_name);
|> - if (lastif - iftot > 0)
|> - printf(" input (Total) output ");
|> for (ip = iftot; ip < iftot + MAXIF; ip++) {
|> ip->ift_ip = 0;
|> ip->ift_ie = 0;
|> --- 207,212 ----
|> ***************
|> *** 218,223 ****
|> --- 214,223 ----
|> ip->ift_oe = 0;
|> ip->ift_co = 0;
|> }
|> + banner:
|> + printf(" input %-6.6s output ", interesting->ift_name);
|> + if (lastif - iftot > 0)
|> + printf(" input (Total) output ");
|> putchar('\n');
|> printf("%-7.7s %-5.5s %-7.7s %-5.5s %-5.5s ",
|> "packets", "errs", "packets", "errs", "colls");
|>
|> ----____----____
|> WATANABE Katsuhiro Software Research Associates, Inc. Japan.
|> Not execute, but evaluate.
Jonathan Kamens USnail:
MIT Project Athena 11 Ashford Terrace
jik@Athena.MIT.EDU Allston, MA 02134
Office: 617-253-8495 Home: 617-782-0710