[comp.mail.uucp] Would you find this program useful?

david@dhw68k.cts.com (David H. Wolfskill) (04/14/89)

If you maintain smail/pathalias files, the following may be of interest
to you.  Otherwise, please feel free to skip the rest of this posting.

In spite of some opinions to the contrary :-), I have been trying to do
my best to ensure that this site handles email as well as possible.

I use smail 2.5; I also use pathalias (and feed it the entire contents
of the files sent out in comp.mail.maps, as well as some supplementary
files of my own devising).

The pathalias connection data for the local area is such that a change
in one site would be likely to be reflected in substantial changes to
the output of pathalias.  Therefore, when I re-ran pathalias, I would
want to find out if the new pathalias output was "reasonable" (by
whatever measure seemed appropriate).

At first, I would run pathalias so its output (as reformatted for smail)
would be in a "holding file," then do a "diff -c1" between the previous
and new such files.  This gets very tedious very quickly, and I really
don't have time for such things.

A few months ago, I finally became sufficiently frustrated with the
situation that I decided to actually... write a program!  :-)

At this point, I will excerpt some of the documentation from the front
of the source file to describe what it does:

/*
 *	Program to list statistics, some of which may be of interest,
 *	regarding the output of "pathalias," as well as do a basic
 *	"reality check" on that output.

 *	This version can read the pathalias output either in the
 *	original order, or either of the 2 rotations:

 *	"pathalias":	<cost>	<destination>	<path>
 *	"smail":	<destination>	<path>	<cost>
 *	unknown:	<path>	<cost>	<destination>

 *	smail likes the second order, so the stdout of this program
 *	is the same information in "smail" order (regardless of the
 *	order in which stdin is).  This program may thus be used in
 *	place of the "sed" segment of the "pathproc" pipeline that is
 *	distributed with smail.

 *	To facilitate its use in that application, the report the
 *	program generates comes out on stderr.

 */

To show what it does, I'll feed this to "pathalias -i -c":

dhw68k = dhw68k.cts.com
dhw68k	zardoz(DIRECT+FAST), spsd(DIRECT+FAST), crash(EVENING/3)
crash = cts.com
crash	loral(DIRECT), telesoft(HOURLY)
spsd	bergy(DIRECT+LOW), zardoz(DIRECT+FAST+5), csun(DEMAND+FAST)
zardoz	sunkist(HOURLY), uci-ics(DIRECT)
csun	sdsu(DEDICATED), polyslo(DEDICATED), <talaris>(WEEKLY)
marge	cleo(LOCAL), dhw68k(WEEKLY+LOW), kosman(DIRECT+HIGH)

to get:

0	dhw68k	%s
30000000	marge	marge!%s
30000195	kosman	marge!kosman!%s
30000025	cleo	marge!cleo!%s
600	crash	crash!%s
1100	telesoft	crash!telesoft!%s
800	loral	crash!loral!%s
600	cts.com	crash!%s
120	spsd	spsd!%s
340	csun	spsd!csun!%s
30340	talaris	spsd!csun!talaris!%s
435	polyslo	spsd!csun!polyslo!%s
435	sdsu	spsd!csun!sdsu!%s
325	bergy	spsd!bergy!%s
120	zardoz	zardoz!%s
320	uci-ics	zardoz!uci-ics!%s
620	sunkist	zardoz!sunkist!%s
0	dhw68k.cts.com	%s

Now, I'll feed the above to the program I'm talking about to get:

[stderr first]

 Adj              Total         Total   #Hops        Cost
Site       #Dest  #Hops          Cost   /Dest       /Dest
TOTALS        18     30      90036375    1.67  5002020.83
crash          4      6          3100    1.50      775.00
dhw68k         2      0             0    0.00        0.00
spsd           6     14         31995    2.33     5332.50
zardoz         3      5          1060    1.67      353.33

 *** WARNING! Bogus "neighbor" sites follow! ***
marge          3      5      90000220    1.67 30000073.33

 Adj               #Hops       --- Pathlength Distribution ---
Site       #Dest   /Dest    0    1    2    3    4    5    6    7    8    9   10+
TOTALS        18    1.67    2    5    8    3    0    0    0    0    0    0    0
crash          4    1.50    0    2    2    0    0    0    0    0    0    0    0
dhw68k         2    0.00    2    0    0    0    0    0    0    0    0    0    0
spsd           6    2.33    0    1    2    3    0    0    0    0    0    0    0
zardoz         3    1.67    0    1    2    0    0    0    0    0    0    0    0

 *** WARNING! Bogus "neighbor" sites follow! ***
marge          3    1.67    0    1    2    0    0    0    0    0    0    0    0

[and now stdout]

dhw68k	%s	0
marge	marge!%s	30000000
kosman	marge!kosman!%s	30000195
cleo	marge!cleo!%s	30000025
crash	crash!%s	600
telesoft	crash!telesoft!%s	1100
loral	crash!loral!%s	800
cts.com	crash!%s	600
spsd	spsd!%s	120
csun	spsd!csun!%s	340
talaris	spsd!csun!talaris!%s	30340
polyslo	spsd!csun!polyslo!%s	435
sdsu	spsd!csun!sdsu!%s	435
bergy	spsd!bergy!%s	325
zardoz	zardoz!%s	120
uci-ics	zardoz!uci-ics!%s	320
sunkist	zardoz!sunkist!%s	620
dhw68k.cts.com	%s	0


OK, sorry to have been so long-winded(?)....

Does the above seem (potentially) useful to you?  Could it be made more
so?  Can you think of a good name for the program that does this?

For whatever it's worth, I've given copies away to a couple of other
folks; one reported that it ran fine at his installation (which is,
shall we say, on a very different type of machine); the other reported
some problems, but I never was real clear on what they were (that was on
a VAX running VMS).

If there is sufficient interest, I will (of course!) summarize -- and if
I get a good enough name for the beastie, I'll even send it off to
Brandon for inclusion in comp.sources.misc.  (I'm willing to consider
additional distribution methods if asked.)

If you're reading this far, thank you -- and please let me know of your
suggestions,
david
-- 
David H. Wolfskill
uucp: ...{spsd,zardoz,felix}!dhw68k!david	InterNet: david@dhw68k.cts.com

david@dhw68k.cts.com (David H. Wolfskill) (04/21/89)

Thanks to all those who responded to my question in the Subject: line;
one person mentioned that he runs pathalias without the option to spit
out the cost information, then skips the sed and lcasep steps; he
reports that the amount of time taken is substantially reduced.

All others who responded seemed quite interested in a positive way;
thank you all.  I intend to send the program off to Brandon (for
distribution in comp.sources.misc) either this morning or tonight.

My thanks also to those who think up names are better than I do! :-)

I will send the program out as "pathrpt".

Cheers,
david
-- 
David H. Wolfskill
uucp: ...{spsd,zardoz,felix}!dhw68k!david	InterNet: david@dhw68k.cts.com