Re: [exim-dev] Announce: "Exilog" - Exim central logging / r…

Top Page
Delete this message
Reply to this message
Author: Sven Hartge
Date:  
To: exim-dev
Subject: Re: [exim-dev] Announce: "Exilog" - Exim central logging / reporting tool
Um 15:57 Uhr am 02.06.05 schrieb Tom Kistner:

> Then run ./exilog_agent.pl as root. You might want to include
> a start/stop procedure for the agent in your Exim rc file. It
> needs to be run from the ./ CWD since otherwise Perl won't
> find its modules.


Try the using "FindBin":

use FindBin;
use FindBin qw($RealBin);
use lib "$RealBin/";

I attached a little patch, which adds the needed code to the agent, the
config module and the cleanup script.

Grüße,
Sven.

--
Sven Hartge -- professioneller Unix-Geek
Meine Gedanken im Netz: http://sven.formvision.de/blog/diff -ur exilog-0.1.orig/exilog.conf exilog-0.1/exilog.conf
--- exilog-0.1.orig/exilog.conf    2005-06-02 15:48:21.000000000 +0200
+++ exilog-0.1/exilog.conf    2005-06-02 22:39:56.000000000 +0200
@@ -16,13 +16,17 @@
       # Keep the server names short (do not use FQDN).
       # Likewise, keep the group names short.
 
-      'foobar' => {
+      'ds9' => {
                      'group' => 'MXes'
                   },
 
-      'fanucci' => {
+      'skuld' => {
                      'group' => 'MXes'
-                   }
+                   },
+
+      'urd' => {
+                     'group' => 'MXes'
+                   },
 
     }, # End of server definitions ----------------------
 
@@ -34,8 +38,8 @@
       # Example for local MySQL server
       'type'     => 'mysql',
       'DBI'      => 'DBI:mysql:database=exilog;',
-      'user'     => 'myuser', 
-      'pass'     => 'mypass'
+      'user'     => 'exilog', 
+      'pass'     => 'glo987bus'
 
       # Example for remote MySQL server
       #'type'     => 'mysql',
@@ -63,19 +67,19 @@
      # The server the agent is running on. MUST
      # be one of the names specified in the
      # 'Servers' section above.
-     'server' => 'foobar',
+     'server' => 'ds9',
 
      # The log(s) to monitor. If you log via syslog,
      # this will only be a single file (typically
      # /var/log/mail). If you use Exim's own logging,
      # you should specify the mainlog and rejectlog here.
      'logs' => [
-                 '/var/log/exim/exim_mainlog',
-                 '/var/log/exim/exim_rejectlog'
+                 '/var/log/exim4/mainlog',
+                 '/var/log/exim4/rejectlog'
                ],
 
      # Path to Exim's queue directory.
-     'queue' => '/var/spool/exim',
+     'queue' => '/var/spool/exim4',
 
      # Delay between two queue listing refreshes.
      # Thirty seconds is reasonable.
@@ -94,7 +98,7 @@
      # of logs. If you run a VERY big shop you might
      # want to reduce this number or buy some more
      # processing power.
-     'cutoff' => 10
+     'cutoff' => 30
       
    }, # End of exilog_cleanup.pl configuration ---------- 
 
diff -ur exilog-0.1.orig/exilog_agent.pl exilog-0.1/exilog_agent.pl
--- exilog-0.1.orig/exilog_agent.pl    2005-03-05 12:12:39.000000000 +0100
+++ exilog-0.1/exilog_agent.pl    2005-06-03 01:09:34.000000000 +0200
@@ -10,6 +10,11 @@
 #
 
 use strict;
+
+use FindBin;
+use FindBin qw($RealBin);
+use lib "$RealBin/";
+
 use exilog_config;
 use POSIX qw( setsid );
 
diff -ur exilog-0.1.orig/exilog_cleanup.pl exilog-0.1/exilog_cleanup.pl
--- exilog-0.1.orig/exilog_cleanup.pl    2005-06-02 14:52:21.000000000 +0200
+++ exilog-0.1/exilog_cleanup.pl    2005-06-03 01:04:37.000000000 +0200
@@ -10,6 +10,11 @@
 #
 
 use strict;
+
+use FindBin;
+use FindBin qw($RealBin);
+use lib "$RealBin/";
+
 use exilog_config;
 use exilog_sql;
 
diff -ur exilog-0.1.orig/exilog_config.pm exilog-0.1/exilog_config.pm
--- exilog-0.1.orig/exilog_config.pm    2004-07-27 15:10:40.000000000 +0200
+++ exilog-0.1/exilog_config.pm    2005-06-03 01:05:42.000000000 +0200
@@ -12,6 +12,11 @@
 package exilog_config;
 use strict;
 
+use FindBin;
+use FindBin qw($RealBin);
+use lib "$RealBin/";
+
+
 BEGIN {
   use Exporter;
   use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
@@ -35,7 +40,7 @@
 
 $version = "0.01";
 
-$config = _read_ph("exilog.conf");
+$config = _read_ph("$RealBin/exilog.conf");
 
 unless ($config) {
   print STDERR "($$) [exilog_config] Can't parse configuration file.\n";