mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-30 11:26:23 +00:00
update health_monitor.py
This commit is contained in:
@@ -2882,21 +2882,21 @@ class HealthMonitor:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
vm_name = self._resolve_vm_name(vmid)
|
vm_name = self._resolve_vm_name(vmid)
|
||||||
display = f"VM {vmid} ({vm_name})" if vm_name else f"VM {vmid}"
|
display = f"VM {vmid} ({vm_name})" if vm_name else f"VM {vmid}"
|
||||||
error_key = f'vm_{vmid}'
|
error_key = f'vm_{vmid}'
|
||||||
if error_key not in vm_details:
|
if error_key not in vm_details:
|
||||||
rec_result = health_persistence.record_error(
|
rec_result = health_persistence.record_error(
|
||||||
error_key=error_key,
|
error_key=error_key,
|
||||||
category='vms',
|
category='vms',
|
||||||
severity='WARNING',
|
severity='WARNING',
|
||||||
reason=f'{display}: QMP command failed or timed out.\n{line.strip()[:200]}',
|
reason=f'{display}: QMP command failed or timed out.\n{line.strip()[:200]}',
|
||||||
details={'id': vmid, 'vmname': vm_name, 'type': 'VM'}
|
details={'id': vmid, 'vmname': vm_name, 'type': 'VM'}
|
||||||
)
|
)
|
||||||
if not rec_result or rec_result.get('type') != 'skipped_acknowledged':
|
if not rec_result or rec_result.get('type') != 'skipped_acknowledged':
|
||||||
issues.append(f'{display}: QMP communication issue')
|
issues.append(f'{display}: QMP communication issue')
|
||||||
vm_details[error_key] = {
|
vm_details[error_key] = {
|
||||||
'status': 'WARNING',
|
'status': 'WARNING',
|
||||||
'reason': f'{display}: QMP command failed or timed out',
|
'reason': f'{display}: QMP command failed or timed out',
|
||||||
'id': vmid,
|
'id': vmid,
|
||||||
'vmname': vm_name,
|
'vmname': vm_name,
|
||||||
'type': 'VM'
|
'type': 'VM'
|
||||||
|
|||||||
@@ -557,7 +557,7 @@ test_vmct() {
|
|||||||
test_system() {
|
test_system() {
|
||||||
header "SYSTEM EVENT TESTS (syslog injection)"
|
header "SYSTEM EVENT TESTS (syslog injection)"
|
||||||
|
|
||||||
# <EFBFBD><EFBFBD>─ Test S1: Authentication failures ──
|
# ── Test S1: Authentication failures ──
|
||||||
log ""
|
log ""
|
||||||
log "${BOLD} Test S1: SSH auth failure injection${NC}"
|
log "${BOLD} Test S1: SSH auth failure injection${NC}"
|
||||||
info "Injecting SSH auth failure messages into syslog."
|
info "Injecting SSH auth failure messages into syslog."
|
||||||
|
|||||||
Reference in New Issue
Block a user