uustatus - by Ed Carp

Changes for 1.2.d:

Lots of little bug fixes (credits in mailpak-1.3/README.first).  Cleaned
up the CPS I/O algorithm.

Changes for 1.2.c:

File transfers less than XFERTIME seconds (defined in uustatus.h)
are not used in throughput calculations.

Changes for 1.2.a, 1.2.b:

Fixed CPS display - also fixed "-i" display.

Changes for 1.2:

Lots of little cleanups.  Made startup a lot faster by doing a seek to
"almost" the end of the logfile before doing the tail.  Uustatus now
displays I/O in characters-per-second (instead of the "NEXT TRY" field).
The "-i" flag has also been added.

Changes for version 1.1.f:

Under certain circumstances, the uucico log files may disappear, causing a core
dump when attempting to read these files.  This has been fixed.  This only
occurs when uustatus is running and the uucico log file disappears, then a
conversation is attempted.

Also works on AIX (tested on the PS/2, but should work for the RT and Rios).

Changes for version 1.1.a:

Fixed minor bugs - (1) XENIX now properly works, thanks to Sandy,
and (2) the Makefile was generously supplied by Robert J. Granvin.

Changes for version 1.1:

uustatus now provides a realtime display of the uucico log file as the
conversation is taking place (much like "tail -f" does, but it doesn't
scroll the screen).  This only works for the first system that uustatus
finds that is engaging in a conversation.  An asterisk is placed by the
status of the system to note that fact.

uustatus now displays the number of input and output files for each system.

If there does not exist a status file for a system, the system exists in the
Systems file, and there are files waiting to be transferred to that system,
uustatus will create a dummy status file for that system.

If a system is currently engaged in a conversation, uustatus will display
the status of the system in reverse video.

There is now a #define for displaying system status on systems that 
currently display WRONG TIME TO CALL messages.

Thanks to the following people for their suggestions and advice.  If y'all
don't see all of your suggestions implemented, please be patient.

Doug Blair
Gordon Moffett
Johan Vromans
Robert J. Granvin
Sandy Zelkovitz


Introduction

HDB UUCP may be a dream to some, but for me it can be a real pain,
keeping up with everything that's happening on my system.  This simple
(relatively) program dynamically displays the status of your UUCP
connections for you, without you having to cd into all of those
pesky directories.  It's also faster than uustat -m, and it's
real-time!

The best part about this mish-mash, however, is dirent.h.  I liked the
BSD/XENIX directory routines a lot, but didn't have them on my System V
box.  So, I hacked up a couple of routines that work just as well.
opendir(), closedir(), and readdir() are all that are supported, but that
was (and still is) enough for most system programming applications.

BTW, these routines are supported on most systems as of version 1.1.f.

I also have a little gadget that will search your path for a program -
handy if you can get to a program (execute it), but need to know where the
dumb thing is, and don't have the time to waste with "find `echo $PATH|tr ...
stuff.  It's also MUCH faster, and it's included FREE!

Compiling (you can also hack & use the Makefile):

1.	cc -s -o uustatus uustatus.c -lcurses -ltermcap -O
	(or whatever libraries your system needs to support curses).
	cc -s -o findpath findpath.c -O

2.	chown uucp uustatus;chmod 4755 uustatus


Docs:
	The manpage source is in uustatus.1.  I used the -man macro
	package, so it should work on anyone's system.  If you make
	changes to the manpage, you can regenerate the docs by running
	"makedocs".


Customization:

	There are a number of tuneable parameters in uustatus.h
	that you can play with.

/* #define WTTC */
If you want to display status on systems that have this status posted,
uncomment this define.

#define STATUS "/usr/spool/uucp/.Status"
This is where HDB UUCP puts its status files.  This should not be changed.

#define SYSTEMS "/usr/lib/uucp/Systems"
This is where the Systems file resides.  It must be readable by the owner
of uustatus.

#define UUCICO "/usr/spool/uucp/.Log/uucico"
This is where the uucico log files live.

#define LOCKFILE "/usr/spool/uucp/LCK..%s"
This is where the lock files reside.  Don't touch this, either...

#define WORKFILE "/usr/spool/uucp/%s"
This is another one of those "don't touch me" parameters...

#define EXPDAYS 14 /* connections older than X days will not be displayed */
In this example, UUCP connections older than 14 days will not be displayed,
regardless of their status.

#define LOGON NO /* log expired systems? */
If you want to log everything that goes on, set this to YES.  Generally
useless except for debugging.

#define LOGFILE "/tmp/uuexp.log"
This is where the log output goes.

#define WAITMSG "WAIT"
Standard wait message.

#define BWAITMSG "    " /* blank wait msg string */
This must be the same length as the WAITMSG string (unless you want your screen
to wind up looking strange).

#define LLIMIT LINES-5
This is how many lines of data we can display on the screen.  Generally
a no-no to touch.

#define FLIMIT 50 /* over this many files for site, we quit - must be < 100 */
When we scan the directories for work, we don't want to eat up too many
system resources if we have a large directory with lots of stuff in it (not
too uncommon for a large news feed), so after we read FLIMIT file names, we
quit that directory and indicate that we have over that many files.
I set mine to 50, bt you can use a smaller number if your system is very
I/O bound (like you're running XENIX on an XT with a 65ms hard drive).

#define UUCPOWN "uucp"
#define UUCPGRP "uucp"
These should be set to "uucp".  These are used to create the status files
if they do not exist.

#define SLEEPTIME 10 /* time to sleep between samples */
Time to sleep between samples.  If you have a fast system with caching,
you might want to up this to make it more real-time.  If nothing ever
happens on your system and you want to leave this up in a window, you
might want to set it to something like 30 or 60.


That's it!  Enjoy...and please remember -- if you make any changes or
enhancements, please let me know (context diffs are OK).

No warranty expressed or implied.  I have tried as best I could to make sure
there are no bugs, but you know how that goes...at least it doesn't do
anything but read files...

Enhancements:

	Well, a sorted display of systems would be nice...Any other
	suggestions?
----------------------------------- cut here -----------------------------------
           Ed Carp	N7EKG/5 (28.3-28.5)	erc@puzzle!khijol
           Austin,  Tx; (home) (512) 445-2044
           Snail Mail:  1800 E. Stassney  #1205
                        Austin, Tx  78744
