Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Server Stats Cont...

  1. #11
    Join Date
    Feb 2006
    Location
    Southern California
    Posts
    49
    Rep Power
    9

    Default

    Quote Originally Posted by marcmac
    This is weird.
    It's a special talent i have.

    Looks like none of them failed.

    zimbra@dmrmail01:/tmp> /opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogRawLifetime'
    zimbraLogRawLifetime: 31d
    zimbra@dmrmail01:/tmp> /opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogRawLifetime' | sed -e 's/zimbraLogRawLifetime: //'
    31d
    zimbra@dmrmail01:/tmp> /opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogSummaryLifetime'
    zimbraLogSummaryLifetime: 731d
    zimbra@dmrmail01:/tmp> /opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogSummaryLifetime' | sed -e 's/zimbraLogSummaryLifetime: //'
    731d
    zimbra@dmrmail01:/tmp> /opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogSummaryLifetime' | sed -e 's/zimbraLogSummaryLifetime: //'
    731d

    I ran /opt/zimbra/bin/zmlogprocess after the above commands and still returned the text below:

    Aggregating hour disk from 2006-02-16 09:00:00 to 2006-02-16 10:00:00
    Aggregating hour disk from 2006-02-16 10:00:00 to 2006-02-16 11:00:00
    Aggregating day disk from 2006-02-15 00:00:00 to 2006-02-16 00:00:00
    RAW: 31
    sed: -e expression #1, char 28: unterminated `s' command
    grep: write error: Broken pipe
    SUM:
    Pruning raw mta logs from 2006-01-16 00:00:00
    Pruning raw amavis logs from 2006-01-16 00:00:00

    I have been editing some of my SuSE files with Pico. Specifically, the zmlogprocess script and the syslog-ng file. Is it possible i just made a typo somewhere? To troubleshoot that, I undid my changes but the issue still existed, so i am under the assumption that my edits are not the issue. Thanks again.

  2. #12
    Join Date
    Sep 2005
    Posts
    2,103
    Rep Power
    14

    Default

    Pico? That's just wrong....

    Here's the relevant section:
    Code:
    sub pruneLogs {
        my $rawRetention = `/opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogRawLifetime' | sed -e 's/zimbraLogRawLifetime: //'`;
        chomp $rawRetention;
        $rawRetention =~ s/d//;
        print "RAW: $rawRetention\n";
        my $summaryRetention = `/opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogSummaryLifetime' | sed -e 's/zimbraLogSummaryLifetime: //'`;
        chomp $summaryRetention;
        $summaryRetention =~ s/d//;
        print "SUM: $summaryRetention\n";
    
        my $now = time();
    
        my $rawBegin = tsToSqlTime($now - (60*60*24*$rawRetention),1);
        my $summaryBegin = tsToSqlTime($now - (60*60*24*$summaryRetention),1);
    
        my $sth;
    
        print "Pruning raw mta logs from $rawBegin\n";
        $sth = sqlExec ("delete from mta where arrive_time < '".$rawBegin."'");
        print "Pruning raw amavis logs from $rawBegin\n";
        $sth = sqlExec ("delete from amavis where arrive_time < '".$rawBegin."'");
        print "Pruning raw disk logs from $rawBegin\n";
        $sth = sqlExec ("delete from disk_status where time < '".$rawBegin."'");
        print "Pruning summary mta logs from $summaryBegin\n";
        $sth = sqlExec ("delete from mta_aggregate where period_start < '".$summaryBegin."'");
        print "Pruning summary amavis logs from $summaryBegin\n";
        $sth = sqlExec ("delete from amavis_aggregate where period_start < '".$summaryBegin."'");
        print "Pruning summary disk logs from $summaryBegin\n";
        $sth = sqlExec ("delete from disk_aggregate where period_start < '".$summaryBegin."'");
        print "Pruning other raw logs from $rawBegin\n";
        $sth = sqlExec ("delete from raw_logs where log_date < '".$rawBegin."'");
    }
    AFAICT, it's failing on the sed line referring to zimbraLogSummaryLifetime. Does it show up as above (especially the "//" at the end?) Also, be aware that line ends with:
    "//'`" - slash-slash-singlequote-backtick

    One other thing you can try - change the sed calls to a full path (which sed) though I can't see why one would fail, and the other succeed.

    If you can paste that function from your script into the forums (in CODE tags) that may help.

  3. #13
    Join Date
    Feb 2006
    Location
    Southern California
    Posts
    49
    Rep Power
    9

    Default

    Quote Originally Posted by marcmac
    Pico? That's just wrong....
    - LOL

    Here's my code as it exists now. I'm going to look at it closer. Thanks.

    edit - sorry - here is the complete code.

    Code:
    sub pruneLogs {
            my $rawRetention = `/opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogRawLifetime' | sed -e 's/zimbraLogRawLifetime: //'`;
            chomp $rawRetention;
            $rawRetention =~ s/d//;
            print "RAW: $rawRetention\n";
            my $summaryRetention = `/opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogSummaryLifetime' | sed -e 's/zimbraLogSummaryLifetime:
    //'`;
            chomp $summaryRetention;
            $summaryRetention =~ s/d//;
            print "SUM: $summaryRetention\n";
    
                            
            my $now = time();
                                            
            my $rawBegin = tsToSqlTime($now - (60*60*24*$rawRetention),1);
            my $summaryBegin = tsToSqlTime($now - (60*60*24*$summaryRetention),1);
                                            
            my $sth;
                                            
            print "Pruning raw mta logs from $rawBegin\n";
            $sth = sqlExec ("delete from mta where arrive_time < '".$rawBegin."'");
            print "Pruning raw amavis logs from $rawBegin\n";
            $sth = sqlExec ("delete from amavis where arrive_time < '".$rawBegin."'");
            print "Pruning raw disk logs from $rawBegin\n";
            $sth = sqlExec ("delete from disk_status where time < '".$rawBegin."'");
            print "Pruning summary mta logs from $summaryBegin\n";
            $sth = sqlExec ("delete from mta_aggregate where period_start < '".$summaryBegin."'");
            print "Pruning summary amavis logs from $summaryBegin\n";
            $sth = sqlExec ("delete from amavis_aggregate where period_start < '".$summaryBegin."'");
            print "Pruning summary disk logs from $summaryBegin\n";
            $sth = sqlExec ("delete from disk_aggregate where period_start < '".$summaryBegin."'");
            print "Pruning other raw logs from $rawBegin\n";
            $sth = sqlExec ("delete from raw_logs where log_date < '".$rawBegin."'");
    }
    Last edited by DMRDave; 02-16-2006 at 11:48 AM.

  4. #14
    Join Date
    Sep 2005
    Posts
    2,103
    Rep Power
    14

    Default

    Of course, the important line got wrapped...

    You could try this - dump the sed line, and just hardcode the summaryRetention to be 731:
    my $summaryRetention = 731;

  5. #15
    Join Date
    Feb 2006
    Location
    Southern California
    Posts
    49
    Rep Power
    9

    Default

    Thanks for your assistance Marc,

    Looks like it was an unneeded hard return in the code. Embarrassing. The error went away after removing the "return" and stopping and starting the server.

  6. #16
    Join Date
    Sep 2005
    Posts
    2,103
    Rep Power
    14

    Default

    That'll teach you to use pico...


    Glad it's working.

Similar Threads

  1. initializing ldap...FAILED(256)ERROR
    By manjunath in forum Installation
    Replies: 39
    Last Post: 06-07-2013, 10:27 AM
  2. Zimbra fails after working for 2 weeks
    By Linsys in forum Administrators
    Replies: 10
    Last Post: 10-07-2008, 12:42 AM
  3. need advice on configuring zimbra to work with fax server
    By pheonix1t in forum Administrators
    Replies: 0
    Last Post: 07-11-2007, 07:46 PM
  4. Tomcat broken after upgrade to 4
    By dotslashroot in forum Migration
    Replies: 13
    Last Post: 01-31-2007, 05:05 PM
  5. Error 256 on Installation
    By RuinExplorer in forum Installation
    Replies: 5
    Last Post: 10-19-2006, 09:19 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
  •