From 2c25abc55a40e06e837780532cdef47512d49647 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Wed, 29 Jul 1987 11:01:32 +0000 Subject: Accomodate new server stats --- clients/zstat/zstat.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'clients/zstat') diff --git a/clients/zstat/zstat.c b/clients/zstat/zstat.c index 5b05beb..c6b4db1 100644 --- a/clients/zstat/zstat.c +++ b/clients/zstat/zstat.c @@ -35,6 +35,12 @@ char *head[20] = { "Current server =", "Size:", "Machine type:" }; +char *srv_head[20] = { + "Current server version =", + "Packets handled:", + "Uptime:", + "Server states:", +}; int serveronly = 0,hmonly = 0; u_short hm_port,srv_port; @@ -215,11 +221,14 @@ hm_stat(host,server) srv_stat(host) char *host; { - int sock,ret; + char *line[20],*mp; + int sock,i,nf,ret; struct hostent *hp; struct sockaddr_in sin; ZNotice_t notice; ZPacket_t packet; + long runtime; + struct tm *tim; bzero(&sin,sizeof(struct sockaddr_in)); @@ -264,8 +273,29 @@ srv_stat(host) exit(1); } - printf("%s\n",notice.z_message); + mp = notice.z_message; + for (nf=0;mptm_yday, + tim->tm_hour, + tim->tm_min, + tim->tm_sec); + } else if (i == 3) { + printf("%s\n",srv_head[i]); + printf("%s\n",line[i]); + } else printf("%s\n",line[i]); + } close(sock); } -- cgit v1.2.3