Results 1 to 4 of 4

Thread: Disk Stats. - How do I change target partition?

  1. #1
    Robert Mortimer is offline Active Member
    Join Date
    Apr 2006
    Posts
    31
    Rep Power
    9

    Default Disk Stats. - How do I change target partition?

    My Zimbra is on a machine that boots from a single HDD but the mail store is on a mounted LVM partition sitting on top of a RAID array.

    The Disk Use stats shows me use for the boot drive. How can I change this to the mounted /opt/zimbra partition?

    I have looked at "zmprov GetAllConfig" and there does not seem to be a config parameter that would fit.

    Any Ideas
    Rob

  2. #2
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    I am not infront of a Zimbra server but you could take a look at /opt/zimbra/libexec/zmdisklog to see how it identifies the disks. Perhaps it is not picking up lvols.

  3. #3
    Robert Mortimer is offline Active Member
    Join Date
    Apr 2006
    Posts
    31
    Rep Power
    9

    Default

    The volume detection is by "mount -t ext3"

    On my machine this reports

    /dev/mapper/VGBootDrive-root on / type ext3 (rw)
    /dev/sda1 on /boot type ext3 (rw)
    /dev/mapper/VGRaid-mail on /mnt/raid/mail type ext3 (rw)
    /dev/mapper/VGBootDrive-install_media on /mnt/bootdrive/install_media type ext3 (rw)

    These are the boot drive (/), boot partition (non LVM) /boot and my raid mounted mail store (/mnt/raid/mail) respectively. /mnt/raid/mail is hard linked to /opt/zimbra

    Disk use is via "df -mlP"

    On my machine this reports

    /dev/mapper/VGBootDrive-root 77495 22492 51004 31% /
    /dev/sda1 99 42 52 45% /boot
    tmpfs 940 0 940 0% /dev/shm
    /dev/mapper/VGRaid-mail 100794 1553 95146 2% /mnt/raid/mail
    /dev/mapper/VGBootDrive-install_media 50397 5826 42011 13% /mnt/bootdrive/install_media

    The script takes the mounts line by line and splits them to get the mount point. It then does a regex on the df output to find the required line. This line is then split to get the required stats. My machine only reports disk use for the last line!

    Any pointers. The code looks good to my in-expert eye.


    Rob
    Last edited by Robert Mortimer; 04-11-2008 at 03:57 AM.

  4. #4
    Robert Mortimer is offline Active Member
    Join Date
    Apr 2006
    Posts
    31
    Rep Power
    9

    Default

    I modded /opt/zimbra/libexec/zmdisklog to just run the disk stats code as follows
    -Perl Code rendered as PHP
    PHP Code:
    #!/usr/bin/perl
    #
    # ***** BEGIN LICENSE BLOCK *****
    #
    # Zimbra Collaboration Suite Server
    # Copyright (C) 2005, 2006, 2007 Zimbra, Inc.
    #
    # The contents of this file are subject to the Yahoo! Public License
    # Version 1.0 ("License"); you may not use this file except in
    # compliance with the License.  You may obtain a copy of the License at
    # http://www.zimbra.com/license.
    #
    # Software distributed under the License is distributed on an "AS IS"
    # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
    #
    # ***** END LICENSE BLOCK *****
    #

    use strict;


    my $TIMEOUT=60;
    my $MNTCMD;
    my $DFCMD;
    my $DISK_CRIT_THRESHOLD 90;
    my $DISK_WARN_THRESHOLD 80;

    $MNTCMD "mount -t ext3";
    $DFCMD "df -mlP ";

    my $dt = `date "+%Y-%m-%d %H:%M:%S"`;
    chomp $dt;

    my @mounts = ();
    open MOUNTS"$MNTCMD |" or die "Can't open $MNTCMD: $!";
    @
    mounts = <MOUNTS>;
    close MOUNTS;
    foreach 
    my $m (@mounts) {
            
    chomp $m;
            
    my ($dev,undef,$mp) = split(/\s+/,$m);
            print 
    "$dev\n";
            
    open DF"$DFCMD \"$dev\" | tail -1 |" or die "Can't open $DFCMD: $!";
            
    my @df = <DF>;
            
    close DF;
            
    my (undef$total$used$avail) = split(/\s+/, $df[0]);
            print 
    "total $total\n";
            print 
    "used $used\n";
            print 
    "avail $avail\n";
            
    my $pct=int(($used/$total)*100) if ($total 0);
            
    my $lvl "info";
            
    $lvl "err" if ($pct $DISK_WARN_THRESHOLD);
            
    $lvl "crit" if ($pct $DISK_CRIT_THRESHOLD);

    Unfortunately it worked perfectly and gave the following output

    /dev/mapper/VGBootDrive-root
    total 77495
    used 22499
    avail 50997
    /dev/sda1
    total 99
    used 42
    avail 52
    /dev/mapper/VGRaid-mail
    total 100794
    used 1553
    avail 95146
    /dev/mapper/VGBootDrive-install_media
    total 50397
    used 5826
    avail 42011

    Any pointers welcome.

    Rob

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Daily mail report always reports "No messages found"
    By McPringle in forum Installation
    Replies: 42
    Last Post: 06-13-2011, 08:57 AM
  2. [SOLVED] Changed Backup Target Did Not Change For LDAP
    By rfoster in forum Administrators
    Replies: 4
    Last Post: 11-13-2007, 04:42 PM
  3. [SOLVED] admin console disk stats graph
    By padraig in forum Administrators
    Replies: 7
    Last Post: 07-17-2007, 06:29 AM
  4. Web client logon fails (INVALID_PDU)
    By jermxx in forum Installation
    Replies: 8
    Last Post: 02-20-2007, 02:20 PM
  5. Tomcat broken after upgrade to 4
    By dotslashroot in forum Migration
    Replies: 13
    Last Post: 01-31-2007, 06:05 PM

Posting Permissions

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