Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-20-2008, 11:09 PM
Project Contributor
 
Posts: 203
Default [SOLVED] ZCS 5.0.3 zmdisklog messed up

Just upgraded ZCS 5.0.2 -> ZCS 5.0.3 on CentOS4. Everything is fine except every 10 minutes (crontab), my inbox get 4 emails (one for each volume) about disk almost being full, except that it is wrong!

For example, here is one of the emails:
Mar 20 21:10:05 zmailserver zimbramon[21131]: 21131:crit: Disk warning: zimbra.mydomain.com /dev/mapper/vg1-vg1_home at 93%

The real usage for home is:
#df -h
/dev/mapper/vg1-vg1_home 45G 562M 43G 2% /home

Diff'ing the 5.0.2 zmdisklog with 5.0.3 shows it was updated. Perhaps it doesn't understand volume groups?

I've temporarily replaced the 5.0.3 version with the 5.0.2 version and the now the mail-bombing has stopped.
Reply With Quote
  #2 (permalink)  
Old 03-20-2008, 11:22 PM
Project Contributor
 
Posts: 203
Default more info

ok, well, looks like the calculation is correct, but the raw data fed to the calculation is messed up. It is wrong in 5.0.2 and 5.0.3. It is just that 5.0.3 sends warning emails.

Here is a log entry:
Mar 20 21:30:03 zmailserver zimbramon[13464]: 13464:info: 2008-03-20 21:30:02, DISK: zimbra.mydomain.com: dev: /dev/mapper/vg1-vg1_home, mp: /home, tot: 45955, avail: 43059

43059/45955 = .936
Reply With Quote
  #3 (permalink)  
Old 03-20-2008, 11:47 PM
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
  #4 (permalink)  
Old 03-21-2008, 01:11 AM
Zimbra Consultant
 
Posts: 5,814
Default

Nice sleuthing - I'm gonna mark this as solved so other's hunting know there is a solution.
__________________
-Mike Morse (MCode151)

ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0