LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   lastlog (http://www.linuxquestions.org/questions/programming-9/lastlog-517566/)

November11 01-08-2007 09:43 PM

lastlog
 
I need to write a program that can monitor our server,

Who is logged into the machine?
What are they doing?
Where are they logged in from?
What active TCP/UDP connections are there?
Where are these connections being made to/from?

and output the details to a text file.


Hoping someone out there have a similar script that I can get an idea from.

Thanks in advance
November11

raskin 01-09-2007 01:40 AM

Code:

w >> log
ps aux >> log
netstat -nlp >> log


chrism01 01-10-2007 06:47 PM

If you want the sort of sophisticated (eg x-ref output) I think you are asking for, Perl is designed to do this kind of stuff.
You prob also want to consider storing the results in MySQL for later analysis.

http://perldoc.perl.org/
http://search.cpan.org/
http://www.perlmonks.org/


All times are GMT -5. The time now is 08:31 AM.