View Single Post
Old 02-02-2016, 07:45 PM   #1168
teejcee
Enthusiast
teejcee began at the beginning.
 
Posts: 48
Karma: 10
Join Date: Mar 2012
Location: Sydney, Australia
Device: Kindle 3G & Paperwhite
Quote:
Originally Posted by mariosipad View Post
Great solution!

Mine is a little different but needs some more testing. Once this is done I will post my solution.

Just one observation. Are you sure this line
Code:
grep getJSON $LOGFILE | mail -s "subject line $DATE" email-address
gives you unique results?

I see "getJSON" multiple times per login in /var/log/apache2/access.log (other_vhosts_access.log is empty on my system = Debian Squeeze and/or Mint 17.0 with Apache).
Interesting...my log file definately had only the one line wih getJSOn in it.
( Until this morning...more on this later )

I'd be interested in how you're writing to access.log.
My access.log does get entries pertaining to a login but doesn't have any reference to user, ip, getJSON etc. Each line ends with.....

"(internal dummy connection)"

I've even tried to create & run a log for cops... opds.access.log ... it gets created ok but nothing gets written to it.

The beauty of my solution is that I don't need to modify any of the
application scripts other than to enable the log file. Plus you can run it manually whenever you want. It's not perfect as I've yet to figure
out when the logs get rotated, so entries are currently repeated each day.
I'll probably rotate the log daily when I figure it out. The system
uses anacrontab and I've yet to come to grips with that.

Also, I've checked this morning's email and one of my users has
somehow created heaps of entries with getJSON. Perhaps more lines get written as the user does things within COPS...ie clicks on different icons etc
I'll do some testing.

I'll need to check it out with him...he's a "problem child" when it comes to using the system and instead of asking for help, stuffs around with things
and gets himself in a muddle.
At least he can't do any harm that I know of...( other than create all these entries....)

edit.... Well, that didn't take long. I've just logged in myself and did aa bit of jumping around & ended up with a stack of entries with getJSON in the log.
Hmmmm....back to the drawing board.

Cheers,
TC

Last edited by teejcee; 02-02-2016 at 07:52 PM. Reason: Additional inforamtion
teejcee is offline   Reply With Quote