Merge "Monitor vertica log file size in agent"

This commit is contained in:
Jenkins 2016-07-01 22:33:17 +00:00 committed by Gerrit Code Review
commit cae6a76b58
2 changed files with 5 additions and 1 deletions
monasca_setup/detection

@ -6,6 +6,7 @@ from monasca_agent.common.util import timeout_command
import monasca_setup.agent_config
import monasca_setup.detection
from monasca_setup.detection.utils import find_process_name
from monasca_setup.detection.utils import watch_file_size
from monasca_setup.detection.utils import watch_process_by_username
log = logging.getLogger(__name__)
@ -78,6 +79,9 @@ class Vertica(monasca_setup.detection.Plugin):
self._get_config()
config.merge(watch_process_by_username('dbadmin', 'vertica', self.service, 'vertica'))
log.info("\tWatching the vertica processes.")
config.merge(watch_file_size('/opt/vertica/log', ['adminTools.log'],
file_recursive=False, service=self.service))
log.info("\tWatching the vertica log file size.")
if self._connection_test():
log.info("\tBuilding vertica config.")
instance_config = {'name': 'localhost',

@ -121,7 +121,7 @@ def watch_process_by_username(username, process_name, service=None, component=No
return config
def watch_file_size(directory_name, file_names, file_recursive,
def watch_file_size(directory_name, file_names, file_recursive=False,
service=None, component=None):
"""Takes a directory, a list of files, recursive flag and returns a
Plugins object with the config set.