fix: 修改磁盘使用等key值

pull/6891/head
Michael Bai 2021-09-16 14:33:05 +08:00 committed by 老广
parent 3cba8648cb
commit b7a6287925
1 changed files with 2 additions and 3 deletions

View File

@ -39,14 +39,14 @@ class ServerPerformanceCheckUtil(object):
'max_threshold': False, 'max_threshold': False,
'alarm_msg_format': _('The terminal is offline: {name}') 'alarm_msg_format': _('The terminal is offline: {name}')
}, },
'disk_usage': { 'disk_used': {
'default': 0, 'default': 0,
'max_threshold': 80, 'max_threshold': 80,
'alarm_msg_format': _( 'alarm_msg_format': _(
'[Disk] Disk used more than {max_threshold}%: => {value} ({name})' '[Disk] Disk used more than {max_threshold}%: => {value} ({name})'
) )
}, },
'memory_usage': { 'memory_used': {
'default': 0, 'default': 0,
'max_threshold': 85, 'max_threshold': 85,
'alarm_msg_format': _( 'alarm_msg_format': _(
@ -82,7 +82,6 @@ class ServerPerformanceCheckUtil(object):
default = data['default'] default = data['default']
max_threshold = data['max_threshold'] max_threshold = data['max_threshold']
value = getattr(self._terminal.stat, item, default) value = getattr(self._terminal.stat, item, default)
print(value, max_threshold, self._terminal.name, self._terminal.id)
if isinstance(value, bool) and value != max_threshold: if isinstance(value, bool) and value != max_threshold:
return return
elif isinstance(value, (int, float)) and value < max_threshold: elif isinstance(value, (int, float)) and value < max_threshold: