Bug 151612 - hostonly does not honor arguments correctly
hostonly does not honor arguments correctly
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: logwatch (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ivana Varekova
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-20 16:19 EST by Coert Vonk
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-06-27 10:31:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Coert Vonk 2005-03-20 16:19:47 EST
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 10:31:15 EDT
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.