Logtrend's StorageServer installation's guide

[logo]

LogTrend

Copyright  2001 by LogTrend http://www.logtrend.org

This software and all affiliated files are Copyright (C) 2001 by Atrid Systmes
under the terms of the GNU General Public License. A copy of this license
entitled "GNU General Public License" is included with the software. The
original text can be found on http://www.gnu.org/copyleft/gpl.html

Permission is granted to copy, distribute and/or modify this document under the
terms of the GNU Free Documentation License, Version 1.1 or any later version
published by the Free Software Foundation; with no Invariant Sections , with no
Front-Cover Texts , and with no Back-Cover Texts. A copy of the license
entitled "GNU Free Documentation License" can be found with this software. The
original text can be found on http://www.gnu.org/copyleft/fdl.html

-------------------------------------------------------------------------------

Table of Contents
1. Introduction
2. Packages installation
3. Database
4. Configuration of the SorageServer
5. Running the StorageServer
6. Adding and updating sources
7. Database consultation

How to install a StorageServer
-------------------------------------------------------------------------------

Chapter 1. Introduction

The goal of this LogTrend module is to store data sent by the agents into a
database.

LogTrend agents send data and alarms to the StorageServer regulerly. This
server adds these informations into a database (mostly PostgreSQL).

To visualise these informations in the database, use the Visu module.

-------------------------------------------------------------------------------

Chapter 2. Packages installation

You need Perl (version >= 5.00503) to run LogTrend. Perl is generaly installed
by default on all popular GNU/Linux and Unix distributions. But you can found
more recent Perl release on http://www.perl.org/

LogTrend is released in CPAN perl packages. To install a LogTrend package, run
the script :
$ tar xvzf LogTrend-packagename-version.tar.gz
$ cd LogTrend-packagename-version
$ perl Makefile.PL           
       This command gives you the list of missing dependencies.

$ make
$ su
password :
# make install
      

-------------------------------------------------------------------------------

Chapter 3. Database

The StorageServer needs a database where to stock the data and alarms for the
agents. For the moment, the StorageServer works with PostgreSQL. You need to
install such a database, version>=6.5.3. PostgresSQL > 7 is highly recommended
because this version has better performances.

    Note: Following commands is only valid for PostgreSQL > 7. With PostgreSQL
    < 7, use destroydb instead of dropdb, and destroyuser instead of dropuser.
   
You need to create a database named logtrend and a PostgreSQL-user named
logtrend. These are the operations you can do for that:

  * su - postgres to become postgres superuser,
   
  * initdb to initialise the databases (only if needed),
   
  * dropdb logtrend and dropuser logtrend to be sure to not have such user nor
    database,
   
  * createdb logtrend: create the database
   
  * createuser logtrend:
   
      + allowed to create databases : n
       
      + allowed to create more new users : n
       
  * add a password for logtrend: psql logtrend and ALTER USER logtrend WITH
    PASSWORD '******';
   
  * you need to create the tables for logtrend database :
    psql logtrend < /usr/share/doc/LogTrend/StorageServer/databasecreation.sql
   
-------------------------------------------------------------------------------

Chapter 4. Configuration of the SorageServer

StorageServer can use a configuration file. You can specify this file name with
the option -f but default file is /etc/LogTrend/StorageServer.conf
<?xml version="1.0" standalone="no"?>
<!DOCTYPE Configuration SYSTEM "Configuration.dtd">
<Configuration>
   <Server Port="9999" SimultaneousConnections="5" Daemon="yes" />
   <DataBase Name="logtrend" Host="laurent" Port="5432" 
             User="logtrend" Password="logtrend" />
</Configuration>
                 
      
This is a very simple file with two tag :

  * Server : contains three attributes.
   
      + Port specify the StorageServer TCP Port (typicaly 9999)
       
      + SimultaneousConnections specify the number of simultaneous connections
        allowed on TCP port.
       
      + Daemon specify if the StorageServer start in daemon mode.
       
  * DataBase : specify database connections parameters (database name, host
    name, port, user name and password)
   
-------------------------------------------------------------------------------

Chapter 5. Running the StorageServer

To run the StorageServer, you have the choise between to methods:

  * run it in direct command line: just run StorageServer
   
  * instal an init.d file, and start it (or put the good links into the way to
    be run a system start).
   
-------------------------------------------------------------------------------

Chapter 6. Adding and updating sources

In aim to have agent running, you need to declare sources. A source represents
a system (a computer for example).

For adding a new source, use the AddSource utility. You have to run this
utility only one time for a source.

Its parameters are:

  * -d (mandatory): the name of the database (typicaly logtrend),
   
  * -H (optional): the host name of the database (default localhost),
   
  * -P (optional): the post of the database (default 5432),
   
  * -u (mandatory): the user for database connection (typicaly logtrend),
   
  * -p (mandatory): the password for this user,
   
  * -k (mandatory): the source GnuPG public key file name,
   
  * -i (optional, can appear several times): optional informations about the
    source.
   
The -i parameter take as argument a string formed of two parts: variable=value.
For example: Name=foo.bar.tld or IP=10.0.1.7

Authentication is done using GnuPG signature. All not signed messages will be
automatically rejected by the StorageServer. A GnuPG key pair can be created
using genkeys.pl or directly via the gpg command lines. The public key must be
sent to the database server. The private key MUST be kept secret. Everybody
having your secret key can be authenticated as you by the StorageServer. See
the GnuPG documentation for more informations on the signature, encryption and
crytography.

You can change you source's public key with UpdateSource.

Its parameters are:

  * -d (mandatory): the name of the database (typicaly logtrend),
   
  * -H (optional): the host name of the database (default localhost),
   
  * -P (optional): the post of the database (default 5432),
   
  * -u (mandatory): the user for database connection (typicaly logtrend),
   
  * -p (mandatory): the password for this user,
   
  * -k (mandatory): the new source GnuPG public key file name,
   
  * -s (mandatory): the source's number to update.
   
-------------------------------------------------------------------------------

Chapter 7. Database consultation

You can check that a source is really declared by selecting data in sources SQL
table. A new line must appear.

You can check that an agent is really declared by selecting data in agents SQL
table. A new line must appear.

You can check that an agent have really send data and alarms by selecting data
in agents SQL table. The field lastconnectiondate must contains a date.

For these requests, you can use the in-line command psql or a utility as
phpPgAdmin.

If you want to see the data and the alarms, you can select in database tables
or (it's an advice) use the Visu module.

