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 Search this Thread Display Modes
  #1 (permalink)  
Old 03-19-2010, 04:39 PM
Loyal Member
 
Posts: 93
Default Exclude drive from zimbramon diskspace check

Hey guys,

I need to exclude one of the drives on my zimbra server from the disk space check. While 85/95% is sensible for most of the drives, this one in particular is a remote host with several terrabytes of space, so at 85% it still has several hundred gigabytes left.

How can I exclude this one drive from the check? I'm getting emailed every minute or so which is getting annoying.

Cheers, Al
Reply With Quote
  #2 (permalink)  
Old 05-05-2010, 12:31 AM
Starter Member
 
Posts: 1
Default

Hi,

I got the same issue.

To solve it (for Zimbra 6.0.6 OSE), I modified the Perl script /opt/zimbra/libexec/zmstat-df.

In the routine get_df_stat(), I added the lines in red:

Code:
sub get_df_stat() {
    open(DF, "$DF |") || die "Can't open $DF: $!";
    my $dev;
    my @stats;
    while (<DF>) {
         next if ($_ =~ /^Filesystem\s+/);
         my ($space, $used, $avail, $pct, $path);
         if ($_ =~ /^(\S+)\s*$/) {
             $dev = $1;
             next;
         } elsif ($_ =~ /^(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\%\s+(.+)/) {
             $dev   = $1;
             $space = $2;
             $used  = $3;
             $avail = $4;
             $pct   = $5;
             $path  = $6;
         } elsif ($_ =~ /^\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\%\s+(.+)/) {
             $space = $1;
             $used  = $2;
             $avail = $3;
             $pct   = $4;
             $path  = $5;
        }
        next if $dev !~ m#^/#;
        # Check only some paths
        next if ($path !~ m#^/$# and $path !~ m#^/opt/zimbra#);
        push(@stats, {
            path => $path,
            disk => $dev,
            disk_use => $used,
            disk_pct_used => $pct,
            disk_space => $space
        });
    }
    close DF;
    @stats;
}
So disk usage statistics are gathered only for / and /opt/zimbra.

I hope this will help.

Regards,
Philippe
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.