X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fdcemulator%2Fmonitoring.py;h=875913f90fe5e63535dab7b575a09eb8bef51fe8;hb=6efa9137f3fb89ac42351b0fd3cc76042b4059b0;hp=2e1e0418eeb586890c2039845ad8596448b6de3a;hpb=a5aeb3780d2fa9f7dc13c28d97df2f4c5c087af7;p=osm%2Fvim-emu.git diff --git a/src/emuvim/dcemulator/monitoring.py b/src/emuvim/dcemulator/monitoring.py index 2e1e041..875913f 100755 --- a/src/emuvim/dcemulator/monitoring.py +++ b/src/emuvim/dcemulator/monitoring.py @@ -45,7 +45,8 @@ class to read openflow stats from the Ryu controller of the DCNetwork """ PUSHGATEWAY_PORT = 9091 -CADVISOR_PORT = 8080 +# we cannot use port 8080 because ryu-ofrest api is already using that one +CADVISOR_PORT = 8081 class DCNetworkMonitor(): def __init__(self, net): @@ -96,8 +97,8 @@ class DCNetworkMonitor(): # helper tools # cAdvisor, Prometheus pushgateway are started as external container, to gather monitoring metric in son-emu - self.start_PushGateway() - self.start_cAdvisor() + self.pushgateway_process = self.start_PushGateway() + self.cadvisor_process = self.start_cAdvisor() # first set some parameters, before measurement can start @@ -467,7 +468,7 @@ class DCNetworkMonitor(): logging.warning("Pushgateway not reachable: {0} {1}".format(Exception, e)) - def start_Prometheus(self, port=CADVISOR_PORT): + def start_Prometheus(self, port=9090): # prometheus.yml configuration file is located in the same directory as this file cmd = ["docker", "run", @@ -493,7 +494,7 @@ class DCNetworkMonitor(): logging.info('Start Prometheus Push Gateway container {0}'.format(cmd)) return Popen(cmd) - def start_cAdvisor(self, port=8080): + def start_cAdvisor(self, port=CADVISOR_PORT): cmd = ["docker", "run", "--rm", @@ -521,7 +522,7 @@ class DCNetworkMonitor(): self.prometheus_process.terminate() self.prometheus_process.kill() self._stop_container('prometheus') - + ''' if self.pushgateway_process is not None: logging.info('stopping pushgateway container') self.pushgateway_process.terminate() @@ -533,7 +534,6 @@ class DCNetworkMonitor(): self.cadvisor_process.terminate() self.cadvisor_process.kill() self._stop_container('cadvisor') - ''' def switch_tx_rx(self,metric=''): # when monitoring vnfs, the tx of the datacenter switch is actually the rx of the vnf