use BWAVGRATE parameter rather than BWMAXRATE
authorSteve Muir <smuir@cs.princeton.edu>
Tue, 14 Mar 2006 15:08:00 +0000 (15:08 +0000)
committerSteve Muir <smuir@cs.princeton.edu>
Tue, 14 Mar 2006 15:08:00 +0000 (15:08 +0000)
pl_mom.pl

index c6ac506..576975e 100755 (executable)
--- a/pl_mom.pl
+++ b/pl_mom.pl
@@ -3,6 +3,7 @@
 use POSIX qw(setsid);
 use Sys::Syslog;
 use Sys::Hostname;
+use RPC::XML;
 #use LWP::Simple;
 
 $debug = 0;
@@ -285,16 +286,16 @@ sub get_slice_limits {
     if (defined %Maxrate) { undef %Maxrate; }
     if (defined %Cutoff)  { undef %Cutoff; }
     if (-e $vservers) {
-       my $result = `grep -H "^BWMAXRATE" $vservers/*.conf`;
+       my $result = `grep -H "^BWAVGRATE" $vservers/*.conf`;
        chomp ($result);
        my @Lines = split(/\n/,$result);
        foreach $line ( @Lines ) {
-           if ($line =~ /\/([^\/]*).conf:BWMAXRATE=(.*)[Mm]bit/) {
+           if ($line =~ /\/([^\/]*).conf:BWAVGRATE=(.*)[Mm]bit/) {
                $slice = $1;
                $limit = $2."Mbit";
                $cutoff = ($2 * 1000000 * 86400)/8;
            } else {
-               if ($line =~ /\/([^\/]*).conf:BWMAXRATE=(.*)[Kk]bit/) {
+               if ($line =~ /\/([^\/]*).conf:BWAVGRATE=(.*)[Kk]bit/) {
                    $slice = $1;
                    $limit = $2."Kbit";
                    $cutoff = ($2 * 1000 * 86400)/8;