Logging on INN
julien at trigofacile.com
Fri Aug 10 22:26:19 UTC 2012
> I would like to track what users are doing on an INN 2.5.2 server. By
> tracking I mean follow the reading and posting of a certain user. The
> post tracking is already available by enabling readertrack in
> inn.conf. However I don't see the way to follow what users are
> reading. Is there a way to do it directly from INN ?
What would you want to have in your logs?
If it is the name of the newsgroup a user is reading, you could have a
look at dynamic access control Python hooks in readers.conf:
"When a python_dynamic parameter is encountered, Python is loaded (if it
has yet to be) and the file given as argument is loaded as well (do not
include the .py extension of this file in the value of python_dynamic).
If a Python object with a method dynamic_init is hooked in during the
loading of that file, then that method is called immediately after the
file is loaded. Every time a reader asks nnrpd to read or post an
article, the Python method dynamic is invoked before proceeding with the
requested operation. Based on the value returned by dynamic, the
operation is either permitted or denied. When the connection with the
client is closed, the method access_close is called if it exists."
The name of the newsgroup to which the reader requests read or post
access; only valid for the dynamic method.
Note that you can also have the information of GROUP commands in your
news.notice file. I think Python dynamic hook is more reliable because
it is not necessary to send a GROUP command to see an article.
You can test:
to see the difference of logging in news.notice (no logging when
requesting a message-ID).
If you want to log the message-IDs, I unfortunately do not know a
solution other that starting nnrpd with the "-t" flag:
If the -t flag is used, then all client commands and initial responses
will be traced by reporting them in syslog. This flag is set by innd(8)
under the control of the ctlinnd(8) trace command, and is toggled upon
receipt of a SIGHUP; see signal(2).
Also have a look at the "nnrpdflags" inn.conf parameter.
> A temporary solution for me would be to dump the NNTP packets and
> parse them but is there a simpler way ?
The "-t" flag should do it. Just parse client commands.
Maybe other people here will know a nicest solution?
« Une fois rien, c'est rien ; deux fois rien, c'est pas beaucoup,
mais pour trois fois rien, on peut déjà acheter quelque chose, et
pour pas cher. » (Raymond Devos)
More information about the inn-workers