From d76419db5d8b1d7c09fa8a6b1cf6ba20fe60dc97 Mon Sep 17 00:00:00 2001 From: lework Date: Thu, 24 Oct 2019 17:59:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=80=E4=B8=AA=E6=98=AF=E5=BD=93?= =?UTF-8?q?=E4=B8=BB=E6=9C=BA=E6=9C=89critical=E5=92=8Cbad=E4=B8=A4?= =?UTF-8?q?=E7=A7=8D=E9=A1=B9=E7=9B=AE=E6=97=B6=EF=BC=8C=E4=B8=BB=E8=A6=81?= =?UTF-8?q?=E8=A6=81=E6=94=BE=E5=9C=A8critical=E4=B8=AD=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E6=8A=8Abad=E9=A1=B9=E7=9B=AE=E4=BF=A1=E6=81=AF=E6=8E=A5?= =?UTF-8?q?=E7=AE=A1=E8=BF=87=E6=9D=A5=E3=80=82=E4=B8=80=E4=B8=AA=E6=98=AF?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E7=A3=81=E7=9B=98=E5=88=86=E5=8C=BA=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E5=88=86=E5=8C=BA=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/facts_os_check/ansible.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/facts_os_check/ansible.py b/python/facts_os_check/ansible.py index 2a0bd79..78c41ff 100644 --- a/python/facts_os_check/ansible.py +++ b/python/facts_os_check/ansible.py @@ -199,6 +199,10 @@ class Ansible(object): self.check_result['critical'].append(host) if host not in self.check_result['critical_item']: self.check_result['critical_item'][host] = {'critical': [], 'bad': []} + # 将bad项目放置到critical中显示 + if host in self.check_result['bad']: + self.check_result['critical_item'][host]['bad'].extend(self.check_result['bad_item'][host]['bad']) + del self.check_result['bad_item'][host] self.check_result['critical_item'][host]['critical'].append(item) elif now >= self.bad_threshold: @@ -296,9 +300,9 @@ class Ansible(object): self.check_usedutilization(key, 'swap', usedutilization['swap']) for du in usedutilization['disk']: - self.check_usedutilization(key, 'mount_size_' + mount, du['size']) - self.check_usedutilization(key, 'mount_block_' + mount, du['block']) - self.check_usedutilization(key, 'mount_inode_' + mount, du['inode']) + self.check_usedutilization(key, 'mount_size_' + du['mount'], du['size']) + self.check_usedutilization(key, 'mount_block_' + du['mount'], du['block']) + self.check_usedutilization(key, 'mount_inode_' + du['mount'], du['inode']) # self.check_time(key, 'time', iso8601) self.host_data[key]['usedutilization'] = usedutilization