Fixed mon-api false positive.
Change-Id: Ieb002abc470e60a11e75f3d1062978f539ba4385
This commit is contained in:
parent
4e753db893
commit
f45da9f4b8
@ -13,21 +13,17 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class MonPersister(monsetup.detection.Plugin):
|
class MonPersister(monsetup.detection.Plugin):
|
||||||
|
|
||||||
"""Detect mon_persister and setup monitoring.
|
"""Detect mon_persister and setup monitoring.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def _detect(self):
|
def _detect(self):
|
||||||
"""Run detection, set self.available True if the service is detected.
|
"""Run detection, set self.available True if the service is detected.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if monsetup.detection.find_process_cmdline('mon-persister') is not None:
|
if monsetup.detection.find_process_cmdline('mon-persister') is not None:
|
||||||
self.available = True
|
self.available = True
|
||||||
|
|
||||||
def build_config(self):
|
def build_config(self):
|
||||||
"""Build the config as a Plugins object and return.
|
"""Build the config as a Plugins object and return.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
log.info("\tEnabling the mon persister healthcheck")
|
log.info("\tEnabling the mon persister healthcheck")
|
||||||
return dropwizard_health_check('mon-persister', 'http://localhost:8091/healthcheck')
|
return dropwizard_health_check('mon-persister', 'http://localhost:8091/healthcheck')
|
||||||
@ -41,15 +37,18 @@ class MonPersister(monsetup.detection.Plugin):
|
|||||||
|
|
||||||
|
|
||||||
class MonAPI(monsetup.detection.Plugin):
|
class MonAPI(monsetup.detection.Plugin):
|
||||||
|
|
||||||
"""Detect mon_api and setup monitoring.
|
"""Detect mon_api and setup monitoring.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def _detect(self):
|
def _detect(self):
|
||||||
"""Run detection, set self.available True if the service is detected."""
|
"""Run detection, set self.available True if the service is detected."""
|
||||||
if monsetup.detection.find_process_cmdline('mon-api') is not None:
|
monasca_api = monsetup.detection.find_process_cmdline('monasca-api')
|
||||||
|
if monasca_api is not None:
|
||||||
|
# monasca-api can show up in urls and be an arg to this setup program, check port also
|
||||||
|
for conn in monasca_api.connections('inet'):
|
||||||
|
if conn.laddr[1] == 8080:
|
||||||
self.available = True
|
self.available = True
|
||||||
|
return
|
||||||
|
|
||||||
def build_config(self):
|
def build_config(self):
|
||||||
"""Build the config as a Plugins object and return.
|
"""Build the config as a Plugins object and return.
|
||||||
|
Loading…
Reference in New Issue
Block a user