Results 1 to 2 of 2

Thread: Exclude drive from zimbramon diskspace check

  1. #1
    MobiusNZ is offline Special Member
    Join Date
    Sep 2007
    Location
    Aoteroa
    Posts
    128
    Rep Power
    7

    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

  2. #2
    psidler is offline Starter Member
    Join Date
    May 2010
    Posts
    1
    Rep Power
    5

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. No spell check after upgrade from 5.18 to 6.01
    By micronaet in forum Installation
    Replies: 0
    Last Post: 09-22-2009, 11:18 AM
  2. Backup Drive Filling up!
    By Ericx in forum Administrators
    Replies: 1
    Last Post: 10-17-2008, 12:37 AM
  3. Backup to External Windows drive
    By soyer38301 in forum Administrators
    Replies: 0
    Last Post: 08-01-2007, 07:09 AM
  4. Linux Firefox Clients Don't Work with Spell Check
    By SiennaWarrior in forum Users
    Replies: 12
    Last Post: 04-03-2006, 10:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •