[comp.unix.ultrix] Need per-user accounting system

lloyd@aplcen.UUCP (Lloyd W. Taylor) (04/06/88)

The word has come down from on high that henceforth we will charge
for computer use.  Thus I am in need of a system to do per-user
invoicing from the data collected in /usr/adm/*acct.  Before writing
such a beast, I am seeking information on such a system from netland.
If you are using/have written/know where to get such a system, I would
appreciate hearing from you.

The target system is a VAX 8810 (aka 8700) running Ultrix 2.2.  We plan
to charge for CPU time, disk I/O, and average disk usage.

-- 
-- Lloyd W. Taylor 		      | uunet!mimsy!aplcen!{lloyd, root}
   Johns Hopkins Univ./APL Center     | lloyd@aplvax.jhuapl.edu (Milnet)
   Laurel, Maryland  20707	      | lloyd@cenvax.apl.jhu.edu (Suranet)
   "Man does not live by bread alone" | (301) 953-6175 (voice)

jeff@drexel.UUCP (Jeff White) (04/14/88)

  I've written an accounting package for our system here (an 11/780 running
4.2 BSD), but it's such a kludge that I wouldn't want to send it out.  However,
what I do is to basically use the standard unix commands that deal with
accounting data (sa for cpu and disk I/O, ac for connect time, du for disk 
usage), and do a lot of cutting, pasting, and greping to form a raw data file
that another program can read and them prepare a proper report.
  I use the following commands (I'm actually executing them so you can see the
results):

1. CPU and IO:  sa -ml | grep jeff

% jeff       3575     84.15cpu      61266tio       691383k*sec
%			^ 		^
		    cpu minutes    total io

2. Connect time: ac -p | grep jeff

% 	jeff     21.49
% 		   ^
		hours connect time

3. Pages printed: pac -P{printer_name} -s;pac -P{printer_name} | grep jeff

% drexel:jeff               128.00   24   $  6.40
% 
% 			     ^
			pages printed


4. Disk usage: du -s {home_dir}

% 17831	/usr/jeff
% 


   As you can see, all the raw data you need it pretty easy to obtain.  The 
more difficult part is trying to automate the gathering and reformatting of
this data.  The line below gives a sample of 1 line of this raw data.


% jeff Jeff_White 102 cbis 100 /usr/jeff  13707.     31.  114.23  149967  57.20  11.00   0.00    0.00 
% 
  
  Below is the description of each record that the final program uses to print
out the bills: 

/* DATA FORMAT */  May 18, 1984
   (revised July 23, 1984 by Jeff White)

1) login name { c-string }
2) Full name  { c-string; '_' must be converted to blank }
3) UserId     { int }
4) Group name { c-string }
5) GroupId    { Int }
6) Home dir   { c-string }
7) Disk Usage { Int }
8) Billing Days { Int }
9) CPU time   { Real f5.2 }
10) Disk IO    { Int; No. operations }
11) Connect Time { Real f5.2 }
12) Pages - line      { Real f5.2 }
13) Pages - daisy      { Real f5.2 }
14) Pages - laser      { Real f5.2 }


   I don't want to burden you with any unnecessary information, so if you
have an specific questions, feel free to drop me a line.

						Jeff White
						Drexel University - ECE Dept.
						rutgers!bpa!drexel!jeff

rwa@auvax.UUCP (04/21/88)

> The word has come down from on high that henceforth we will charge
> for computer use.  Thus I am in need of a system to do per-user
> invoicing from the data collected in /usr/adm/*acct.

Assuming this makes it back ;-) --> we use a package called `ja' from
AIM Technology.  It seems to work ok; it's a little slow at times but then
I have over 700 active user accounts on this box...

Aim advertises in Unix {World,Review,*} and so on.  Their tech support has
been good, see what kind of a discount you can get - we got 50%.

Features: Rates-by-time and charge
groups (not nescessarily matching UIDs, but no reason not to do
that) with semi-privilged group leaders well supported.  Both
detailed and summary reports available via a psuedo natural-language
interface (which doesn't always parse the way you think it ought to
:-)...  Works from /usr/adm/acct, utmp, and has a disk-usage info
collector that you run from the crontab (I run mine hourly).

Drawbacks: ja doesn't understand NFS or the idea of charging
daemon time to users.  I asked them about this, and they thought those
were good ideas, but made no promises.  

The nice thing was that it's all supplied as source - mine ported to
a Sun/3 fairly trivially.  Of course, I didn't *use* that copy!

Sincerely,

Ross Alexander, Sr. Systems Programmer @
Athabasca University, Athabasca, Alberta T0G 2R0
<large-backbone-site>!alberta!auvax!rwa