Re: Session Limits, Byte Counters

Dave Andersen (angio@aros.net)
Wed, 18 Oct 1995 01:41:08 -0600 (MDT)

Lo and behold, Larry Vaden once said:

> 1) Is session time limit implemented?

No. See http://www.aros.net/pub/util/pm/timeout - it uses two programs
(pmwho.c and pmcom.c), and will do what you want. It's not the most
elegant solution, but it works pretty well.

(Hey, Livingston -- because of all these telnetting utilities, I don't
suppose we could convince you to allow more concurrent administrative
sessions? Because most of my scripts run on the minute under cron, I
frequently overload the poor portmasters. Upping it to 5 or 6 concurrent
sessions would *sure* be a benefit to us poor squids. :)

> 2) Is there a way to reset the port byte counters without rebooting the
> portmaster?
>
> 3) Other than 2), is there a good way to detect a line which is not taking
> calls?

We use a pmwho-ish set of utilities that logs on, notices which lines
are in use, and stores them bitwise in a file every 5 or 10 minutes.
It's not too pretty, but it works. Then you can just print them out and
notice patterns of Xs and -s... (They're not something I can release,
unfortunatly). It's not too hard to whip up something that does a
similar thing in perl using pmwho, however.. just store the Xs directly,
and rotate the file daily to prevent icky plaque buildup. Then you'll
have a good graphical indication of line usage.

-Dave Andersen

Oh - speaking of toys, someone posted a collection of awk scripts to the
list the other day to parse the detail file. I'm a perl fanatic, so I
wrote something comprable in perl (that you can just run *now* on your
detail files. It's at

ftp://ftp.aros.net/pub/util/pm/lineparser

It parses out all of the "stop" records and converts them in to a
line-oriented file of the format

[date] [time] [username] time-online port connect IP address
used type

(IP address is either their IP address if they're a "net" connect or the
host address if they're a "log" connect).

*shrug* I find it very handy because it makes it easy to tally up usage
and reduces the size of your logfiles to 1/10th the original size.
Hope someone gets something out of it. :-)

-- 
angio@aros.net                Complete virtual hosting and business-oriented
system administration         Internet services.  (WWW, FTP, email)
http://www.aros.net/          http://www.aros.net/about/virtual/
        "She totally confused all the passing piranhas"