Solved

Way to use wtmp or "last" to gather total hours logged for a user?

Posted on 2007-03-23
3
416 Views
Last Modified: 2013-11-17
I'm needing to figure out a way (util or command) to use the stats from wtmp or "last" output to basically show the total number of hours logged for a given user.  I've had a few people putting a great deal of over time, and want to use this as a rough gauge of hours.  I realize all the inaccuracies in doing this in terms of the fact that the individuals may not have acutally been working, etc.  I'm hoping that maybe there's an easy way to take the longest session for a user each day, to avoid totalling hours of multiple sessions/logins they may have had going, and or avoiding over-lapping sessions.

Any ideas?

0
Comment
Question by:derdle
  • 2
3 Comments
 
LVL 61

Expert Comment

by:gheist
ID: 18784550
What problem are you solving?
0
 

Author Comment

by:derdle
ID: 18786204
I'm trying to show a rough number of hours logged in for a user.  For people, including myself who do a lot of work at home, in addition to the office work-  I'd just like to gather a rough number of hours.  I know there are better ways and methods for this that we're implementing, now that we have a need.  ...but the need came about abruptly and I need to go back a few months and get an idea of the hours that have been logged into the system.
0
 
LVL 61

Accepted Solution

by:
gheist earned 500 total points
ID: 18788193
http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/periodic/monthly/200.accounting

this shell script shows user login summaries in FreeBSD system without asking.

put it in your crontab or so.

another is to look at www.redbooks.ibm.com for AIX accounting, and using
http://www.redbooks.ibm.com/abstracts/sg246396.html?Open
for CPU minute accounting etc.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now