View Single Post
  #3 (permalink)  
Old 03-20-2008, 11:47 PM
jdell jdell is offline
Project Contributor
 
Posts: 203
Smile [patch] fixed.

The DF command for linux used by zmdisklog is 'df -mlP' which outputs (just using home as example):
Filesystem 1048576-blocks Used Available Capacity Mounted on
/dev/mapper/vg1-vg1_home 45955 562 43059 2% /home

This is parsed correctly by this line:
my (undef, $total, undef, $avail) = split(/\s+/, $df[0]);

But the error is in the next line:
my $pct=int(($avail/$total)*100) if ($total > 0);

This gives $pct the value of 93% which is available disk space, but the following logic assumes that is percent of disk used. You need to subtract that result from 100, or just used the 'Used' value rather than 'Available'.

I opened bug Bug 26216 - [patch] zmdisklog bad logic - reversed disk used with disk available and attached a simple patch.

It is working fine for me now.
Reply With Quote