80 lines
22 KiB
HTML
80 lines
22 KiB
HTML
![]() |
<html><head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||
|
<title>LogServ Manual</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="d0e1"></a>LogServ Manual</h2></div></div><div></div><hr></div><div class="toc"><dl><dt>1. <a href="#d0e28">Prerequisites and Installation.</a></dt><dd><dl><dt>1.1. <a href="#d0e54">Compiling and Installation</a></dt></dl></dd><dt>2. <a href="#d0e101">Basic Configuration</a></dt><dd><dl><dt>2.1. <a href="#d0e118">LogType</a></dt><dt>2.2. <a href="#d0e165">LOGSIZE SETTING</a></dt><dt>2.3. <a href="#d0e190">LOGAGE SETTING</a></dt></dl></dd><dt>3. <a href="#d0e207">Configuring LogServ to Log Individual Channels</a></dt><dd><dl><dt>3.1. <a href="#d0e227">Adding a Channel</a></dt><dt>3.2. <a href="#d0e252">Deleting a Channel</a></dt><dt>3.3. <a href="#d0e269">Changing Channel Settings</a></dt><dt>3.4. <a href="#d0e288">Viewing the Channel List</a></dt></dl></dd><dt>4. <a href="#d0e301">Misc Commands</a></dt><dd><dl><dt>4.1. <a href="#d0e306">STATS</a></dt><dt>4.2. <a href="#d0e319">VERSION</a></dt><dt>4.3. <a href="#d0e332">ABOUT</a></dt></dl></dd><dt>5. <a href="#d0e345">LogFile Parsers</a></dt></dl></div><p>Welcome to the LogServ Manual. This document will aid you in setting up and running LogServServ on your IRC network.</p><p>LogServ is a basic Channel Logging Module for the NeoStats Services that can log channel activity to a log file for processing by 3rd party programs such as Onis or MircStats. These programs can then produce HTML pages with interesting statistics on the channel activities. </p><p>LogServ is flexible in the logging of channels, and can produce log files in the same format as Xchat, Mirc, EggDrop, or our own custom logging format, meaning you should be able to use just about any IRC Log Parsing program to produce statistics for you.</p><p>Additionally, LogServ can rotate log files based on log file size or age, and place them in a different directory for processing at any time.</p><p>We recomend that you use the Onis Log file parser, as its what we have done our testing with, and additionally, has several neat features that are applicable to logging lots of channels. These are:</p><div class="itemizedlist"><ul type="disc"><li><p>Persistance. You don't need to keep old log files around if you wish your statistics to have a long history, thus saving you valuable file system space</p></li><li><p>Easily Customizable with stylesheets</p></li><li><p>Easily scriptable for processing many channels at once</p></li></ul></div><p>We have provided a sample shell script and Onis configuration file to automatically parse your log files in one go, producing the required output. </p><p>LogServ is Copyright, 2003 by Justin Hammond.</p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e28"></a>1. Prerequisites and Installation.</h2></div></div><div></div></div><p>LogServ is designed to run on Top of NeoStats. The Following requirements at the time of writing are required for NeoStats:</p><div class="itemizedlist"><ul type="disc"><li><p>A Linux or BSD based Server or Shell.</p></li><li><p>A supported IRCd. Currently, Hybrid7, Unreal, Ultimate2.x or Ultimate3.x or NeoIRCd</p></li><li><p>Some basic Unix administration Skill</p></li><li><p>Of Course, a IRC network to connect it all together.</p></li><li><p>Spare disk space and a webserver to display the output</p></li><li><p>A log file parser such as Onis</p></li></ul></div><p>Please refer to the NeoStats website for more information on the requirements</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e54"></a>1.1. Compiling and Installation</h3></div></div><div></div></div><p>As long as you have successfully setup NeoStats, and installed it correctly, Compiling LogServ is very simple and straight forward. First you must extract the f
|
||
|
checking for gcc... gcc
|
||
|
checking for C compiler default output... a.out
|
||
|
checking whether the C compiler works... yes
|
||
|
checking whether we are cross compiling... no
|
||
|
checking for suffix of executables...
|
||
|
checking for suffix of object files... o
|
||
|
checking whether we are using the GNU C compiler... yes
|
||
|
checking whether gcc accepts -g... yes
|
||
|
checking for gcc option to accept ANSI C... none needed
|
||
|
checking for a BSD-compatible install... /usr/bin/install -c
|
||
|
checking for pcre_compile in -lpcre... yes
|
||
|
checking Location of NeoStats...... /home/fish/NeoStats/
|
||
|
checking for /home/fish/NeoStats//include/dl.h... yes
|
||
|
checking Version of NeoStats...... Compatible Version
|
||
|
checking Whether to Enable Debuging...... no
|
||
|
configure: creating ./config.status
|
||
|
config.status: creating Makefile
|
||
|
|
||
|
(*----------------------------------------------------------*)
|
||
|
(| To compile your module, please type 'make' |)
|
||
|
(| If make completes without errors, then you |)
|
||
|
(| Must 'make install', but please be sure that NeoStats |)
|
||
|
(| Is not currently running with a module of the same name |)
|
||
|
(| Running, otherwise Make install will not work |)
|
||
|
(| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |)
|
||
|
(| If you are running a BSD, make install may produce a |)
|
||
|
(| Error, if that is the case, then please manually copy |)
|
||
|
(| opsb.so to the NeoStats/dl directory |)
|
||
|
(| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |)
|
||
|
(*----------------------------------------------------------*)
|
||
|
(| For Support please visit: |)
|
||
|
(| IRC: /server irc.irc-chat.org |)
|
||
|
(| #neostats channel |)
|
||
|
(| WWW: http://www.neostats.net/boards/ |)
|
||
|
(*----------------------------------------------------------*)
|
||
|
(|This Module was written by: |)
|
||
|
(| fish (fish@dynam.ac) |)
|
||
|
(*----------------------------------------------------------*)
|
||
|
</pre><p>If the configuration did not produce a error, you may then move onto Compiling LogServ. Compiling is simply just issuing the "make" command (or "gmake" if you are running BSD):</p><pre class="screen">[Fish@fish-dt]$ make
|
||
|
gcc -c -O2 -Wall -g -ggdb -I/home/fish/NeoStats//include/ -I. logserv.c
|
||
|
gcc -c -O2 -Wall -g -ggdb -I/home/fish/NeoStats//include/ -I. log_processing.c
|
||
|
ld -shared -o logserv.so logserv.o log_processing.o
|
||
|
</pre><p>again, check for Error messages. As long as there are not error messages, "make install" will install LogServ, this README file, and any auxiliary files needed into your NeoStats directory:</p><pre class="screen">[Fish@fish-dt]$ make install
|
||
|
/usr/bin/install -c -m 644 LogServ.so /home/fish/NeoStats//dl/
|
||
|
/usr/bin/install -c -m 644 README.LogServ /home/fish/NeoStats//dl/../doc/
|
||
|
</pre><p>If you receive *ANY* errors at all during the this process, please post them on our Support boards, at http//www.neostats.net/boards/</p><p>Once Installation is complete, you can either configure NeoStats to load LogServ when it starts, or load LogServ via IRC.</p><p>To Configure NeoStats to automatically load LogServ when it boots, add the following line to your "neostats.cfg" file in the NeoStats directory:</p><p><b class="command">LOAD_MODULE logserv</b></p><p>To load LogServ via IRC, you must make sure you have the appropriate permissions and issue the following command:</p><p><b class="command">/msg neostats load logserv</b></p><p>Thats it. LogServ is now loaded and ready for use </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e101"></a>2. Basic Configuration</h2></div></div><div></div></div><p>LogServ is completely configured online via IRC. When you first start up LogServ, it attempts some "Sane" defaults for you get started with, but you should always review these settings as soon as you install. There are a few important settings you may want to review right away. They are:</p><div class="itemizedlist"><ul type="disc"><li><p>LogType is the format we should be logging as (Xchat, Mirc, EggDrop, or LogServ)</p></li><li><p>Logfile size to rotate at (1Mb by default)</p></li><li><p>Logfile age to rotate at (1Hr by default)</p></li></ul></div><p>These are outlined below:</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e118"></a>2.1. LogType</h3></div></div><div></div></div><p>Logtype is the format you wish to perform your logging in. By default, LogServ logs using its own internal logfile format, but as of writting, no external logfile parser supports that format, so you are advised to change it. There are four possible choices:</p><div class="itemizedlist"><ul type="disc"><li><p>0 - LogServ Format. Our own Logging file format</p></li><li><p>1 - EggDrop Format. The Same logging format as the popular EggDrop Bot</p></li><li><p>2 - Mirc Format. This is the same format as the mirc 6.0 series</p></li><li><p>3 - Xchat Format. This is the same format as Xchat 2.0.5 IRC client</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Changing the LogType is imediate, and all new entries into a logfile will start with the new format imediatly. You should stop NeoStats, and remove the files in NeoStats/logs/chanlogs/ directory after changing this setting, so when you next process your log files, it will not be confused by the changing formats. </p></div></li></ul></div><p><span class="bold"><b>Changing the LogFile Format</b></span></p><p>Before starting to log any channels, you should select which format you wish to log in. We recomend Xchat format. To change the LogType, issue the following command:</p><pre class="screen">/msg LogServ set logtype <type></pre><p>Where:</p><p><type> = The Logging format time, indicated by a number from 0 to 3, representing the differnt formats available as outlined above. </p><p>The output is as follows:</p><pre class="screen">>logserv< set logtype 3
|
||
|
-LogServ- LOGTYPE set to 3</pre><p><span class="bold"><b>Viewing the current Logtype setting</b></span></p><p>To view the current logtype selected, simple type:</p><pre class="screen">/msg LogServ set list</pre><p>And all the current settings (the rest will be explained later in this document) are displayed. The output is as follows:</p><pre class="screen">>LogServ< set list
|
||
|
-LogServ- Current LogServ settings:
|
||
|
-LogServ- LOGTYPE: 3 Log Type
|
||
|
-LogServ- LOGSIZE: 2000 Bytes
|
||
|
-LogServ- LOGAGE: 3600 Seconds</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e165"></a>2.2. LOGSIZE SETTING</h3></div></div><div></div></div><p>LogServ stores logs in two places on your Shell. Live logs, or logs that are currently being written are stored in the ~/NeoStats/logs/chanlogs/ directory, and these the logs that are currently being updated. When the log reaches a certian size, or age, it is closed, and moved to a the ~/NeoStats/ChanLogs/ directory where you can process the log files. The LogFile size settings specifies how big a "live log" is allowed to reach before it is moved to the final directory. By default, LogServ will rotate all files larger than 1Mb, and this should be satisfactory for most users. </p><p><span class="bold"><b>Changing the LogSize to switch at. </b></span></p><p>To change the size at which a logfile will switch at, use the following format:</p><pre class="screen">/msg SecureServ set logsize <bytes></pre><p>Where:</p><p><bytes> = if the file is larger than this size, it is "swapped"</p><p>The output is as follows:</p><pre class="screen">>logserv< set logsize 20000
|
||
|
<LogServ> LOGSIZE set to 20000 by Fish
|
||
|
-LogServ- LOGSIZE set to 20000</pre><p><span class="bold"><b>Viewing the current setting</b></span></p><p>Please refer to the previous section.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e190"></a>2.3. LOGAGE SETTING</h3></div></div><div></div></div><p>In addition to the logsize setting above, LogServ will rotate a logfile after it has been opened for a period of time. This is so channels that might not have much activity still get a chance to be updated often.</p><p>The logage setting can be changed via:</p><pre class="screen">/msg LogServ set logage <seconds></pre><p>Where:</p><p><seconds> = The number of seconds the log file must be opened for before rotating. Minium value is 5 minutes, but its recomended not to go under 1 Hour (3600 seconds)</p><p>The output is as follows:</p><pre class="screen">>LogServ< set logage 7200
|
||
|
<LogServ> LOGAGE set to 7200 by Fish
|
||
|
-LogServ- LOGAGE set to 7200</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e207"></a>3. Configuring LogServ to Log Individual Channels</h2></div></div><div></div></div><p>Obviously, we dont want to log every single IRC channel on the network, so you have to tell LogServ what channels you wish to Log. This is fairly basic. You have 4 options:</p><div class="itemizedlist"><ul type="disc"><li><p>Add A channel</p></li><li><p>Delete A channel</p></li><li><p>Change a Channels settings</p></li><li><p>View the Channel list. </p></li></ul></div><p>Each Setting is described in the following section.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e227"></a>3.1. Adding a Channel</h3></div></div><div></div></div><p>Adding a Channel to be logged is instantanous, and the channel will begin logging straight after this command has complete. LogServ will join the channel, but not give itself any channel modes, so the channel owner can decide if it should be OP'd or not. </p><p>The Syntax is:</p><pre class="screen">/msg LogServ chans add <name> <public> <url></pre><p>Where:</p><p><name> = The name of the channel you wish to Log. Must exist on the IRC network.</p><p><public> = Indicates weather to show the channel to non-privledged users in the channel logging list or not. Either the words "public" or "private". If a invalid entry is specified, defaults to Public. Currently doesn't do anything. </p><p><url> = For informational purposes only. Displays the Web Address that users can visit to view the channel statistics. </p><p>The output is as follows:</p><pre class="screen">>logserv< chans add #ircop public http://www.neostats.net
|
||
|
<LogServ> Fish used CHANS
|
||
|
-LogServ- Stats URL is set to http://www.neostats.net
|
||
|
-LogServ- Now Logging #ircop
|
||
|
<LogServ> Fish Activated Logging on #ircop</pre><p>And the channel members of #ircop shall see:</p><pre class="screen">--> LogServ (LogBot@stats.dynam.ac) has joined #ircop
|
||
|
-LogServ/#ircop- Fish Actived Channel Logging on #ircop
|
||
|
-LogServ/#ircop- Stats will be avaiable at http://www.neostats.net when Logs are processed next</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e252"></a>3.2. Deleting a Channel</h3></div></div><div></div></div><p>Deleting a channel from LogServ means it will no longer log any activity in that channel. If the channel is currently active, LogServ shall part the channel, Close the "live log" and move it to its processing directory. </p><p>The Syntax is:</p><pre class="screen">/msg LogServ chans del <name></pre><p>Where:</p><p><name> = The name of a channel we are currently logging. </p><p>The output is as follows:</p><pre class="screen">>LogServ< chans del #ircop
|
||
|
<LogServ> Fish used CHANS
|
||
|
-LogServ- Deleted Channel #ircop
|
||
|
<LogServ> Fish deleted #ircop from Channel Logging</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e269"></a>3.3. Changing Channel Settings</h3></div></div><div></div></div><p>You can change the URL location displayed when viewing the channel list using the chans set command. </p><p>The Syntax is:</p><pre class="screen">/msg logserv chans set URL <name> <newurl></pre><p>Where:</p><p><name> = The channel name you wish to alter</p><p><newurl> = The new URL you wish to set. </p><p>The output is as follows:</p><pre class="screen"><LogServ> Fish used CHANS
|
||
|
-LogServ- Changed URL for #blah to: http://nowhere.com
|
||
|
<LogServ> Fish changed the URL for #blah to: http://nowhere.com</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e288"></a>3.4. Viewing the Channel List</h3></div></div><div></div></div><p>The channel list can be viewed by issuing the following command:</p><pre class="screen">/msg logserv chans list</pre><p>The output is as follows:</p><pre class="screen">-LogServ- Monitored Channel List:
|
||
|
-LogServ- #blah (-) URL: http://nowhere.com
|
||
|
-LogServ- #bl (-) URL: None
|
||
|
-LogServ- #ircop (*) URL: http://www.neostats.net
|
||
|
-LogServ- End Of List.</pre><p>The (-) or (*) indicate if the channel is currently active. </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e301"></a>4. Misc Commands</h2></div></div><div></div></div><p>There are several other commands available. These are documented below:</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e306"></a>4.1. STATS</h3></div></div><div></div></div><p>The stats command shows some basic stats about the Logging Activities. With future versions its expected the amount of information will increase with this command. </p><p>The Syntax is:</p><pre class="screen">/msg LogServ stats</pre><p>And the output is</p><pre class="screen"><LogServ> Fish used STATS
|
||
|
-LogServ- LogServ Stats:
|
||
|
-LogServ- Monitoring 3 channels</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e319"></a>4.2. VERSION</h3></div></div><div></div></div><p>This displays LogServ's Version number</p><p>The Syntax is:</p><pre class="screen">/msg LogServ version</pre><p>And the Output is:</p><pre class="screen"><LogServ> Fish used VERSION
|
||
|
-LogServ- LogServ Version Information
|
||
|
-LogServ- LogServ Version: $Rev: 19 $ Compiled Jan 13 2004 at 20:08:11</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e332"></a>4.3. ABOUT</h3></div></div><div></div></div><p>This displays a brief message to users describing the function of LogServ:</p><p>The Syntax is:</p><pre class="screen">/msg LogServ About</pre><p>And the output is:</p><pre class="screen"><LogServ> Fish used ABOUT
|
||
|
-LogServ- LogServ logs channel activities to produce HTML pages describing some interesting Statistics
|
||
|
-LogServ- about that channel. If you wish to have your channel logged,
|
||
|
-LogServ- please contact the Network Adminstration</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e345"></a>5. LogFile Parsers</h2></div></div><div></div></div><p>As mentioned in the introduction, LogServ only generates Log files, you still need to get some program to create the HTML pages from the logfiles. </p><p>We currently recomend Onis for parsing the logfiles. You can obtain a copy of Onis from http://verplant.org/onis/</p><p>We have provided a Sample Onis Configuration based on Onis 0.4.9, and a shell script that can be executed by Crontab to process all your Logfiles. This sample configuration and Shell script are installed into the ~/NeoStats/ChanLogs/ directory by default.</p><p>This shell script will automatically go through each of the channels logs running Onis to update the HTML pages. At the top of the script are some variables that should be setup to configure where you wish to place the resultant HTML files, and where Onis is installed. You should read the begining of the file OnisDoLogs.sh to figure out what needs to be configured.</p><p>This shell script assumes that you have a webserver on the same shell as NeoStats. If not, its upto the reader to implement some sort of FTP/SCP script to transfer either the logfiles, or the output from Onis to his webserver. </p><p>Additionally, if you are using a different LogFile parser, other than Onis, you will have to develop your own script or method for updating the HTML pages. If you do develop a script for another Logfile Processor, please send us a copy, so we may include it in future versions. </p><p>The logs for each channel are placed into their own directory within the ChanLogs directory, so if you are logging #neostats, The logfiles would be placed in ChanLogs/#neostats. </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p># is a special charactor on most shells and needs to be escaped. So if you wish to change directory to #neostats, you would actually type cd \#neostats. Keep this in mind when developing any scripts. </p></div><p>Each Logfile is timestamped with the time it was rotated out of the logs/chanlogs/ directory, with the format <name>-YYMMDDHHMMSS.log</p></div></div></body></html>
|