Re: Reseting modem (fwd)

PortMaster Issues (pm@digicity.net)
Thu, 19 Sep 1996 15:53:41 -0700

At 02:04 AM 9/19/96 -0600, you wrote:

> It's appended at the end of this message. Be warned - unlike the rest of
>my scripts, this program *must* run with the latest version of pmcom
>(NOT the one I wrote. :)
>
> The only configuration that's necessary is setting your portmaster's
>names in the @portmasters array, and pointing to the location of pmcom.
>
> It's included because it's really quite short.
>
>> On a related note (since I haven't bought my copy of "perl for dummies"
>> yet, I'm having a problem with Dave Anderson's "Summarize" script that
provides
>> a summary of usage from the radius logs after being massaged by his "line
>> parser"
>> utility.
>
> Heh. Buy the book. :) Or buy "Learning Perl" and "Programming Perl",
>published by O'Reilly & Associates. Like most of the ORA books, it's
>an invaluable reference.

Yes, I've noticed that about ORA books. Never bought one that I haven't used
over and over again. In fact, I once posted a question to a newsgroup about
an obscure DNS question, and in the message mentioned that ORA's DNS / Bind
book didn't really cover what I was looking for - the next day I received e-mail
from an ORA "support" employee who promised to have Cricket get in touch with
me (which he did, a few days later.)

Can't say enough good things about O'Reilly products, or the fact that they have
a person / people who keyword search newsgroups and proactively provide
unsolicited
technical support as necessary.

>> The summary script just hangs. Any ideas what I may be doing wrong?
>
> How're you invoking it?

./summarize [filename]

Where summarize is the script, and [fileneame] is the name of the output file
parsed by line parser.

> -Dave Andersen

Oops! Sorry about mis-spelling your last name in my original message ; -and
thanks much for the help and script. Uh, what's PMCOM?

>
>#!/usr/bin/perl
>
># Use at your own risk. I've never had a problem with it, though.
>
>
>@portmasters = ('pm1', 'pm2'); # put yer portmasters here
>
>$Pmcom = "/home/angio/src/portmaster/pmcom";
>
>foreach $pm (@portmasters) {
> open(PMCOM, "$Pmcom -c $pm 'show sess'|") || next;
> undef(@ports);
> while (<PMCOM>) {
> if (!/^S/) { next; }
> if (/IDLE/) {
> ($port, $junk) = split;
># print "Resetting $pm $port\n";
> push(@ports, "$port");
># print RESET "reset $port";
> }
> }
> close(PMCOM);
> open(RESET, "|$Pmcom $pm -") || next;
> foreach $port (@ports) {
> print RESET "reset $port\n";
> print "Reset $pm $port\n";
> }
> close(RESET);
>}
>
>