- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- logging the amount of time a user is logged in
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2002 04:59 AM
09-18-2002 04:59 AM
Is there a utility that already exists that allows me to track the amount of time a user is logged into a system over a given period of time?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2002 05:04 AM
09-18-2002 05:04 AM
SolutionHave alook at last command - man last.
e.g.
mend pts/ta Wed Sep 18 08:18 - 12:04 (03:46)
mend pts/ta Tue Sep 17 17:33 - 17:51 (00:17)
mend pts/ta Tue Sep 17 17:19 - 17:21 (00:01)
mend pts/ta Tue Sep 17 10:06 - 17:15 (07:09)
mend pts/td Mon Sep 16 12:03 - 18:22 (06:18)
mend pts/tc Mon Sep 16 11:30 - 16:29 (04:58)
mend pts/ta Mon Sep 16 09:11 - 16:29 (07:17)
mend pts/tb Fri Sep 13 09:22 - 10:04 (00:41)
mend pts/tb Fri Sep 13 09:14 - 09:22 (00:08)
mend pts/tc Thu Sep 12 12:10 - 17:22 (05:12)
paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2002 05:05 AM
09-18-2002 05:05 AM
Re: logging the amount of time a user is logged in
If '/var/adm/wtmp' isn't present, create it:
# touch /var/adm/wtmp
# chmod 644 /var/adm/wtmp
Now you can use :
# last
# last username
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2002 05:33 AM
09-18-2002 05:33 AM
Re: logging the amount of time a user is logged in
(Don't write any scripts here, I can do that, I'm just trying to avoid the hassle).
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2002 06:34 AM
09-18-2002 06:34 AM
Re: logging the amount of time a user is logged in
I think this is the point where you'll need to start script writing. As well as the output of last, you may also find the fwtmp(1M) command useful (or perhaps use the info in the utmp(4) man page if you feel like writing a C program from scratch to read/calculate the file.)
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2002 06:37 AM
09-18-2002 06:37 AM
Re: logging the amount of time a user is logged in
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2002 01:59 AM
09-19-2002 01:59 AM
Re: logging the amount of time a user is logged in
This sounds like an ideal application for A Clay Stephenson's datehammer. Just search for caljd on the forums for some of the many uses it has been put to.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2002 02:08 AM
09-19-2002 02:08 AM
Re: logging the amount of time a user is logged in
Merijn has kept a link to A. Clay Stephenson's Date Hammer (of both shell and perl versions) at the end of his page:
https://www.beepz.com/personal/merijn/
Hope this helps. Regards.
Steven Sim Kok Leong