- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- viewing all the users loggedin in last 6 months
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
05-06-2009 09:57 AM
05-06-2009 09:57 AM
I am using HP-UX 10.20, 11.00, 11.11.
I want to create a rport of all logged in users for last 3 months.
I am able to get this month report only using "last".
How to do this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2009 10:23 AM
05-06-2009 10:23 AM
Solution1. last > users.txt
2. edit users.txt and delete all lines older than 3 months
3. awk '{print $1}' users.txt | sort -u
If you have may servers, you can combine the users.txt files from each server and run the 3rd command on the cumulative file.
If you need more information as the number of logins and which server it is a lot more involved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2009 10:26 AM
05-06-2009 10:26 AM
Re: viewing all the users loggedin in last 6 months
The last command searches backwards through the file /var/adm/wtmp.Sometimes this file may be trimmed since its size will increase on every login.Check in your crontab file, is there any command is doing the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2009 10:27 AM
05-06-2009 10:27 AM
Re: viewing all the users loggedin in last 6 months
The /var/adm/wtmp file contains the information.
It tends to get quite big and most sysadmins trim it to reduce its size.
But if its there the last command will parse it.
The wtmp file is the data repo and last is the way to access it.
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
05-06-2009 10:37 AM
05-06-2009 10:37 AM
Re: viewing all the users loggedin in last 6 months
last > /tmp/login_report
then
vi /tmp/login_report
you can scroll down to a place where you will see the date and time of 3 months ago (you need to manually figure this out) and delete the lines from this point to the end, you will end up with last 3 months' worth of login report.
Hope this helps.
If you want to do this with a script, please look for Clay Stephenson's caljd script (available in POSIX and perl script forms on the web, just google) and you have to experiment with the last utility combined with Clay's script for date calculation and sed command to come up with the report in the way you exactly want.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2009 11:10 AM
05-06-2009 11:10 AM
Re: viewing all the users loggedin in last 6 months
HP-Server-Literate since 1979
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 05:52 AM
05-07-2009 05:52 AM
Re: viewing all the users loggedin in last 6 months
But i am not able to see before May like April, March, Feb.
At this situation, how we can get the details of user logged in for last 3 months.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 06:00 AM
05-07-2009 06:00 AM
Re: viewing all the users loggedin in last 6 months
if you are provided with a putty tool to login into the server post a session with saved output
and run the command last -R -
eg last -R -20 root
will give last 20 login attempts with the ip used
may this help you...
normally sys admin will trim the wtmp file as to create the excessive filling of /var file system according to the need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 06:00 AM
05-07-2009 06:00 AM
Re: viewing all the users loggedin in last 6 months
You can't. Your system administrators have erased from your systems the data you require to complete this task.
If you need to retrieve this information for a 3-month period, your sys admins need to leave 3 months' worth of data in your wtmp files. They have not done so, and thus you cannot get this data.
It's gone. Your system administrators made it go away.
HP-Server-Literate since 1979
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 06:20 AM
05-07-2009 06:20 AM
Re: viewing all the users loggedin in last 6 months
/var/adm/wtmp is only file which keeps informations about user login and logouts. If this file is wiped out or trimmed due to some reason, then you will not ba able to get the details.
If you have any other tools like powerbroker then you may get the desired data.
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 08:45 AM
05-07-2009 08:45 AM
Re: viewing all the users loggedin in last 6 months
Like it or worked !! Click kudos !!