LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   User login & lock screen monitor (https://www.linuxquestions.org/questions/linux-software-2/user-login-and-lock-screen-monitor-902776/)

kaiserb 09-13-2011 09:24 AM

User login & lock screen monitor
 
Hello,

I use Ubuntu 11.04 with GUI.

I want to monitor my user for login/logout and lock/unlock screen.
I want to see:
  • the total time I spend daily on computer: the time between first time I login or unlock screen and last time I logout or lock screen
  • and the real time: total time - the time that my user was logout or screen was locked.
There is a way to do this? There is a program that can do that?
I tried who/last and to retrieve information from utmp and wtmp files, but is not quite I want.

I don't mind if I have to write this code myself, but I don't know how to catch lock/unlock screen events.

Thanks.

smithy2010 09-16-2011 04:51 AM

Hi, maybe you could find this useful:


yum install psacct


chkconfig psacct on
# /etc/init.d/psacct start

ac -p

lastcomm username

lastcomm somecommand

lastcomm pts/1

sa -u

Cheers


All times are GMT -5. The time now is 05:28 AM.