Changeset b9900b86093edc07950e16dba23a395a2cb5c7e7

Show
Ignore:
Timestamp:
11/14/07 15:47:17 (6 years ago)
Author:
Sergey Ivanov <seriv@omniti.com>
git-committer:
Sergey Ivanov <seriv@omniti.com> 1195055237 +0000
git-parent:

[0de23ddddf6da73d57dae2f1dafc3e0b26f6685f]

git-author:
Sergey Ivanov <seriv@omniti.com> 1195055237 +0000
Message:

fixes

git-svn-id: https://labs.omniti.com/resmon/trunk@56 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Resmon/Module/FRESHSVN.pm

    r3f19192 rb9900b8  
    2626  if($ur == $mr){ return($arg->set_status("OK(rev:$ur)")); } 
    2727  else{ 
     28    my ($cY,$cM,$cD,$ch,$cm,$cs) = split (/ /, `date '+%Y %m %d %H %M %S'`); 
     29    my $cTime=$cs+60*($cm+60*($ch+24*($cD+31*($cM+12*$cY)))); 
     30    my $dNow = "$cM/$cD/$cY $ch:$cm:$cs"; chomp $dNow; 
    2831    my ($uY,$uM,$uD,$uh,$um,$us); 
    2932    for(@ulines) { 
     
    3235      } 
    3336    } 
    34     my $routput = cache_command("/opt/omni/bin/svn info --username svnsync --password Athi3izo  --no-auth-cache --non-interactive $URL\@$mr", 60); 
    35     my @rlines = split (/\n/,$routput); 
    36     my ($mY,$mM,$mD,$mh,$mm,$ms); 
    37     for(@rlines) { 
    38        if (/^Last Changed Date:\s*(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{2}):(\d{2})/) { 
    39          ($mY,$mM,$mD,$mh,$mm,$ms) = ($1,$2,$3,$4,$5,$6); 
    40        } 
    41     } 
    42     my ($mTime,$uTime,$lag,$maxlag); 
    43     $mTime=$ms+60*($mm+60*($mh+24*($mD+31*($mM+12*$mY)))); 
    44     $uTime=$us+60*($um+60*($uh+24*($uD+31*($uM+12*$uY)))); 
    45     $lag=$uTime-$mTime; 
    46     $maxlag=$arg->{'maxlag'}*60 || 330; 
     37    my $uTime = $us+60*($um+60*($uh+24*($uD+31*($uM+12*$uY)))); 
     38    my $dCommitted = "$uM/$uD/$uY $uh:$um:$us"; 
     39    my $lag=$cTime-$uTime; 
     40    my $maxlag=$arg->{'maxlag'}*60 || 330; 
    4741    if ($lag <= $maxlag){ 
    4842      return($arg->set_status("OK(delay = $lag < $maxlag)"));  
    4943    } 
    50     elsif ($us+60*($um+60*($uh+24*$uD))<$maxlag) { 
    51       my ($cD,$ch,$cm,$cs) = split ( / /, `date '+%d %H %M %S'`); 
    52       my $cTime = $cs+60*($cm+60*($ch+24*$cD)); 
    53       if ($cTime<$maxlag) { 
    54         return($arg->set_status("WARNING(check unreliable, check later)")); 
    55       } 
    56       else { 
    57         return($arg->set_status("BAD(my rev:$mr, repo rev:$ur, delay: $lag > $maxlag)")); 
    58       } 
     44    elsif ( ( ($us+60*($um+60*($uh+24*$uD))) < $maxlag )  
     45         && ( ($cs+60*($cm+60*($ch+24*$cD))) < 2 * $maxlag ) 
     46          ) 
     47    { 
     48      return($arg->set_status("WARNING(check unreliable, check later)")); 
    5949    } 
    6050    else { 
    61       return($arg->set_status("BAD(my rev:$mr, repo rev:$ur, delay: $lag > $maxlag)")); 
     51      return($arg->set_status("BAD(now $dNow, my rev:$mr, repo rev:$ur, committed: $dCommitted)")); 
    6252    } 
    6353  }