There are numerous open-source tools available for troubleshooting operating systems across various aspects like running processes, open ports, network connections, hardware usage (CPU, memory, disk, network), and logs. Below is a categorized list of popular open-source tools that can help with these tasks, primarily focusing on Linux/Unix systems, but some are cross-platform and work on Windows or macOS as well.
- top: Real-time system-monitoring tool for Unix systems, displays CPU and memory usage by processes.
- Alternative: htop (enhanced, user-friendly version with a colorful interface and process management features).
- ps: Displays a snapshot of current processes, highly customizable for filtering and formatting output.
- pidstat (part of sysstat): Monitors individual process statistics like CPU, memory, and I/O usage over time.
- Glances: Cross-platform system-monitoring tool that provides a comprehensive view of processes, CPU, memory, and more in a single interface.
- netstat (part of net-tools): Displays open ports, active connections, and routing tables (though somewhat deprecated in favor of newer tools).
- ss: Modern replacement for netstat, faster and provides detailed socket statistics, including open ports and listening services.
- nmap: Network exploration tool and port scanner, useful for discovering open ports and services on local or remote systems.
- lsof: Lists open files, including network sockets, to identify which processes are using specific ports.
- netstat and ss: As mentioned, both show active network connections, including TCP/UDP states and associated processes.
- iftop: Displays real-time network bandwidth usage by connection, showing active network connections and their data rates.
- nload: Monitors network traffic and bandwidth usage, useful for identifying high-traffic connections.
- Wireshark: Open-source packet analyzer for detailed inspection of network connections and traffic (cross-platform).
- tcpdump: Command-line packet analyzer for capturing and analyzing network traffic, useful for troubleshooting connection issues.
- CPU Usage:
- top/htop: Real-time CPU usage per process and system-wide.
- mpstat (sysstat): Detailed CPU usage statistics, including per-core metrics.
- vmstat: Reports virtual memory and CPU usage statistics.
- Memory Usage:
- free: Displays memory usage (total, used, free, and cached).
- vmstat: Provides memory statistics alongside CPU.
- htop/Glances: Visualizes memory usage by processes.
- Disk Usage:
- df: Reports disk space usage for mounted filesystems.
- du: Estimates file and directory space usage.
- iotop: Monitors disk I/O usage by processes in real-time.
- iostat (sysstat): Provides disk I/O and CPU statistics.
- Network Usage:
- iftop/nload: Real-time network bandwidth monitoring.
- vnstat: Lightweight network traffic monitor with historical data tracking.
- bmon: Bandwidth monitor for network interfaces.
- journalctl (systemd): Queries and displays logs from the systemd journal, widely used in modern Linux distributions.
- tail: Monitors log files in real-time (e.g.,
tail -f /var/log/syslog
). - less/more: Paginates and searches through large log files.
- grep: Filters log files for specific patterns or errors (e.g.,
grep "error" /var/log/messages
). - logrotate: Manages and rotates log files to prevent disk space issues (not for analysis but for log maintenance).
- rsyslog/syslog-ng: Centralized log management systems for collecting, filtering, and storing logs.
- ELK Stack (Elasticsearch, Logstash, Kibana): Open-source suite for centralized log aggregation, analysis, and visualization (more complex setup).
- Nagios Core: Open-source monitoring system for tracking system resources, network services, and logs (requires setup).
- Zabbix: Enterprise-grade monitoring tool for hardware, network, and application performance with log monitoring capabilities.
- Prometheus: Time-series-based monitoring tool with powerful querying, often paired with Grafana for visualizing CPU, memory, disk, and network metrics.
- Cockpit: Web-based interface for Linux server management, including process, network, storage, and log monitoring.
- Wireshark: Packet analysis for network troubleshooting (Linux, Windows, macOS).
- Glances: System monitoring with a web interface (Linux, Windows, macOS).
- Sysdig: System-level monitoring and troubleshooting with detailed insights into processes, network, and disk (Linux, with some Windows support).
- Process Explorer (Windows-specific, open-source alternative to Task Manager): Detailed process and resource usage for Windows systems.
- Most of these tools are available in default package repositories for Linux distributions (e.g.,
apt install htop
on Debian/Ubuntu,yum install htop
on CentOS, orpacman -S htop
on Arch). - For cross-platform tools like Wireshark or Glances, check their official websites or package managers (e.g., Homebrew on macOS, Chocolatey on Windows).
- Some tools like ELK Stack, Nagios, or Zabbix require more complex setup but offer powerful features for large-scale systems.
- For quick troubleshooting: Use htop, ss, iotop, and journalctl for a lightweight, real-time overview.
- For network issues: Combine nmap, Wireshark, and tcpdump for detailed analysis.
- For comprehensive monitoring: Set up Prometheus with Grafana or Zabbix for long-term insights.
- For logs: Start with journalctl or grep for quick checks, and scale to ELK Stack for centralized log management.