From 53518603fb9616c76b18d1999e39b29e5358e432 Mon Sep 17 00:00:00 2001 From: medusa Date: Sat, 16 Mar 2024 15:11:49 +0000 Subject: [PATCH] Update docs/tech_docs/linux/linux-troubleshooting.md --- docs/tech_docs/linux/linux-troubleshooting.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/docs/tech_docs/linux/linux-troubleshooting.md b/docs/tech_docs/linux/linux-troubleshooting.md index 6c7d25a..cae2b31 100644 --- a/docs/tech_docs/linux/linux-troubleshooting.md +++ b/docs/tech_docs/linux/linux-troubleshooting.md @@ -1,3 +1,59 @@ +Certainly! Here's a concise, outlined guide focusing on troubleshooting within network, storage, and user stacks on Linux systems, incorporating relevant terms, commands, log locations, and features for effective diagnostics. + +## Linux Troubleshooting Guide Outline + +### 1. Network Stack Troubleshooting +- **Initial Checks** + - `ping localhost` and `ping google.com` for basic connectivity. + - `traceroute google.com` to trace packet routing. +- **Network Configuration** + - `ip addr show` for interface statuses. + - `nslookup google.com` for DNS resolution. +- **Port and Service Availability** + - `sudo netstat -tulnp` for active listening ports and services. + - `sudo nmap -sT localhost` to identify open ports on the local machine. +- **Logs and Monitoring** + - General network errors: `/var/log/syslog` (grep for "network"). + - Service-specific issues: e.g., `/var/log/apache2/error.log`. + +### 2. Storage Stack Troubleshooting +- **Disk Space** + - `df -h` for filesystem disk usage. + - `du -h /var | sort -hr | head -10` for top disk space consumers. +- **Disk Health** + - `sudo smartctl -a /dev/sda` for disk health (Smartmontools). +- **I/O Performance** + - `iostat -xm 2` for I/O stats. + - `vmstat 1 10` for memory, process, and I/O statistics. +- **Filesystem Integrity** + - `sudo fsck /dev/sdX1` (ensure unmounted) for filesystem checks. + +### 3. User Stack Troubleshooting +- **Login Issues** + - `sudo grep 'Failed password' /var/log/auth.log` for failed logins. + - Check user permissions with `ls -l /home/username/`. +- **Resource Utilization** + - `top` or `htop` for real-time process monitoring. + - `ulimit -a` for user resource limits. +- **User-Specific Logs** + - Application logs, e.g., `sudo tail -f /path/to/app/log.log`. +- **Session Management** + - `who` and `last` for login sessions and activity. + +### 4. Creating a Definitive Diagnosis +- **Correlation and Baseline Comparison**: Use monitoring tools to compare current states against known baselines. +- **Advanced Diagnostics**: Employ `strace` for syscall tracing, `tcpdump` for packet analysis, and `perf` for performance issues. + +### 5. Tools and Commands for In-depth Analysis +- **System and Service Status**: `systemctl status `. +- **Performance Monitoring**: `atop`, `sar`, and Grafana with Prometheus for historical data. +- **Configuration Checks**: Verify settings in `/etc/sysconfig`, `/etc/network`, and service-specific configuration files. +- **Security and Permissions**: Review `/var/log/secure` or use `auditd` for auditing access and changes. + +This outline structures the troubleshooting process into distinct areas, providing a logical approach to diagnosing and resolving common Linux system issues. By following these steps and utilizing the outlined tools and commands, administrators can methodically identify and address problems within their systems. + +--- + Creating a focused reference guide for advanced log filtering and analysis, this guide will cover powerful and practical examples using `grep`, `awk`, `sed`, and `tail`. This guide is intended for experienced Linux users who are familiar with the command line and seek to refine their skills in parsing and analyzing log files for troubleshooting and monitoring purposes. ### Log Filtering and Analysis Reference Guide