From 443108f53d151d6150c3a1baf11f863f189886e0 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 18 Jun 2019 19:54:42 -0400 Subject: [PATCH] Add support for enable/disable keepalive detail --- node-daemon/pvcd.sample.yaml | 4 ++++ node-daemon/pvcd/Daemon.py | 39 +++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/node-daemon/pvcd.sample.yaml b/node-daemon/pvcd.sample.yaml index 74d65550..3f8d6706 100644 --- a/node-daemon/pvcd.sample.yaml +++ b/node-daemon/pvcd.sample.yaml @@ -121,6 +121,10 @@ pvc: stdout_logging: True # log_keepalives: Enable or disable keepalive logging log_keepalives: True + # log_keepalive_cluster_details: Enable or disable node status logging during keepalive + log_keepalive_cluster_details: True + # log_keepalive_storage_details: Enable or disable node storage logging during keepalive + log_keepalive_storage_details: True # console_log_lines: Number of console log lines to store in Zookeeper per VM console_log_lines: 1000 # networking: PVC networking configuration diff --git a/node-daemon/pvcd/Daemon.py b/node-daemon/pvcd/Daemon.py index 832ecd47..c95ae5ac 100644 --- a/node-daemon/pvcd/Daemon.py +++ b/node-daemon/pvcd/Daemon.py @@ -145,6 +145,8 @@ def readConfig(pvcd_config_file, myhostname): 'file_logging': o_config['pvc']['system']['configuration']['logging']['file_logging'], 'stdout_logging': o_config['pvc']['system']['configuration']['logging']['stdout_logging'], 'log_keepalives': o_config['pvc']['system']['configuration']['logging']['log_keepalives'], + 'log_keepalive_cluster_details': o_config['pvc']['system']['configuration']['logging']['log_keepalive_cluster_details'], + 'log_keepalive_storage_details': o_config['pvc']['system']['configuration']['logging']['log_keepalive_storage_details'], 'console_log_lines': o_config['pvc']['system']['configuration']['logging']['console_log_lines'], 'keepalive_interval': o_config['pvc']['system']['fencing']['intervals']['keepalive_interval'], 'fence_intervals': o_config['pvc']['system']['fencing']['intervals']['fence_intervals'], @@ -1130,24 +1132,25 @@ def update_zookeeper(): ), state='t' ) - logger.out( - '{bold}Domains:{nofmt} {domcount} ' - '{bold}Networks:{nofmt} {netcount} ' - '{bold}VM memory [MiB]:{nofmt} {allocmem} ' - '{bold}Free memory [MiB]:{nofmt} {freemem} ' - '{bold}Used memory [MiB]:{nofmt} {usedmem} ' - '{bold}Load:{nofmt} {load}'.format( - bold=logger.fmt_bold, - nofmt=logger.fmt_end, - domcount=this_node.domains_count, - freemem=this_node.memfree, - usedmem=this_node.memused, - load=this_node.cpuload, - allocmem=this_node.memalloc, - netcount=len(network_list) - ), - ) - if enable_storage: + if config['log_keepalive_cluster_details']: + logger.out( + '{bold}Domains:{nofmt} {domcount} ' + '{bold}Networks:{nofmt} {netcount} ' + '{bold}VM memory [MiB]:{nofmt} {allocmem} ' + '{bold}Free memory [MiB]:{nofmt} {freemem} ' + '{bold}Used memory [MiB]:{nofmt} {usedmem} ' + '{bold}Load:{nofmt} {load}'.format( + bold=logger.fmt_bold, + nofmt=logger.fmt_end, + domcount=this_node.domains_count, + freemem=this_node.memfree, + usedmem=this_node.memused, + load=this_node.cpuload, + allocmem=this_node.memalloc, + netcount=len(network_list) + ), + ) + if enable_storage and config['log_keepalive_storage_details']: logger.out( '{bold}Ceph cluster status:{nofmt} {health_colour}{health}{nofmt} ' '{bold}Total OSDs:{nofmt} {total_osds} '