- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to count the days of inactivity for every acco...
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
02-14-2006 10:43 AM
02-14-2006 10:43 AM
how to count the days of inactivity for every account?
my boss gave me a tough job to see the number of days since the last login to now.
my system is HPUX 11.0 and NIS is used.
any idea ar ewelcomed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2006 11:22 AM
02-14-2006 11:22 AM
Re: how to count the days of inactivity for every account?
Last login activity (by user) is logged in '/var/adm/wtmp', otherwise known as the 'last" database because the standard command to view activity is 'last'. The file is a binary file.
If you don't have the file, logging is disabled. If this is the case, as root, do:
# touch /var/adm/wtmp
The file will grow infinitely, so usually it is emptied by redirecting /dev/null to it.
# last
# last -R
...will show the last time
See the manpages for 'last' for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2006 12:00 PM
02-14-2006 12:00 PM
Re: how to count the days of inactivity for every account?
The output of last is too tough for him. he never come to the unix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2006 12:03 PM
02-14-2006 12:03 PM
Re: how to count the days of inactivity for every account?
passwd -sa
produces a report that might be helpful. On NIS, this must be run on the NIS Master, or should be.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2006 12:15 PM
02-14-2006 12:15 PM
Re: how to count the days of inactivity for every account?
Too touch for your boss...OK, here's two other suggestions:
Suggestion-1:
# finger
...will produce a simply query and result, including text like, "Last login Tue Dec 13 23:17 on ttyp1". Teach the boss to use it (or maybe not).
Suggestion-2:
Write a shell script to produce what you need. The 'wtmp' file is a binary file that can be converted to ASCII records:
# /usr/sbin/acct/fwtmp < /var/adm/wtmp
You can pick out the most recent login for any account by looking for the largest value of that login's 7th field (zero-relative). It is the epoch time --- the number of seconds since January 1, 1970. It will correspond to the localtime you see in the 8-11-th fields following it.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2006 03:40 AM
02-16-2006 03:40 AM
Re: how to count the days of inactivity for every account?
/usr/lbin/getprpw -m slogint