Operating System - HP-UX
1748236 Members
3611 Online
108759 Solutions
New Discussion юеВ

Re: how to find out the last login of an individual user on 11i v3

 
SOLVED
Go to solution
fizan
Super Advisor

how to find out the last login of an individual user on 11i v3

last login basis1

WTMPS_FILE begins at Fri Apr 17 15:42:22.

Here am bit dowted, for the current yr only the year will not be mentioned on the time stamp, but in 2011 april 17th dint come, so
it can be 2010 or before ?

How should i find it out?

Thanks
5 REPLIES 5
P Arumugavel
Respected Contributor

Re: how to find out the last login of an individual user on 11i v3

Hi,

Check the system date.

#date

Rgds...
Shibin_2
Honored Contributor

Re: how to find out the last login of an individual user on 11i v3

Your system date must be wrong. Check it.
Regards
Shibin
Matti_Kurkela
Honored Contributor
Solution

Re: how to find out the last login of an individual user on 11i v3

Yes, the wtmps file can contain information from the previous year(s).

Some months ago we (finally!) removed some very old 10.20 and 11.00 systems whose wtmp/wtmps files covered at least two or three years.

Run "last | more" to view the entire wtmps file: the entries will be listed in order, from the newest to the oldest. If you see the latest entry as recorded in April, then entries on some other months, then April again, then the file includes data from the year 2010.

MK
MK
James R. Ferguson
Acclaimed Contributor

Re: how to find out the last login of an individual user on 11i v3

Hi:

> it can be 2010 or before ? How should i find it out?

If you convert the binary 'wtmps' to an ASCII file you also expose additional data (including an epoch timestamp):

# /usr/sbin/acct/fwtmp < /var/adm/wtmps > /tmp/wtmps

Now, if you want, you can edit this ASCII file, removing any lines you don't want, and replace the 'wtmps' binary by doing:

# /usr/sbin/acct/fwtmp -ic < /tmp/wtmps > /var/adm/wtmps

By the way, the simplest way to convert an Epoch timestamp to a human-readable tiime and date is simply (for example):

# perl -le '$t=shift and print scalar localtime($t)' 1302090854

...pass any timestemp you need converted.

Regards!

...JRF...
Hakki Aydin Ucar
Honored Contributor

Re: how to find out the last login of an individual user on 11i v3

in addition to James, I attached a script is able to do something with inactive users finder.At least you can see how I used history DataBase with accounting inside the code as James mentioned.
First you have to change top line to #!/usr/bin/perl
something according to your environment..