- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Monitoring user accounts
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-04-2003 12:11 PM
09-04-2003 12:11 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2003 12:13 PM
09-04-2003 12:13 PM
Re: Monitoring user accounts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2003 12:15 PM
09-04-2003 12:15 PM
SolutionAlternatively, you can add a line of code to /etc/profile and log accounts as they get used.
echo $LOGNAME date >> /var/adm/userlog
Then you can process this file against a user list from /etc/passwd and produce a list of users that have not logged in.
Or, A. Clay Stevenson will post in a little perl script.
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
09-04-2003 12:20 PM
09-04-2003 12:20 PM
Re: Monitoring user accounts
I can tell you what you need to do though:
1. Get the GMT time in seconds. I wrote a hello world style C program that prints the result of the the time() system call to stdout.
2. Loop through each user in the password file (I skip system accounts) and find the corresponding tcb entry. This can be done by grabbing the first char of the login name and then accssing the file in /tcb/files/auth/
The tcb file contains a field called u_suclog that lists the last successful login in GMT seconds since UNIX epoch.
You then compare these two numbers.
This is a very simplified overview, but it should get you started.
I would say to use /usr/lbin/getprpw, but it outputs the date as a human readable string in the local timezone. That makes for harder numeric operations.
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2003 12:25 PM
09-04-2003 12:25 PM
Re: Monitoring user accounts
NOW=$(perl -e 'print time')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2003 12:29 PM
09-04-2003 12:29 PM
Re: Monitoring user accounts
Have a look at 'last'. See the man pages.
Regards!
...JRF...