[Unixcert] Another program to summarize accounting information

Glen Jarvis glen at glenjarvis.com
Sun Sep 2 18:52:01 UTC 2012


Since the runacct program is available only to Solaris Source code
licensees:

 http://docs.oracle.com/cd/E19253-01/816-5166/6mbb1kqg3/index.html

I have made a mini program that will let you summarize lastcomm data by
date and time.

For example:

If I wanted the Joe account information from last comm, but I want it
summarized only between two time periods, I could do something like the
following:

lastcomm joeaccount  | ./lastcomm_summary.py --start="2012-09-01 16:52"
--end="2012-09-01 17:00" | more

The program currently parses based upon SuSE output, so we may need to make
it more flexible if other OSs are needed and the output isn't the same
fixed field format that it currently is in SuSE. Also, I only summarize the
number of seconds and a list of programs (printed only once). We could be
as flexible as we want with this.

I'm sharing it with anyone who will find it useful:

1) save to local filesystem (file: lastcomm_summary.py) (file attached)
2) chmod u+x lastcomm_summary.py
3) pipe some lastcomm data through it such as follows:

lastcomm  | ./lastcomm_summary.py --start="2012-09-01 16:00"
--end="2012-09-01 17:00" | more


Now, we can summarize hourly, daily, every five minutes, monthly, or
whatever we wish.  Of course, log management of the lastcomm log will still
need to be considered if it gets humongous. But, this is also manageable.

It was written in a one-time sitting, so please feel free to give bug
reports.


Cheers,


Glen
-- 

"Pursue, keep up with, circle round and round your life as a dog does his
master's chase. Do what you love. Know your own bone; gnaw at it, bury it,
unearth it, and gnaw it still."

--Henry David Thoreau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.noisebridge.net/pipermail/unixcert/attachments/20120902/ba0db473/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lastcomm_summary.py
Type: application/octet-stream
Size: 3584 bytes
Desc: not available
URL: <http://www.noisebridge.net/pipermail/unixcert/attachments/20120902/ba0db473/attachment-0002.obj>


More information about the Unixcert mailing list