git://git.onelab.eu
/
nodemanager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
460f8c5
)
to support pl_mom list emails instead of mails to support
author
Faiyaz Ahmed
<faiyaza@cs.princeton.edu>
Thu, 6 Mar 2008 16:01:56 +0000
(16:01 +0000)
committer
Faiyaz Ahmed
<faiyaza@cs.princeton.edu>
Thu, 6 Mar 2008 16:01:56 +0000
(16:01 +0000)
bwmon.py
patch
|
blob
|
history
diff --git
a/bwmon.py
b/bwmon.py
index
ec8c552
..
0e9f78e
100644
(file)
--- a/
bwmon.py
+++ b/
bwmon.py
@@
-32,26
+32,22
@@
import database
from sets import Set
from sets import Set
+# Defaults
+debug = False
+verbose = False
+datafile = "/var/lib/misc/bwmon.dat"
+
try:
sys.path.append("/etc/planetlab")
from plc_config import *
except:
logger.log("bwmon: Warning: Configuration file /etc/planetlab/plc_config.py not found")
try:
sys.path.append("/etc/planetlab")
from plc_config import *
except:
logger.log("bwmon: Warning: Configuration file /etc/planetlab/plc_config.py not found")
- PLC_NAME = "PlanetLab"
- PLC_SLICE_PREFIX = "pl"
- PLC_MAIL_SUPPORT_ADDRESS = "support@planet-lab.org"
- PLC_MAIL_SLICE_ADDRESS = "SLICE@slices.planet-lab.org"
+ logger.log("bwmon: Running in DEBUG mode. Logging to file and not emailing.")
# Constants
seconds_per_day = 24 * 60 * 60
bits_per_byte = 8
# Constants
seconds_per_day = 24 * 60 * 60
bits_per_byte = 8
-# Defaults
-debug = False
-verbose = False
-datafile = "/var/lib/misc/bwmon.dat"
-#nm = None
-
# Burst to line rate (or node cap). Set by NM. in KBit/s
default_MaxRate = int(bwlimit.get_bwcap() / 1000)
default_Maxi2Rate = int(bwlimit.bwmax / 1000)
# Burst to line rate (or node cap). Set by NM. in KBit/s
default_MaxRate = int(bwlimit.get_bwcap() / 1000)
default_Maxi2Rate = int(bwlimit.bwmax / 1000)
@@
-133,13
+129,8
@@
def slicemail(slice, subject, body):
sendmail = os.popen("/usr/sbin/sendmail -N never -t -f%s" % PLC_MAIL_SUPPORT_ADDRESS, "w")
sendmail = os.popen("/usr/sbin/sendmail -N never -t -f%s" % PLC_MAIL_SUPPORT_ADDRESS, "w")
- # PLC and PLE has a separate list for pl_mom messages
- if PLC_MAIL_SUPPORT_ADDRESS == "support@planet-lab.org":
- to = ["pl-mom@planet-lab.org"]
- elif PLC_MAIL_SUPPORT_ADDRESS == "support@planet-lab.eu":
- to = ["pl-mom@planet-lab.eu"]
- else:
- to = [PLC_MAIL_SUPPORT_ADDRESS]
+ # Parsed from MyPLC config
+ to = [PLC_MAIL_MOM_LIST_ADDRESS]
if slice is not None and slice != "root":
to.append(PLC_MAIL_SLICE_ADDRESS.replace("SLICE", slice))
if slice is not None and slice != "root":
to.append(PLC_MAIL_SLICE_ADDRESS.replace("SLICE", slice))