diff --git a/eayunstack-tools.spec b/eayunstack-tools.spec index 4b0f33e..0af7b0f 100644 --- a/eayunstack-tools.spec +++ b/eayunstack-tools.spec @@ -1,6 +1,6 @@ Name: eayunstack-tools Version: 1.1 -Release: 9%{?dist} +Release: 9.1%{?dist} Summary: EayunStack Management tools Group: Application @@ -78,6 +78,9 @@ fi %changelog +* Mon Jul 18 2016 blkart 1.1-9.1 +- commit fae71216655f576667b82c5a984e7aab56c82e73 + * Tue Jun 21 2016 pq <19921207pq@gmail.com> 1.1-9 - commit 7ab007764b21d94b3db7cf2770f69665950e66fa diff --git a/eayunstack_tools/doctor/cls_func.py b/eayunstack_tools/doctor/cls_func.py index 6ed56d2..47130ad 100644 --- a/eayunstack_tools/doctor/cls_func.py +++ b/eayunstack_tools/doctor/cls_func.py @@ -4,6 +4,7 @@ import re from eayunstack_tools.logger import StackLOG as LOG from eayunstack_tools.doctor.utils import run_doctor_on_nodes +from eayunstack_tools.doctor.utils import run_doctor_cmd_on_node # get node list for rabbitmq cluster @@ -49,10 +50,8 @@ def get_haproxy_nodes(): def ceph_check_health(): def _log(func, msg): func('Ceph cluster check faild !') - # FIXME: cause the log module issue, need to send error msg line - # by line - for l in msg.split('\n'): - func(l) + # so much messages, just log the first line + func(msg.splitlines()[0]) (s, o) = commands.getstatusoutput('ceph health') if s != 0: @@ -63,13 +62,9 @@ def _log(func, msg): else: (ss, oo) = commands.getstatusoutput('ceph health detail') if o.startswith('HEALTH_WARN'): - count = len(oo) - if count > 150: - _log(LOG.warn, oo.splitlines()[0]) + _log(LOG.warn, oo) else: - count = len(oo) - if count > 150: - _log(LOG.error, oo.splitlines()[0]) + _log(LOG.error, oo) # get ceph osd status @@ -111,7 +106,8 @@ def check_all_nodes(check_obj): if check_obj == 'ceph': # only need to check one node for ceph cluster ceph_node = node_list[0] - run_doctor_cmd_on_node('controller', ceph_node, check_cmd) + res = run_doctor_cmd_on_node('controller', ceph_node, check_cmd) + LOG.info(res, remote=True) else: nodes = [] for node in node_list: diff --git a/eayunstack_tools/doctor/utils.py b/eayunstack_tools/doctor/utils.py index 0df2262..399b329 100644 --- a/eayunstack_tools/doctor/utils.py +++ b/eayunstack_tools/doctor/utils.py @@ -78,6 +78,9 @@ def newfunc(*a, **kw): return decorate def run_doctor_cmd_on_node(role, node, cmd): + logging.disable(logging.NOTSET) + LOG.info('%s%s Push check cmd to %-13s (%-10s) %s%s' + % ('<', '='*2, node, role, '='*2, '>')) out, err = ssh_connect2(node, cmd, check_all=True) return out + err @@ -88,8 +91,6 @@ def run_doctor_on_nodes(node_list, check_cmd): pile = eventlet.GreenPile() result = [] for node in node_list: - LOG.info('%s%s Push check cmd to %-13s (%-10s) %s%s' - % ('<', '='*2, node['name'], node['role'], '='*2, '>')) pile.spawn(run_doctor_cmd_on_node, node['role'], node['name'], check_cmd) for node, res in zip(node_list, pile): result.append(res)