X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=pl_mom.pl;fp=pl_mom.pl;h=55da825421cfd05761bd8b84de74591491902991;hb=362f757610352a4d8d3b4edd0c22025016e5c5e2;hp=86a56c845dabf990152bf9e2f4132fa51c697045;hpb=8168a433f038fc5cb787e153605a1f349912ee2f;p=mom.git diff --git a/pl_mom.pl b/pl_mom.pl index 86a56c8..55da825 100755 --- a/pl_mom.pl +++ b/pl_mom.pl @@ -197,8 +197,8 @@ sub bandwidth_monitor { $Cap{$slice} = "sent"; bw_cap_mail($slice); if (! $debug) { - log_bandwidth_cap($slice, $bwcap_default); - cap_bandwidth($slice, $bwcap_default); + log_bandwidth_cap($slice, $Maxrate{$slice}); + cap_bandwidth($slice, $Maxrate{$slice}); } } } else { @@ -363,12 +363,12 @@ sub bw_cap_mail { my ($slicename) = @_; my $hostname = hostname(); my $date = get_date(); - my $sent = int($Cutoff{$slicename}/1000000000); + my $sent = int($Cutoff{$slicename}/(1024*1024)); my $bwcap = $Maxrate{$slicename}; send_mail("$alias_addr, $slicename\@slices.planet-lab.org", "$proc capped bandwidth of slice $slicename on $hostname", - "Slice $slicename has transmitted more than ${sent}GB today". + "Slice $slicename has transmitted more than ${sent}MB today". " on $hostname. ". "Its bandwidth will be capped at $bwcap until midnight GMT.". "\n\n$date $hostname bwcap $slicename\n");