Solved

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

Posted on 2007-03-23
3
414 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
EMC VNX  storage pool  Vs  raid group  question 3 102
Shell script errors 10 99
how to check for shares on aix 1 51
Skill Development 15 124
When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

706 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

18 Experts available now in Live!

Get 1:1 Help Now