git://git.onelab.eu
/
mom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8a9bace
)
use BWAVGRATE parameter rather than BWMAXRATE
author
Steve Muir
<smuir@cs.princeton.edu>
Tue, 14 Mar 2006 15:08:00 +0000
(15:08 +0000)
committer
Steve Muir
<smuir@cs.princeton.edu>
Tue, 14 Mar 2006 15:08:00 +0000
(15:08 +0000)
pl_mom.pl
patch
|
blob
|
history
diff --git
a/pl_mom.pl
b/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 POSIX qw(setsid);
use Sys::Syslog;
use Sys::Hostname;
+use RPC::XML;
#use LWP::Simple;
$debug = 0;
#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) {
if (defined %Maxrate) { undef %Maxrate; }
if (defined %Cutoff) { undef %Cutoff; }
if (-e $vservers) {
- my $result = `grep -H "^BW
MAX
RATE" $vservers/*.conf`;
+ my $result = `grep -H "^BW
AVG
RATE" $vservers/*.conf`;
chomp ($result);
my @Lines = split(/\n/,$result);
foreach $line ( @Lines ) {
chomp ($result);
my @Lines = split(/\n/,$result);
foreach $line ( @Lines ) {
- if ($line =~ /\/([^\/]*).conf:BW
MAX
RATE=(.*)[Mm]bit/) {
+ if ($line =~ /\/([^\/]*).conf:BW
AVG
RATE=(.*)[Mm]bit/) {
$slice = $1;
$limit = $2."Mbit";
$cutoff = ($2 * 1000000 * 86400)/8;
} else {
$slice = $1;
$limit = $2."Mbit";
$cutoff = ($2 * 1000000 * 86400)/8;
} else {
- if ($line =~ /\/([^\/]*).conf:BW
MAX
RATE=(.*)[Kk]bit/) {
+ if ($line =~ /\/([^\/]*).conf:BW
AVG
RATE=(.*)[Kk]bit/) {
$slice = $1;
$limit = $2."Kbit";
$cutoff = ($2 * 1000 * 86400)/8;
$slice = $1;
$limit = $2."Kbit";
$cutoff = ($2 * 1000 * 86400)/8;