Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ucla-cs!zen!ucbvax!hara.DEC.COM!spa From: spa@hara.DEC.COM (Salvador Pinto Abreu) Newsgroups: comp.windows.x Subject: xrload.shar (part 1 of 6) Message-ID: <8708131123.AA04340@decwrl.dec.com> Date: Thu, 13-Aug-87 06:42:00 EDT Article-I.D.: decwrl.8708131123.AA04340 Posted: Thu Aug 13 06:42:00 1987 Date-Received: Sat, 15-Aug-87 08:31:54 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 246 This is xrload, an X to{ol,y} to display the load average of the various machines on a LAN. To check it out, unshar and type "make" followed by "xrload -X". Note: I had to split this up because of mailer problems. ---------------------------------------------------------------------- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh MANIFEST <<'END_OF_MANIFEST' X File Name Archive # Description X----------------------------------------------------------- X MANIFEST 1 This shipping list X Makefile 2 X README 1 X back.bitmap 1 X down.bitmap 1 X draw-hand.c 1 X dump-stats.c 1 X event-loop.c 3 X get-stats.c 4 X globals.c 3 X hostname.c 3 X init.c 6 X recalc-windows.c 2 X show-stats.c 2 X update-sys.c 2 X xrload.1x 5 X xrload.c 1 END_OF_MANIFEST if test 624 -ne `wc -c README <<'END_OF_README' XThis is xrload(1), a tool that serves a function similar to that of Xxload(1) but monitors (part of) a TCP/IP network using a single Xwindow. This avoids having a bunch of xload windows, each with a local Xand a remote associated process, and all the resource waste this would Ximply. X XTo try it, just type: X % make X % xrload -X X XNote: I had to split this up because I'm having problems with the mailer. X--- XUUCP: ...{mcvax,inria}!inesc!hara.unl.psi!spa PSI/VMS: PSI%+26805010310::SPA XARPA: lisvax.dec!unlai!spa@decwrl.dec.com Phone: + 351 1 295 31 56 X XSnail: Salvador Pinto Abreu X Dept. of Computer Science, Universidade Nova de Lisboa X 2825 Monte Caparica, Portugal END_OF_README if test 664 -ne `wc -c back.bitmap <<'END_OF_back.bitmap' X#define back_width 32 X#define back_height 32 X#define back_x_hot 16 X#define back_y_hot 15 Xstatic short back_bits[] = { X 0xffff, 0xffff, 0x1fff, 0xfff0, X 0xe3ff, 0xff8f, 0x1cff, 0xfe70, X 0x027f, 0xfc80, 0x01bf, 0xfb00, X 0x005f, 0xf400, 0x004f, 0xe400, X 0x002f, 0xe800, 0x0017, 0xd000, X 0x0017, 0xd000, 0x0017, 0xd000, X 0x000b, 0xa000, 0x000b, 0xa000, X 0x800b, 0xa003, 0x800b, 0xa003, X 0x800b, 0xa003, 0x000b, 0xa000, X 0x000b, 0xa000, 0x0017, 0xd000, X 0xc017, 0xd007, 0x2017, 0xd008, X 0xd02f, 0xe817, 0xe84f, 0xe42f, X 0xf45f, 0xf45f, 0xfbbf, 0xfbbf, X 0xfc7f, 0xfc7f, 0xffff, 0xffff, X 0xffff, 0xffff, 0xffff, 0xffff, X 0xffff, 0xffff, 0xffff, 0xffff}; END_OF_back.bitmap if test 679 -ne `wc -c down.bitmap <<'END_OF_down.bitmap' X#define down_width 32 X#define down_height 32 X#define down_x_hot 16 X#define down_y_hot 15 Xstatic short down_bits[] = { X 0xffff, 0xffff, 0x1fff, 0xfff0, X 0xe3ff, 0xff8f, 0x1cff, 0xfe70, X 0x827f, 0xfc83, 0x81bf, 0xfb03, X 0x805f, 0xf403, 0x804f, 0xe403, X 0xf82f, 0xe83f, 0xf817, 0xd03f, X 0x8017, 0xd003, 0x8017, 0xd003, X 0x870b, 0xe0e2, 0x890b, 0xa123, X 0x890b, 0xa122, 0x870b, 0xa0e2, X 0x890b, 0xa022, 0xa90b, 0xa02a, X 0x890b, 0xa022, 0xc017, 0xd007, X 0xc017, 0xd007, 0x2017, 0xd008, X 0xd02f, 0xe817, 0xe84f, 0xe42f, X 0xf45f, 0xf45f, 0xfbbf, 0xfbbf, X 0xfc7f, 0xfc7f, 0xffff, 0xffff, X 0xffff, 0xffff, 0xffff, 0xffff, X 0xffff, 0xffff, 0xffff, 0xffff}; END_OF_down.bitmap if test 679 -ne `wc -c dump-stats.c <<'END_OF_dump-stats.c' X/**************************************************************************/ X/* */ X/* Dump system stats (debugging) */ X/* */ X/**************************************************************************/ X X#include "xrload.h" X Xvoid dump_stats (stats, nsys) X sys_stat *stats; X int nsys; X{ X register int i; X X for (i=0; stats[i].sys_name[0]; i++) { X if (stats[i].state == UP) { X printf ("%s %s %d %f %f %f\n", X stats[i].sys_name, stats[i].how_long, X stats[i].users, X stats[i].load_average[0], X stats[i].load_average[1], X stats[i].load_average[2]); X } X else { X printf ("%s %s\n", X stats[i].sys_name, stats[i].how_long); X } X } X putchar ('\n'); X} END_OF_dump-stats.c if test 741 -ne `wc -c xrload.c <<'END_OF_xrload.c' X/**************************************************************************/ X/* */ X/* Main Program */ X/* */ X/**************************************************************************/ X X#include "xrload.h" X Xmain (argc, argv) X int argc; X char *argv[]; X{ X extern void initialize (); X extern void doit (); X X initialize (argc, argv); X doit (); X} X Xusage () X{ X fprintf (stderr, X"usage: xrload [-cols ] [-delay ] [-same] [-rv] [-all] [-X]\n"); X fprintf (stderr, X" [-fn ] [-bw ] [-spacing ]\n"); X fprintf (stderr, X" [=] [:]\n"); X exit (1); X} END_OF_xrload.c if test 721 -ne `wc -c