Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated logging scheme and added additional logging statements. ch… #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def main(argv):
settings.initialize(ctx)

iteration = 0
logger.debug("Settings.cluster:\n %s",
logger.info("Settings.cluster:\n %s",
pprint.pformat(settings.cluster).replace("\n", "\n "))

global_init = collections.OrderedDict()
Expand Down
4 changes: 3 additions & 1 deletion common.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_fqdn_list(nodes):
return ret

def clean_remote_dir (remote_dir):
print "cleaning remote dir %s" % remote_dir
logger.info("cleaning remote dir %s" % remote_dir)
if remote_dir == "/" or not os.path.isabs(remote_dir):
raise SystemExit("Cleaning the remote dir doesn't seem safe, bailing.")

Expand All @@ -115,12 +115,14 @@ def clean_remote_dir (remote_dir):
continue_if_error=False).communicate()

def make_remote_dir(remote_dir):
logger.info("making remote dir %s" % remote_dir)
nodes = settings.getnodes('clients', 'osds', 'mons', 'rgws', 'mds')
pdsh(nodes, 'mkdir -p -m0755 -- %s' % remote_dir,
continue_if_error=False).communicate()


def sync_files(remote_dir, local_dir):
logger.info("sync files between local and remote directories %s and %s" % (local_dir, remote_dir))
nodes = settings.getnodes('clients', 'osds', 'mons', 'rgws', 'mds')

if not os.path.exists(local_dir):
Expand Down
2 changes: 1 addition & 1 deletion log_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def setup_loggers(def_level=logging.DEBUG, log_fname=None):
sh = logging.StreamHandler()
sh.setLevel(def_level)

log_format = '%(asctime)s - %(levelname)s - %(name)-8s - %(message)s'
log_format = '%(asctime)s %(levelname)s %(name)s %(module)s: %(message)s'
colored_formatter = ColoredFormatter(log_format, datefmt="%H:%M:%S")

sh.setFormatter(colored_formatter)
Expand Down
4 changes: 4 additions & 0 deletions monitoring.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import common
import settings
import logging

logger = logging.getLogger("cbt")

def start(directory):
logger.info('starting monitoring')
nodes = settings.getnodes('clients', 'osds', 'mons', 'rgws')
collectl_dir = '%s/collectl' % directory
# perf_dir = '%s/perf' % directory
Expand All @@ -25,6 +28,7 @@ def start(directory):


def stop(directory=None):
logger.info('Stopping monitoring')
nodes = settings.getnodes('clients', 'osds', 'mons', 'rgws')

common.pdsh(nodes, 'killall -SIGINT -f collectl').communicate()
Expand Down
1 change: 0 additions & 1 deletion settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def getnodes(*nodelists):
nodelist, cur)

str_nodes = ','.join(uniquenodes(nodes))
logger.debug("Nodes : %s", str_nodes)
return str_nodes


Expand Down