Register
It is currently Tue Jul 22, 2014 12:50 pm

Script in Progress, need more help


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Mon Jun 01, 2009 4:23 pm   

Joined: Mon Jun 01, 2009 12:43 am
Posts: 3
Ok, so I wrote a stupid script to automatically take the output of the 'last' command and put it in a text file so I can monitor the login/ log out information of users on a network. I need it to do a bit more for me though. I was thinking I could either automate it to run every 6 hours and keep that text file updated. Or put the original script on all the client machines, and set a script on the server to automatically execute all the scripts on the clients and have the information outputted in a text file contained on the server. What I'm trying to do is keep a running log of all the login/out times without having to use terminal everytime I want to check these things. Any and all help is very very much appreciated.


Top
 Profile  
 PostPosted: Sun Jun 21, 2009 3:36 am   

Joined: Sun Jun 21, 2009 3:23 am
Posts: 4
I would write the script on the server and have that script go through a for loop of all the clients you want to connect to (via ssh), run the 'last' command, and output that to a log file. That way, you don't need to have your script in every client machine. Then setup a cronjob at whatever interval you want to email you the output of that log.

-twantrd


Top
 Profile  
 PostPosted: Wed Jul 22, 2009 1:43 pm   
Moderator
User avatar

Joined: Wed May 03, 2006 2:05 pm
Posts: 242
Are you just trying to log logins and logouts for a single server? I'm confused about where the client machines come in... Unless you want to log logins on each client machine as well...

Depending on your distribution, logins and logouts are typically logged in /var/log/messages, or /var/log/auth.log.

If you are tracking logins on several machines and want to keep a central log, you may want to look into remote syslog. That way you could have syslog do all the work, and there would be no need for a script at all.

Let us know if you still need help! I'm probably completely missing the point!


Top
 Profile YIM  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP