- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Analysis user log files
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
Forums
Discussions
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
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
06-23-2003 06:54 PM
06-23-2003 06:54 PM
Analysis user log files
I use command "who -u" capture a file in the cron job daily that wants to analysis which users didn't login to the system more than 3 months. How can I use those daily log files to do the result?
Thanks!
Best Regards
Ajk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 07:09 PM
06-23-2003 07:09 PM
Re: Analysis user log files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 07:14 PM
06-23-2003 07:14 PM
Re: Analysis user log files
I don't know how to do it. Would you mind to tell me in detail, please?
Best Regards
Ajk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 07:17 PM
06-23-2003 07:17 PM
Re: Analysis user log files
Have a look at a very similar discussion from earlier today.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x53650ea029a2d711abdc0090277a778c,00.html
The 'last' command uses the same data file (/var/adm/wtmp) as 'who -u'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 07:19 PM
06-23-2003 07:19 PM
Re: Analysis user log files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 07:24 PM
06-23-2003 07:24 PM
Re: Analysis user log files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 07:33 PM
06-23-2003 07:33 PM
Re: Analysis user log files
There isn't a simple way of finding this out. If you want to find this out, the best way is to use last command. However, this pulls out the information from wtmp. So, if you trimmed it anywhere in the last three months, then you won't get the information. So, you will have to plan. Either keep the wtmp file for 3 months or regularly recycle (using /usr/sbin/acct/fwtmp
) but keep the old files somewhere.
Then it is just a question of writing a script that can take care of it.
last -R > last.log
(Edit this and remove standard logins like root, bin, sys etc., or you can put a grep -v in the above)
for LOGIN in $(awk '{FS=":";print $1}' /etc/passwd)
do
grep -q $LOGIN last.log
if [ $? != 0 ]
then
echo $LOGIN >> nologin.out
fi
done
if [ $(wc -l nologin.out|awk '{print $1}') -eq 0 ]
then
echo |mailx -s "No LOGINS" your_id@yourdomain.com
else
mailx -s "NO LOGIN REPORT" yourid@yourdomain.com < nologin.out
fi
-Sri