How elkingranja/systoolkit-python works
Project Type and Purpose
• SysToolKit-Python is a *CLI-based, modular administration, automation, and monitoring toolkit* for Windows and Linux.
• It’s organized as a single, monolithic application that loads discrete “modules” at runtime based on user selection from a text menu.
• Key use cases: system-resource monitoring (CPU, RAM, disk, network), security alerts, backups, user management, scheduled automation, and report generation.
File Structure
• Entry-point: main_utf8.py drives a console menu, reads config.ini, and delegates to modules.
• Modules folder:
• monitor/
• backup/
• alertas/ (alerts)
• seguridad/ (security)
• users/
• automation/
• logs/
• tools/
• Config file template: config_example.ini → user copies to config.ini.
• Build scripts: build_exe.bat, build_exe.sh, SysToolKit.spec, PyInstaller artifacts under build/ and dist/.
• Standalone helper: rootkit_permission_scan.py, and a stray “Nuevo Documento de texto.txt”.
README for Additional Insights
• Confirms Python ≥3.7, CLI menu flow, packaging via PyInstaller.
• Lists core features (monitoring, backups, report generation).
• Mentions external libraries (psutil, fpdf/pdf2docx).
a. Main Components
• CLI Frontend (MainController)
• Configuration Manager
• Module Loader / Dispatcher
• Module Groups (each a logical plugin):
• Monitor Services
• Backup Services
• Alerting Services
• Security Services
• User Management Services
• Automation/Scheduler Services
• Log Management Services
• Utility Tools
• Reporting Engine (PDF/HTML generator)
• Logging Subsystem
• Packaging Layer (PyInstaller build)
• External Dependencies: OS APIs, File System, Cron/Task Scheduler, Email/SMTP, Third-party libraries
b. Relationships & Data Flows
• User → CLI Frontend → Module Loader
• Module Loader ↔ Configuration Manager (reads thresholds, paths, credentials)
• Each Module ↔ OS APIs (psutil, subprocess, file I/O, user/group APIs)
• Monitoring/Security modules → Logging Subsystem → Log files or real-time alerts
• Backup modules → File System / External Drives
• Automation modules → Cron (Linux) or Task Scheduler (Windows)
• Report Generator ← Modules’ output → PDF/HTML files
• Packaging Layer consumes main_utf8.py + modules + dependencies → produces SysToolKit.exe or .pyz
c. Architectural Patterns & Principles
• *Modular/Plugin Architecture*: each functional area lives in its own namespace under modules/
• *Separation of Concerns*: CLI, config, business-logic modules, reporting, and packaging are orthogonal.
• *Adapter Pattern*: modules encapsulate OS-specific calls, abstracted behind a common interface.
• *Factory/Dispatcher*: a central loader instantiates modules based on menu selection.
d. Key Technologies & Frameworks
• Python ≥3.7
• psutil (resource monitoring)
• fpdf or pdf2docx (reports)
• PyInstaller (packaging)
• ConfigParser (config.ini)
• Built-in sched (scheduler) or Windows Task Scheduler via subprocess