2 added 4 characters in body
source | link

I want to know how to send new login and logout logs to a database.

I know that last command outputs the "lasts" login info. But, I found the following problems?:

  • How to filter to only get new logs? How can I identify them?
  • How many time is saved in the utmputmp file? How many time should I wait to refresh it? Should I access wtmpwtmp? How?
  • Is there any other way?
  • Can I use rsyslog.cong to copy the log info to a mysqlMySQL database or to a phpPHP (local or remote)?

Note that:

  • Other users shuold not be able to delete the logs before script/deamon send it to the database.
  • Other users should not be able to falsify logs entries.

I'm trying to solve this for several days... Thanks!

I want to know how to send new login and logout logs to a database.

I know that last command outputs the "lasts" login info. But, I found the following problems?

  • How to filter to only get new logs? How can I identify them?
  • How many time is saved in the utmp file? How many time should I wait to refresh it? Should I access wtmp? How?
  • Is there any other way?
  • Can I use rsyslog.cong to copy the log info to a mysql database or to a php (local or remote)?

Note that:

  • Other users shuold not be able to delete the logs before script/deamon send it to the database.
  • Other users should not be able to falsify logs entries.

I'm trying to solve this for several days... Thanks!

I want to know how to send new login and logout logs to a database.

I know that last command outputs the "lasts" login info. But, I found the following problems:

  • How to filter to only get new logs? How can I identify them?
  • How many time is saved in the utmp file? How many time should I wait to refresh it? Should I access wtmp? How?
  • Is there any other way?
  • Can I use rsyslog.cong to copy the log info to a MySQL database or to a PHP (local or remote)?

Note that:

  • Other users shuold not be able to delete the logs before script/deamon send it to the database.
  • Other users should not be able to falsify logs entries.

I'm trying to solve this for several days... Thanks!

1
source | link

Send new login & logout logs to a database

I want to know how to send new login and logout logs to a database.

I know that last command outputs the "lasts" login info. But, I found the following problems?

  • How to filter to only get new logs? How can I identify them?
  • How many time is saved in the utmp file? How many time should I wait to refresh it? Should I access wtmp? How?
  • Is there any other way?
  • Can I use rsyslog.cong to copy the log info to a mysql database or to a php (local or remote)?

Note that:

  • Other users shuold not be able to delete the logs before script/deamon send it to the database.
  • Other users should not be able to falsify logs entries.

I'm trying to solve this for several days... Thanks!