[Logcheck-devel] Bug#270455: marked as done (Macros for logcheck.logfiles)

Debian Bug Tracking System owner at bugs.debian.org
Wed Nov 3 22:03:12 UTC 2004


Your message dated Wed, 3 Nov 2004 22:47:22 +0100
with message-id <20041103214722.GE1889 at stro.at>
and subject line Bug#270455: [Logcheck-devel] Bug#270455: logcheck: Add Hostname as a config option
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 7 Sep 2004 13:31:11 +0000
>From joerg at debian.org Tue Sep 07 06:31:10 2004
Return-path: <joerg at debian.org>
Received: from mail.ganneff.de (ganneff.de) [213.146.108.162] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1C4g3s-0004Gc-00; Tue, 07 Sep 2004 06:31:04 -0700
Received: from localhost (localhost [127.0.0.1])
	by ganneff.de (Postfix) with ESMTP id B3618E0379;
	Tue,  7 Sep 2004 15:31:01 +0200 (CEST)
Received: from ganneff.de ([127.0.0.1])
	by localhost (goliath2 [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id 00267-01-4; Tue, 7 Sep 2004 15:31:01 +0200 (CEST)
Received: from maluska.ath.cx (unknown [192.168.146.8])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "maluska.ath.cx", Issuer "ganneff.de" (not verified))
	by ganneff.de (Postfix) with ESMTP id ECDECE0377;
	Tue,  7 Sep 2004 15:31:00 +0200 (CEST)
Received: from spampd.localdomain (localhost [127.0.0.1])
	by maluska.ath.cx (Postfix) with ESMTP id 3A025A000C;
	Tue,  7 Sep 2004 15:30:58 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by maluska.ath.cx (Postfix) with ESMTP id 1E530A0010;
	Tue,  7 Sep 2004 15:30:58 +0200 (CEST)
Received: from maluska.ath.cx ([127.0.0.1])
	by localhost (mail.maluska.ath.cx [192.168.146.8]) (amavisd-new, port 10024)
	with LMTP id 08955-02-4; Tue, 7 Sep 2004 15:30:57 +0200 (CEST)
Received: from vorlon (unknown [192.168.146.29])
	by maluska.ath.cx (Postfix) with SMTP id CFDFEA000C;
	Tue,  7 Sep 2004 15:30:57 +0200 (CEST)
Received: by vorlon (sSMTP sendmail emulation); Tue,  7 Sep 2004 15:28:38 +0200
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Joerg Jaspert <joerg at debian.org>
To: Debian Bug Tracking System <submit at bugs.debian.org>
Subject: logcheck: Add Hostname as a config option
X-Mailer: reportbug 2.64
Date: Tue, 07 Sep 2004 15:28:38 +0200
Message-Id: <20040907133057.CFDFEA000C at maluska.ath.cx>
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at maluska.de
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ganneff.de
Delivered-To: submit at bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

Package: logcheck
Severity: wishlist

Hi

Pasted below is a small diff that lets you set the hostname for the mail
with a switch on the commandline. Helps in system where a central log host
gets the logs for all hosts.

PS: It would be very helpful if logcheck is able to expand variables in the
logfile names.
For example: DATE=`date -d today "+/%Y/%m/%d"`
Filename: /var/log/hosts/foo/${DATE}/syslog

Helps with systems that sort the logfiles in daily subdirs (the easiest logrotating
you can have).

bye
JJ

--- /usr/sbin/logcheck.orig	2004-09-07 15:17:37.000000000 +0200
+++ /usr/sbin/logcheck	2004-09-07 15:24:33.000000000 +0200
@@ -39,7 +39,7 @@
 ATTACK=0
 
 # Set the getopts string
-GETOPTS="c:dhl:L:m:opr:RsS:tTuvw"
+GETOPTS="c:dhl:L:m:opr:RsS:tTuvwH:"
 
 # Get the details for the email message
 # Hostname either fully qualified or not.
@@ -432,6 +432,7 @@
  -u           = enable syslog-summary
  -v           = print version
  -w           = runlevel "workstation"
+ -H	      = set Hostname for the mail subjects
 EOF
 }
 
@@ -543,6 +544,9 @@
 	    debug "Setting REPORTLEVEL to workstation"
 	    REPORTLEVEL="workstation"
 	    ;;
+	H)  debug "Setting HOSTNAME to $OPTARG"
+	    HOSTNAME="$OPTARG"
+	    ;;
 	\?)
 	    usage
 	    exit 1


---------------------------------------
Received: (at 270455-done) by bugs.debian.org; 3 Nov 2004 21:47:26 +0000
>From max at stro.at Wed Nov 03 13:47:26 2004
Return-path: <max at stro.at>
Received: from baikonur.stro.at [213.239.196.228] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1CPSyU-0008W2-00; Wed, 03 Nov 2004 13:47:26 -0800
Received: from localhost (localhost [127.0.0.1])
	by baikonur.stro.at (Postfix) with ESMTP id 076CA5C03C;
	Wed,  3 Nov 2004 22:47:23 +0100 (CET)
Received: from baikonur.stro.at ([127.0.0.1])
	by localhost (baikonur [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 22186-04; Wed, 3 Nov 2004 22:47:22 +0100 (CET)
Received: from sputnik (stallburg.stro.at [128.131.216.190])
	by baikonur.stro.at (Postfix) with ESMTP id 4A43B5C01B;
	Wed,  3 Nov 2004 22:47:22 +0100 (CET)
Received: from max by sputnik with local (Exim 4.34)
	id 1CPSyQ-0001Dh-JT; Wed, 03 Nov 2004 22:47:22 +0100
Date: Wed, 3 Nov 2004 22:47:22 +0100
From: maks attems <debian at sternwelten.at>
To: Todd Troxell <ttroxell at debian.org>, 270455-done at bugs.debian.org
Cc: Joerg Jaspert <joerg at debian.org>
Subject: Re: Bug#270455: [Logcheck-devel] Bug#270455: logcheck: Add Hostname as a config option
Message-ID: <20041103214722.GE1889 at stro.at>
References: <20040907133057.CFDFEA000C at maluska.ath.cx> <20041001210421.GA13024 at rapidpacket.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20041001210421.GA13024 at rapidpacket.com>
User-Agent: Mutt/1.5.6+20040722i
Sender: maximilian attems <max at stro.at>
X-Virus-Scanned: by Amavis (ClamAV) at stro.at
Delivered-To: 270455-done at bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

On Fri, 01 Oct 2004, Todd Troxell wrote:

> On Tue, Sep 07, 2004 at 03:28:38PM +0200, Joerg Jaspert wrote:
> > PS: It would be very helpful if logcheck is able to expand variables in the
> > logfile names.
> > For example: DATE=`date -d today "+/%Y/%m/%d"`
> > Filename: /var/log/hosts/foo/${DATE}/syslog
> 
> Could you not do this from cron with something like
> logcheck -l /var/log/hosts/foo/`date -d today "+/%Y/%m/%d"`/syslog ?
> 
> Thanks for the patch by the way.

well in aboves exampel there one slash is doubled,
but anyway it works, so i'll close the bug.

please answer if you feel this was a misinterpretation
of your wishlist.
anyways thanks for the bugreport.
 
--
maks





More information about the Logcheck-devel mailing list