Bug 151612 - hostonly does not honor arguments correctly
Summary: hostonly does not honor arguments correctly
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: logwatch
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-20 21:19 UTC by Coert Vonk
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-06-27 14:31:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Coert Vonk 2005-03-20 21:19:47 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050224 Firefox/1.0.1 Fedora/1.0.1-1.3.1

Description of problem:
The man page for logwatch states:
       --hostname hostname
              Use hostname for the reports instead of this system#s hostname.
              In addition, if HostLimit is set in /etc/log.d/logwatch.conf,
              then only  logs from this hostname will be processed (where
              appropriate).

Hence, when
 - specifying "HostLimit = yes" in the logwatch.conf file, and
 - passing "--hostname HOSTNAME" on the logwatch command line,
I expect to see only reports for the specified host.

This does not work as expected due to a bug in /etc/log.d/scripts/shared/onlyhost

A simple fix would be:
--- onlyhost-	2005-03-20 12:11:17.996886937 -0800
+++ onlyhost	2005-03-20 12:11:01.506229908 -0800
@@ -13,7 +13,7 @@ if (($ENV{'LOGWATCH_DEBUG'} > 5) and $ho
 }
 
 #If called from a service config file it passes the param as an ARG
-if ($#ARGV == 0) {      #put in or override the host id
+if (length($ARGV[0])) {      #put in or override the host id
         $hostname = $ARGV[0];
 }
 


Version-Release number of selected component (if applicable):
logwatch-5.2.2-1

How reproducible:
Always

Steps to Reproduce:
1. add "HostLimit = yes" to /etc/log.d/logwatch.conf
2. have a /var/log/messages available with logs for different hosts
3. execute watchlog with "--hostname HOSTNAME"

Actual Results:  Will generate reports for all the hosts

Expected Results:  Reports only for the specified host

Additional info:

Comment 1 Ivana Varekova 2005-06-27 14:31:15 UTC
This bug is fixed in the last version (logwatch-6.1.2-1).


Note You need to log in before you can comment on or make changes to this bug.