Also take a look at redbooks REDP3818, Accounting and monitoring for
z/VM linux guest machines. It contains some scripts to process CP
monitor and Account.
Op 30-12-10 19:18, Scott Rohling schreef:
> I believe the record layout is in CP Planning and Administration?
> Here's some code you point at an accounting file and produces a report
> showing CPU minutes/hours for each user (looks like although I collect
> the account code - I'm not displaying it):
>
> /*--------------------------------------------------------------------*/
> Trace o
> Address COMMAND
> Arg file
> Parse VAR file file '(' outfile
> Parse Source envnm callnm snm styp smod synnm cmdnm
> user. = ''
> users. = ''
> usernum = 0
> grand = 0
> 'PIPE COMMAND LISTFILE' file '| STEM FILES.'
> Do i = 1 to files.0
> 'PIPE FILE' files.i '| LOCATE 79.2 /01/ | SPECS 1.40 1 | STEM REC.'
> Say files.i
> Do j = 1 to rec.0
> Parse VAR rec.j 1 usr 9 act 17 . 33 tsecs 37 .
> usr = strip(usr)
> tsecs = 'C2D'(tsecs)
> If user.usr = '' Then Do
> user.usr = 0
> usernum = usernum + 1
> users.usernum = usr
> user.usr.code = act
> End
> user.usr = user.usr + tsecs
> grand = grand + tsecs
> End
> End
> Say usernum 'users found'
> If outfile = '' Then outfile = 'CPUCNT OUTPUT A'
> 'ERASE' outfile
> total = 0
> Do i = 1 to usernum
> usr = strip(users.i)
> act = user.usr.code
> /* Data is milliseconds - so get seconds */
> amount = user.usr/1000
> pct = format(100*(user.usr/grand),5,2)
> /* Divide by 60 for minutes */
> hours = amount/60
> total = total + amount
> out = left(usr,8) format(amount,10,2) format(hours,10,2) pct'%'
> Say out
> 'PIPE VAR OUT | >>' outfile
> End
> Say 'Total:' total
> 'FINIS' outfile
> Call @Exit 0
>
> /*--------------------------------------------------------------------*/
> /* Exit - Exit Routine (Normal and Error) */
> /*--------------------------------------------------------------------*/
> @Exit:
> Parse Arg erc text
> If text ¬= ''
> Then Say text
> Exit erc
>
>
>
>
> On Thu, Dec 30, 2010 at 11:07 AM, Billy Bingham
> <[email protected]
> <mailto:[email protected]>> wrote:
>
> Does anyone have a short tutorial or know of a book on collecting
> and processing the accounting records generated by VM? This would
> include the record layouts.
>
>
> Thanks,
>
> Billy
>
>