add bwm-ng to monitor the interfaces, added logs instead of prints

parent 755e9693
......@@ -10,6 +10,7 @@ import eventlet
from eventlet import wsgi
from cgi import parse_qs, escape
import thread
import datetime
from routes import Mapper
'''
......@@ -224,6 +225,8 @@ def start_deidtect_server(port):
def deidtectScaling(dic, start_response, environ):
print "got scaling cpu usage update"
print datetime.datetime.now()
print dic
usage = dic.get('usage',None)
......@@ -244,6 +247,7 @@ def deidtectScaling(dic, start_response, environ):
def deidtectWhitelist(dic, start_response, environ):
print "got whitelist route update"
print datetime.datetime.now()
print dic
site = dic.get('site',None)
......@@ -261,6 +265,7 @@ def deidtectWhitelist(dic, start_response, environ):
def deidtectAction(dic, start_response, environ):
print "got deidtectAction request.."
print datetime.datetime.now()
print dic
cmd = dic.get('cmd',None)
idsname = dic.get('idsname',None)
......@@ -278,6 +283,8 @@ def deidtectAction(dic, start_response, environ):
return sendOK(start_response);
def deidtectRemAction(dic, start_response, environ):
print "got deidtectRemAction request.."
print datetime.datetime.now()
cmd = dic.get('cmd',None)
idsname = dic.get('idsname',None)
ryuip = dic.get('ryuip',None)
......
......@@ -20,6 +20,7 @@ from cgi import parse_qs, escape
import thread
from routes import Mapper
import sys
import datetime
from subprocess import Popen, PIPE
LOG.basicConfig(level=LOG.INFO)
......@@ -46,6 +47,7 @@ def sendError(start_response):
COMPUTE_OVS_PATCH_PORT=1
def computeOFlowInstall(dic, start_response):
LOG.info("got computeOFlowInstall rq..")
LOG.info("%s", datetime.datetime.now())
cmd = dic.get('cmd',None)
vlanid = dic.get('vlanid', None)
tunid = dic.get('tunid',None)
......@@ -134,8 +136,8 @@ def computeOFlowInstall(dic, start_response):
computedropoutflow = 'sudo ovs-ofctl del-flows br-int in_port=%d' \
% (int(OVSPORTNUMBER))
LOG.info("%s", computedropoutflow)
'''
ovscmdlist.append(computedropoutflow)
'''
for cmd in ovscmdlist:
p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
......@@ -148,6 +150,7 @@ NET_OVS_BR_INT_PORT=2
NET_OVS_PATCH_PORT=2
def networkOFlowInstall(dic, start_response):
LOG.info("got networkOFlowInstall rq..")
LOG.info("%s", datetime.datetime.now())
cmd = dic.get('cmd',None)
vlanid = dic.get('vlanid', None)
tunname = dic.get('tunname',None)
......
......@@ -3,3 +3,5 @@ cd ~/downloads/deidtect/Code/OpenStack/deidtect-cloud
sudo ps aux | grep cloudOFHelper.py | head -2 | awk '{print $2}' | xargs sudo kill -9 $1
sudo nohup python cloudOFHelper.py &> /tmp/helperlog &
sudo ps -f | grep cloudOFHelper.py
sudo killall bwm-ng
bwm-ng -t 1000 -o csv -u bytes -T rate -C ',' &> /tmp/traffic &
......@@ -3,3 +3,5 @@ cd ~/downloads/deidtect/Code/OpenStack/deidtect-cloud
sudo ps aux | grep wanSDNHelper.py | head -2 | awk '{print $2}' | xargs sudo kill -9 $1
sudo nohup python wanSDNHelper.py &> /tmp/helperlog &
sudo ps -f | grep wanSDNHelper.py
sudo killall bwm-ng
bwm-ng -t 1000 -o csv -u bytes -T rate -C ',' &> /tmp/traffic &
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment