Bug 169918

Summary: logwatch doesn't print disk space values for long device paths
Product: Red Hat Enterprise Linux 4 Reporter: Don Buchholz <buchholz>
Component: logwatchAssignee: Ivana Varekova <varekova>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: noarch   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-05 07:04:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Don Buchholz 2005-10-05 05:26:24 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7

Description of problem:
The default logwatch configuration prints a small "Disk Space" table at the end of every daily report.  When reporting disk usage on a filesystem with a long device name (e.g. an LVM logical volume named "/dev/mapper/VGexp00-img00") only the device name will be reported.  

It's a bit of a problem, as the LVM volume(s) are the one(s) I'm really concerned with monitoring for disk usage.



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

How reproducible:
Always

Steps to Reproduce:
1.  Read daily LogWatch report
2.
3.
  

Actual Results:  My daily report now contains:

   ------------------ Disk Space --------------------
   
   /dev/sda2             9.4G  1.6G  7.5G  17% /
   /dev/sda1              99M   11M   83M  12% /boot
   /dev/sda5             7.6G   94M  7.1G   2% /var
   /dev/sda6             7.6G   59M  7.1G   1% /var/www
   /dev/mapper/VGexp00-img00
   
   
   ###################### LogWatch End ######################### 




Expected Results:  I expect to see values for the last filesystem.

   ------------------ Disk Space --------------------
   
   /dev/sda2             9.4G  1.6G  7.5G  17% /
   /dev/sda1              99M   11M   83M  12% /boot
   /dev/sda5             7.6G   94M  7.1G   2% /var
   /dev/sda6             7.6G   59M  7.1G   1% /var/www
   /dev/mapper/VGexp00-img00
                         897G  277G  602G  32% /export/img00
  
   
   ###################### LogWatch End ######################### 




Additional info:

In the script, /etc/log.d/scripts/services/zz-disk_space, the report is generated using the command:

    df -h | grep '^/dev/'

The problem can be solved by adding the "-P" option to df(1):
 
    df -Ph | grep '^/dev/'

My case can be made a bit prettier with:

    df -Ph |
      grep '^/dev/' |
      awk '{printf("%-25s  %6s %6s %6s  %4s %s\n",$1,$2,$3,$4,$5,$6);}'

And we can get our column headers back with:

    df -Ph |
      egrep '^(Filesystem|/dev/)' |
      awk '{printf("%-25s  %6s %6s %6s  %4s %s\n",$1,$2,$3,$4,$5,$6);}'

Comment 1 Ivana Varekova 2005-10-05 07:04:31 UTC

*** This bug has been marked as a duplicate of 152419 ***