mirror of https://github.com/nicolargo/glances.git
Default AMP manage default message
This commit is contained in:
parent
eb5ea5d37b
commit
3203d84bc8
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue