Implement OS detection and enhance disk monitoring in ServerMonitor

- Added OS detection functionality to the ServerMonitor class, allowing for tailored disk usage and uptime calculations based on the operating system (macOS or Ubuntu).
- Introduced methods for retrieving disk usage and I/O statistics specific to the detected OS.
- Updated the process status check to return uptime information for monitored processes.
- Enhanced the status message format to include disk space emojis and process uptime details.
- Updated tests to reflect changes in process status checks and output formatting.
This commit is contained in:
2025-08-27 20:09:48 +03:00
parent 0b2440e586
commit dc0e5d788c
2 changed files with 195 additions and 25 deletions

View File

@@ -49,10 +49,10 @@ async def test_monitor():
print(f"Uptime: {system_info['system_uptime']}")
print("\n🤖 Проверка статуса процессов...")
voice_status = monitor.check_process_status('voice_bot')
helper_status = monitor.check_process_status('helper_bot')
print(f"Voice Bot: {voice_status}")
print(f"Helper Bot: {helper_status}")
voice_status, voice_uptime = monitor.check_process_status('voice_bot')
helper_status, helper_uptime = monitor.check_process_status('helper_bot')
print(f"Voice Bot: {voice_status} - {voice_uptime}")
print(f"Helper Bot: {helper_status} - {helper_uptime}")
print("\n📝 Тестирование отправки статуса...")
await monitor.send_status_message(system_info)