Default AMP manage default message

This commit is contained in:
nicolargo 2016-04-30 19:10:25 +02:00
parent eb5ea5d37b
commit 3203d84bc8
5 changed files with 11 additions and 6 deletions

View File

@ -256,6 +256,7 @@ queue=glances_queue
######
[amp_dropbox]
# Use the default AMP which execute the command
enable=true
regex=.*dropbox.*
refresh=3
@ -286,3 +287,9 @@ regex=\/sbin\/init
refresh=30
one_line=true
service_cmd=/usr/bin/service --status-all
[amp_python]
# Monitor all Python scripts
enable=true
regex=.*python.*
refresh=3

View File

@ -73,7 +73,7 @@ class Amp(GlancesAmp):
# """Init the AMP."""
# super(Amp, self).__init__(args=args)
def update(self):
def update(self, process_list):
"""Update the AMP"""
if self.should_update():

View File

@ -65,7 +65,7 @@ class Amp(GlancesAmp):
# """Init the AMP."""
# super(Amp, self).__init__(args=args)
def update(self):
def update(self, process_list):
"""Update the AMP"""
if self.should_update():

View File

@ -64,7 +64,7 @@ class Amp(GlancesAmp):
# """Init the AMP."""
# super(Amp, self).__init__(args=args)
def update(self):
def update(self, process_list):
"""Update the AMP"""
if self.should_update():

View File

@ -108,10 +108,8 @@ class AmpsList(object):
# At least one process is matching the regex
logger.debug("AMPS: {} process detected (PID={})".format(k, amps_list[0]['pid']))
# Call the AMP update method
# TODO: should be non blocking
thread = threading.Thread(target=v.update)
thread = threading.Thread(target=v.update, args=[amps_list])
thread.start()
# v.update()
return self.__amps_dict