Skip to main content

Command Palette

Search for a command to run...

Part 2 - Troubleshooting Linux Scenarios πŸ§‘β€πŸ’»

Published
β€’6 min read
Part 2 - Troubleshooting Linux Scenarios πŸ§‘β€πŸ’»
P

πŸ‘‹ Hello! I'm passionate about DevOps and have over 1+ years of experience in the field. I'm proficient in a variety of cutting-edge technologies and always motivated to expand my knowledge and skills. Let's connect and grow together!

SKILLS:

πŸ”Ή Languages & Runtimes: Python, Shell Scripting, HCL, YAML πŸ”Ή Cloud Technologies: AWS, Microsoft Azure, GCP πŸ”Ή Infrastructure Tools: Docker, Terraform, AWS CloudFormation πŸ”Ή Other Tools: Linux, Git and GitHub Actions, Jenkins, Jira, GitLab (beginner), Docker, AWS DevOps πŸ”Ή Web Development: HTML, CSS, Bootstrap, Python, SQL

Job & Responsibilities:

πŸš€ Improved development efficiency by implementing CI/CD pipelines, resulting in a 30% reduction in deployment time on the test server. πŸ”’ Strengthened deployment and testing reliability by utilizing Docker containers and optimizing Dockerfile, reducing development issues on the test server by 20%. βš™οΈ Automated S3 bucket log creation with Shell scripting, eliminating 100% of manual search and saving 2 hours per week. πŸ“… Scheduled EC2 instance start/stop using Lambda functions and Event Bridge, leading to a 25% decrease in infrastructure costs. πŸ”§ Utilized AWS, Linux, Python, Docker, Shell scripting, Terraform, Jenkins Pipelines, and automation to streamline workflows and improve overall system performance.

I'm very detail-oriented and possess strong written and verbal communication skills. As a high performer with a possibility mindset, I strive to solve problems using efficient approaches.

Let's Connect & Grow:

If you find my profile suitable for the role you are searching for, please feel free to reach out to me at sumanprasad9766@gmail.com.

Issue 1: Unable to connect to a website or an application

πŸ› οΈ Approach / Solution:

β”œβ”€β”€ Ping the server by Hostname and IP Address
β”‚ β”œβ”€β”€ False: Above Troubleshooting Diagram "Server is not reachable or cannot connect"
β”‚ β”œβ”€β”€ True: Check the service availability by using telnet command with port
β”‚ β”‚ β”œβ”€β”€ True: Service is running
β”‚ β”‚ β”œβ”€β”€ False: Service is not reachable or running
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ Check the service status using systemctl or other command
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ Check the firewall/selinux
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ Check the service logs
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ Check the service configuration
└── ...

Issue 2: Unable to get IP Address

πŸ› οΈ Approach / Solution:
β”œβ”€β”€ IP Assignment Methods
β”‚ β”œβ”€β”€ DHCP
β”‚ β”‚ β”œβ”€β”€ Fixed Allocation
β”‚ β”‚ β”œβ”€β”€ Dynamic Allocation
β”‚ β”œβ”€β”€ Static
β”œβ”€β”€ Troubleshooting
β”‚ β”œβ”€β”€ check network setting from virtualization environment like VMware, VirtualBox, or etc
β”‚ β”œβ”€β”€ check the IP address is assigned or not
β”‚ β”œβ”€β”€ check the NIC status from the host side using #lspci, #nmcli, etc
β”‚ β”œβ”€β”€ restart network service
└── ...

Issue 3: Server is not reachable or unable to connect

πŸ› οΈ Approach / Solution:

β”œβ”€β”€ Ping the server by Hostname and IP Address
β”‚ β”œβ”€β”€ Hostname/IP Address is pingable
β”‚ β”‚ β”œβ”€β”€ Issue might be on the client side as server is reachable
β”‚ β”œβ”€β”€ Hostname is not pingable but IP Address is pingable
β”‚ β”‚ β”œβ”€β”€ Could be the DNS issue
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ check /etc/hosts
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ check /etc/resolv.conf
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ check /etc/nsswitch.conf
β”‚ β”‚ β”‚ β”œβ”€β”€ (Optional) DNS can also be defined in the /etc/sysconfig/network-scripts/ifcfg-<interface>
β”‚ β”œβ”€β”€ Hostname/IP Address both are not pingable
β”‚ β”‚ β”œβ”€β”€ Check the other server on its same network to see if there is a Network side access issue or overall something bad
β”‚ β”‚ β”‚ β”œβ”€β”€ False: Issue is not overall network side but it's with that host/server
β”‚ β”‚ β”‚ β”œβ”€β”€ True: Might be an overall network side issue
β”‚ β”‚ β”œβ”€β”€ Logged into the server by Virtual Console, if the server is Powered ON. Check the uptime
β”‚ β”‚ β”œβ”€β”€ Check if the server has the IP and has UP status of Network interface
β”‚ β”‚ β”‚ β”œβ”€β”€ (Optional) Also check IP-related information from /etc/sysconfig/network-scripts/ifcfg-<interface>
β”‚ β”‚ β”œβ”€β”€ Ping the gateway, also check routes
β”‚ β”‚ β”œβ”€β”€ Check Selinux, Firewall rules
β”‚ β”‚ β”œβ”€β”€ Check physical cable connection

Issue 4: Unable to ssh as root or any other user

πŸ› οΈ Approach / Solution:
β”œβ”€β”€ Ping the server by Hostname and IP Address
β”‚ β”œβ”€β”€ False: Above Troubleshooting Diagram "Server is not reachable or cannot connect"
β”‚ β”œβ”€β”€ True: Check the service availability by using telnet command with port
β”‚ β”‚ β”œβ”€β”€ True: Service is running
β”‚ β”‚ β”‚ β”œβ”€β”€ Issue might be on the client side
β”‚ β”‚ β”‚ β”œβ”€β”€ User might be disabled, nologin shell, disabled root login, and other configurations
β”‚ β”‚ β”œβ”€β”€ False: Service is not reachable or running
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ Check the service status using systemctl or other command
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ Check the firewall/selinux
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ Check the service logs
β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ Check the service configuration
└── ...

Issue 5: Disk Space is full issue or add/extend disk space

πŸ› οΈ Approach / Solution:

β”œβ”€β”€ System Performance degradation detection
β”‚ β”œβ”€β”€ Application getting slow/unresponsive
β”‚ β”œβ”€β”€ Commands are not running (For Example: / disk space is full)
β”‚ β”œβ”€β”€ Cannot do logging and other etc
β”œβ”€β”€ Analyse the issue
β”‚ β”œβ”€β”€ df command to find the problematic filesystem space issue
β”œβ”€β”€ Action
β”‚ β”œβ”€β”€ After finding the specific filesystem, use du command in that filesystem to get which files/directories are large
β”‚ β”œβ”€β”€ Compress/remove big files
β”‚ β”œβ”€β”€ Move the items to another partition/server
β”‚ β”œβ”€β”€ Check the health status of the disks using badblocks command (For Example: #badblocks -v /dev/sda)
β”‚ β”œβ”€β”€ Check which process is IO Bound (using iostat)
β”‚ β”œβ”€β”€ Create a link to file/dir
β”œβ”€β”€ New disk addition
β”‚ β”œβ”€β”€ Simple partition
β”‚ β”‚ β”œβ”€β”€ Add disk to VM
β”‚ β”‚ β”œβ”€β”€ Check the new disk with df/lsblk command
β”‚ β”‚ β”œβ”€β”€ fdisk to create partition. Better to have LVM partition
β”‚ β”‚ β”œβ”€β”€ Create filesystem and mount it
β”‚ β”‚ β”œβ”€β”€ fstab entry for persistence
β”‚ β”œβ”€β”€ LVM Partition
β”‚ β”‚ β”œβ”€β”€ Add disk to VM
β”‚ β”‚ β”œβ”€β”€ Check the new disk with df/lsblk command
β”‚ β”‚ β”œβ”€β”€ fdisk to create LVM partition
β”‚ β”‚ β”œβ”€β”€ PV, VG, LV
β”‚ β”‚ β”œβ”€β”€ Create filesystem and mount it
β”‚ β”‚ β”œβ”€β”€ fstab entry for persistence
β”‚ β”œβ”€β”€ Extend LVM partition
β”‚ β”‚ β”œβ”€β”€ Add disk, and create LVM partition
β”‚ β”‚ β”œβ”€β”€ Add LVM partition (PV) in the existing VG
β”‚ β”‚ β”œβ”€β”€ Extend LV and resize filesystem
└── ...

Issue 6: SSL/TLS Certificate Expiry

πŸ› οΈ Approach / Solution:

β”œβ”€β”€ Check SSL/TLS certificate expiration date
β”œβ”€β”€ Confirm the correct certificate is being used
β”œβ”€β”€ Renew the SSL/TLS certificate before expiry
β”œβ”€β”€ Verify that the server's system time is accurate
β”œβ”€β”€ Restart the web server after certificate renewal
β”œβ”€β”€ Ensure the renewed certificate is properly configured
β”œβ”€β”€ Check for any errors in the web server logs
β”œβ”€β”€ Consider automating certificate renewal tasks
β”œβ”€β”€ Monitor SSL/TLS certificate expiry using alerts
└── ...

Issue 7: Database Connection Issue

πŸ› οΈ Approach / Solution:

β”œβ”€β”€ Check if the database service is running
β”œβ”€β”€ Verify database connection parameters (username, password)
β”œβ”€β”€ Test database connectivity using command-line tools
β”œβ”€β”€ Inspect database logs for connection errors
β”œβ”€β”€ Review firewall rules for database port access
β”œβ”€β”€ Confirm network accessibility between application and database servers
β”œβ”€β”€ Check for any recent changes in the database configuration
β”œβ”€β”€ Monitor database resource usage and performance
β”œβ”€β”€ Investigate potential database server load issues
└── ...

Issue 8: Web Application 404 Error

πŸ› οΈ Approach / Solution:

β”œβ”€β”€ Verify that the requested URL is correct
β”œβ”€β”€ Check web server logs for 404 error details
β”œβ”€β”€ Confirm that the file or resource exists on the server
β”œβ”€β”€ Review web server configuration for correct document root
β”œβ”€β”€ Inspect file and directory permissions
β”œβ”€β”€ Clear web browser cache and retry
β”œβ”€β”€ Consider URL rewriting rules if applicable
β”œβ”€β”€ Test with different browsers or devices
β”œβ”€β”€ Investigate if there are any recent website changes
└── ...

Issue 9: Slow Application Response Time

πŸ› οΈ Approach / Solution:
β”œβ”€β”€ Identify bottlenecks using 'top' or 'htop'
β”œβ”€β”€ Monitor application-specific logs for errors or warnings
β”œβ”€β”€ Check for database connection and query performance
β”œβ”€β”€ Review application code for inefficient algorithms
β”œβ”€β”€ Optimize database queries and indexing
β”œβ”€β”€ Investigate potential issues with external API calls
β”œβ”€β”€ Monitor network latency between application components
β”œβ”€β”€ Consider implementing caching mechanisms
β”œβ”€β”€ Optimize server and network configurations
└── ...

Issue 10: High CPU Usage

πŸ› οΈ Approach / Solution:

β”œβ”€β”€ Identify the process causing high CPU usage using top or htop
β”œβ”€β”€ Check if the issue is intermittent or continuous
β”œβ”€β”€ Review logs for any error messages or known issues
β”œβ”€β”€ Inspect running processes and their resource consumption
β”œβ”€β”€ Investigate potential malware or unauthorized processes
β”œβ”€β”€ Consider optimizing or scaling the application
β”œβ”€β”€ Monitor system metrics over time to identify patterns
β”œβ”€β”€ Apply performance tuning based on the specific application
└── ...

More from this blog

D

DeployToCloud

405 posts

πŸ‘‹ Welcome to my Hashnode blog! I'm a DevOps Engineer with 2+ years of experience. Join ~5k followers and explore 320+ blogs on Python, AWS, Docker, Jenkins, Linux, and more. Let's connect & grow πŸš€