LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Event logging (https://www.linuxquestions.org/questions/linux-networking-3/event-logging-247768/)

RajaRC 10-27-2004 12:58 AM

Event logging
 
Hi

I have a Redhat linux Server.

I would like to configure it in such a way that it displays the last login and logout date and time for a particular when he login to the system.

Currently it displays the last login time and date, but not logout.

Please let me know how to configure it to display both.

Regards

neilman 10-27-2004 08:18 AM

I think a lot of that information may be stored in /var/log/wtmp. However, I'm not that familiar with parsing through wtmp to make any useful information. A script-based way to obtain information is by using the last <username> commandl and then yank out the info you need. For instance, when I type in last neil from the command prompt of one of my servers, I get this:
Code:

neil    pts/198      h10-215-220-46.  Tue Oct 19 15:15 - 16:56  (01:41)
neil    pts/197      h10-215-220-46.  Tue Oct 19 14:33 - 14:58  (00:24)

Username, terminal, hostname I connected from, Date/time when I connected through when I disconnected, and lastly my duration in (HH:MM) format.

RajaRC 10-28-2004 12:59 AM

Thankyou Niel

Regards


All times are GMT -5. The time now is 06:05 PM.