[SOLVED] ZCS 5.0.3 zmdisklog messed up

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
jdell
Outstanding Member
Outstanding Member
Posts: 201
Joined: Fri Sep 12, 2014 10:13 pm

[SOLVED] ZCS 5.0.3 zmdisklog messed up

Postby jdell » Fri Mar 21, 2008 12:09 am

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.


jdell
Outstanding Member
Outstanding Member
Posts: 201
Joined: Fri Sep 12, 2014 10:13 pm

[SOLVED] ZCS 5.0.3 zmdisklog messed up

Postby jdell » Fri Mar 21, 2008 12:22 am

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
jdell
Outstanding Member
Outstanding Member
Posts: 201
Joined: Fri Sep 12, 2014 10:13 pm

[SOLVED] ZCS 5.0.3 zmdisklog messed up

Postby jdell » Fri Mar 21, 2008 12:47 am

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.
mmorse
Ambassador
Ambassador
Posts: 6036
Joined: Fri Sep 12, 2014 10:24 pm

[SOLVED] ZCS 5.0.3 zmdisklog messed up

Postby mmorse » Fri Mar 21, 2008 2:11 am

Nice sleuthing - I'm gonna mark this as solved so other's hunting know there is a solution.

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 12 guests