- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- last command on a network
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-11-2004 10:29 PM
03-11-2004 10:29 PM
I have been asked to identify users on our network who haven't logged in for over 90 days. I know I can do this with "last|grep userid", but don't want to have to log in to every server/workstation for every user. As the users are set up in NIS, I am sure there must be a way of doing it from the NIS server.
Any ideas?
Mark Syder (like the drink but spelt different)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 10:31 PM
03-11-2004 10:31 PM
Re: last command on a network
How about the finger command.
# finger user
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 10:32 PM
03-11-2004 10:32 PM
SolutionThough the user login information is obtained from the NIS, the system still keeps the login activities in the local files (utmpx/wtmpx). I would suggest you to write a script that can do a remsh to all the systems, run last command and redirect the o/p to a file. If you feel this is a security risk then you have to do this on individual systems ..
-KarthiK S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 10:35 PM
03-11-2004 10:35 PM
Re: last command on a network
I'll give them both a go and award points accordingly.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 10:36 PM
03-11-2004 10:36 PM
Re: last command on a network
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 10:40 PM
03-11-2004 10:40 PM
Re: last command on a network
Robert-Jan - thanks, I've tried it, but it still means logging in on every server/ws.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 11:06 PM
03-11-2004 11:06 PM
Re: last command on a network
That is OK .. take your own time :-))
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 11:15 PM
03-11-2004 11:15 PM
Re: last command on a network
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.39/
And sitting from a workstation run the following script (slight modification required - you can login as root or any normal user - a file by name server_list should be created which will contain a list of machine names),
for i in `/usr/bin/cat server_list`
do
/usr/sbin/ping $i
if [ $? -eq 0 ]
then
/usr/local/bin/expect <
set timeout 10
spawn telnet $i
expect "Login: "
send "root\r"
expect "Password: "
send "password\r"
expect "$"
send "last | grep user\r"
expect "$"
send "exit\r"
exit
EOF
else
/usr/bin/echo "$i is down"
fi
done > userstat.out
Hope this helps...
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 11:35 PM
03-11-2004 11:35 PM
Re: last command on a network
No points for this please ..
-KarthiK S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2004 02:25 AM
03-16-2004 02:25 AM
Re: last command on a network
The file is being created as I write.
I think I'll probably leave it running overnight - it looks as though it's going to be big.
Mark