Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Request for "os_readlog"  (Read 3750 times)

0 Members and 1 Guest are viewing this topic.

SNU

  • Anope User
  • Offline Offline
  • Posts: 158
    • http://www.firstclassirc.com
Request for "os_readlog"
« on: May 16, 2008, 01:30:24 PM »

Hi guys.
I'd like to request a module that maybe helps opers to act more effectively.

This module only works if logging is enabled and logfiles exist. Many opers, I guess aren't able to be online 14/7 so although they maybe have -logchan enabled they can't access the whole logfiles without logging into the shell or download the logfile.
So I'd like to have a module that has search and/or parse - functions to get certain Information from the logfiles by operserv.

IT should be restricted to services root or maybe certein users specified in the special config.

Example:
You haven't been in your ircd from May 15 02:00:00 2008 until 08:00:00 . THere is a user called "weebo12", that tells you that he could not login from May 15 03:01:00 until 04:04:03. You are a very helpful admin and you want to know and tell the user why. Th usual way is: you log into the shell and cat | grep the logfile trying to see any strange things, maybe you also cut off usual notices (lines that contain "NickServ" ones or "LOGUSERS") so you have a filtered one to see what happened.

So what about a module that makes it possible inside the ircd, so you don't need the shell?
what about something like:
/msg operserv readlog [YYYYMMDD:hh:mm:ss(-YYYYMMDD:hh:mm:ss)/last x(D,h,m)/all] [ONLY/WITHOUT/all] [String/regexp (AND|OR)]

To be more detailed:
- "/os readlog" should be clear
- the first option makes it possible to filter out the "output" only from a certain time, a timeframe or a relative value, eg last 4hours (last 4h), all time or if you don't specify that option it uses a standard-value set in the config (but I'd recommend to force the use of that option)
- the second option lets you specify if you want in the output only that lines that match the values given in the 3rd option or if you want to exclude that loglines given in the 3rd option. if you specify "all" you don't need to give a 3rd option because you see everything given in the timeframe you specified in option 1
- the third option allows you to set the filters that should be shown/excluded. If you are aware you can use regular expressions (maybe this is harder to code, I don't know). Maybe you can add more than one expression


Like in our example you have a presumption that the users sessionlimit was exceeded so you type:

Code: [Select]
/os readlog 20080515:03::-20080515:04:10: ONLY weebo OR session

This will response all lines in the logfile that match the strings weebo or session in the time the user told. I used OR because maybe the user maybe had another nick on connection.
Now you can tell the user, that he had exceeded his session limit, because there was someone online that used the same ip.

Maybe its a bit "harmful" to your machines memory but doing this in the shell would be the same I guess.
What do you think about it? Would someone try to code it? I'm not a programmr but I'm able to assist you whereever I'm able to do so.

Thanks for reading.
Greets.

[Bearbeitet am 16-5-2008 von SNU]
Logged

katsklaw

  • Guest
(No subject)
« Reply #1 on: May 16, 2008, 04:28:15 PM »

IMHO, this would be better suited for php over http, You can compile anope to allow the webserver to see the logs and create a password protected web interface to search logs. This is manily to keep the resource usage away from services.

Anope is single threaded, this means it can only do one thing at a time, so users can't identify, anope can't run updates ... etc or any other task while Anope is busy searching logs.
Logged

SNU

  • Anope User
  • Offline Offline
  • Posts: 158
    • http://www.firstclassirc.com
(No subject)
« Reply #2 on: May 17, 2008, 08:42:31 AM »

THanks for your response.
This single-thread-thingy is one think I didnt think of and is as I think the biggest one to say "no". But maybe you could do some restrictions to avoid large delays (until anope gets multithreaded ^^).
I know there exist different ways to do that "logparsing", php, eggdrop... I just liked to have it implemented inside services. But what do you mean to compile anope to allow the webserver to see the logs? Do you mean giving the log-flder another place and maybe another umask? Or is there a "hidden" feature? :D
Logged

katsklaw

  • Guest
(No subject)
« Reply #3 on: May 17, 2008, 11:26:26 AM »

No it's not a hidden feature, it's one of the questions in the ./Config script as to what permissions you are assigning, and yes you would need to either copy the logs on a regular basis or point your web server to the logs directory.
Logged
Pages: [1]   Go Up