- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Users that have not login over time
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
03-30-2004 04:44 AM
03-30-2004 04:44 AM
Iâ m trying to script a way to sort out information of users that have not login in 120 days. The script route Iâ m venturing down has to do with using '/usr/lbin/getprpw -m slogint'. However, I know of no verbose value I can put with this command to weed out the "last successful login that is < 120 day".
Please help if yo
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 04:48 AM
03-30-2004 04:48 AM
Re: Users that have not login over time
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 05:21 AM
03-30-2004 05:21 AM
Re: Users that have not login over time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 05:29 AM
03-30-2004 05:29 AM
Re: Users that have not login over time
On trusted systems -- From last -R "user_name" or getprpw. (This all apiles to the date when wtmp was started)
Now using calcj.sh compare the time difference, if more than what you want, take action what you want?
Hope this helps.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 05:48 AM
03-30-2004 05:48 AM
Re: Users that have not login over time
# last -R cartman
cartman pts/tl mugle Tue Mar 30 11:34 still logged i
cartman pts/tg 654.54.676.15 Fri Mar 26 14:27 - 17:09 (02:41)
cartman pts/tg 654.54.676.15 Fri Mar 26 09:51 - 14:19 (04:28)
cartman pts/te 654.54.676.15 Thu Mar 25 12:51 - 17:16 (04:25)
wtmp begins Thu Aug 7 07:56
However, I'm still not able to script to weed out users that have not successfully login withing a period of time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 05:55 AM
03-30-2004 05:55 AM
Re: Users that have not login over time
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 06:06 AM
03-30-2004 06:06 AM
SolutionHTH
-- Rod Hills
$template = "A8 A4 A12 l s s s s l a16 l";
$recordsize = length(pack($template,( )));
open(WTMP,"/var/adm/wtmp") or die "Unable to open wtmp:$!\n";
while (read(WTMP,$record,$recordsize)) {
($user,$ttyid,$tty,$pid,$type,$term,$exit,$time,$host,$hostip)=unpack($template,$record);
next unless $type == 7;
next unless $ttyid;
next if $ttyid eq "ftp";
next if $ttyid=~/\d+:\d+/;
$user=~y/\000//d; $ttyid=~y/\000//d; $tty=~y/\000//d; $host=~y/\000//d;
$hold{$user}=$time if $time >$hold{$user};
}
$over120=time()-120*24*60*60
foreach $user (keys %hold) {
if ($hold{$user} < $over120) { print $user,"\n"; }
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 06:22 AM
03-30-2004 06:22 AM
Re: Users that have not login over time
I've notice many people have helped you with this problem and other problems you have submitted to the forum. But you have not assigned any points. It is common courtesy to assign points to the responses on how well the answer helped. This is beneficial to other people looking to answer similar questions/problems that you have posed.
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 06:37 AM
03-30-2004 06:37 AM
Re: Users that have not login over time
# finger gmc
Login name: gmc
In real life: Greg McKinnon
Directory: /home/gmc Shell: /bin/ksh
Last login Fri Mar 12 11:50 on ttyp3
No unread mail
No Plan.
You could even do something like:
touch /tmp/finger.last.logins
mv /tmp/finger.last.logins /tmp/finger.last.logins.bak
for i in `cat /etc/passwd | awk -F: '{print $1}'`
do
finger $i >> /tmp/finger.last.logins
done
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2004 07:55 AM
03-30-2004 07:55 AM