LLM_Training_Linux_Automation_1_Sample / Linux_Automation_1_Sample.txt
CJJones's picture
Upload Linux_Automation_1_Sample.txt
f4c42e6 verified
UBUNTU LINUX ADVANCED TROUBLESHOOTING SCENARIOS
Generated: Thu Feb 26 06:10:09 MST 2026
Total scenarios: 30000
Features: Dynamic difficulty, system state tracking, progressive degradation
<h>
πŸ“‹ PROBLEM:
System is running slowly and needs investigation. Users report intermittent failures.
πŸ’» SYSTEM CONTEXT:
β€’ OS: Ubuntu 22.04.1 LTS (Jammy Jellyfish)
β€’ Kernel: 5.15.0-56-generic
β€’ Hostname: staging-139-169-41prod
β€’ User: deploy
β€’ Uptime: 9 days, 13:00
β€’ Load average: 0.64, 2.98, 0.60
⚠️ ERROR MESSAGE:
High load average and application timeouts
πŸ” AVAILABLE COMMANDS:
1. kill -9 1
β”” Kill init/systemd process
2. top -b -n 1
β”” Check running processes and resource usage
3. echo 3 > /proc/sys/vm/drop_caches
β”” Drop filesystem caches
4. reboot
β”” Restart the system (drastic)
❓ Which command would you run to troubleshoot this issue?
<eot>
<b>deploy@staging-139-169-41prod:~$ top -b -n 1
<eot><h>πŸ“€ COMMAND OUTPUT:
top - 06:10:09 up 9 day, 5 users, load average: 0.64, 2.98, 0.60
Tasks: 20 total, 2 running, 18 sleeping, 0 stopped, 0 zombie
%Cpu(s): 6.4 us, 14.9 sy, 0.0 ni, 73.7 id, 3.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 5 total, 2 free, 2 used, 1 buff/cache
MiB Swap: 3 total, 3 free, 0 used. 2 avail Mem
PID USER PR NI VIRT RES SHR S %%CPU %%MEM TIME+ COMMAND
1006 root 20 0 634 88 88 S 9.9 2.8 937:28 /usr/sbin/postgresql
1013 root 20 0 218 90 90 S 8.4 0.6 478:53 /usr/sbin/php8.2-fpm
1001 root 20 0 144 79 79 S 8.2 2.3 1065:54 /usr/sbin/ufw
1002 root 20 0 412 63 63 S 8.1 3.2 820:56 /usr/sbin/ssh
1008 mysql 20 0 113 83 83 S 7.5 3.8 425:04 /usr/sbin/mysql
1003 root 20 0 216 70 70 S 7.3 3.1 1304:37 /usr/sbin/php8.1-fpm
1010 root 20 0 434 86 86 S 7.3 0.4 1132:19 /usr/sbin/samba
678 root 20 0 551 78 78 S 7.0 0.4 986:15 /lib/systemd/systemd-udevd
1005 root 20 0 644 42 42 S 6.9 4.6 1430:15 /usr/sbin/snapd
892 systemd+ 20 0 268 78 78 S 6.5 2.7 8:21 /lib/systemd/systemd-timesyncd
<eot><b>πŸ” Root cause: Multiple factors could cause slow performance: high CPU, memory pressure, I/O wait, or network issues.
πŸ”§ Resolution: Use standard Linux troubleshooting tools to identify the bottleneck: top, iostat, vmstat, netstat.
βœ… Verification: Identify the root cause and resolve accordingly.
πŸ“Š System state evolving...
<eot>
<h>
πŸ“‹ PROBLEM:
Nginx fails to start with error 'Address already in use' on port 80. Apache was previously installed but should have been removed.
πŸ’» SYSTEM CONTEXT:
β€’ OS: Ubuntu 20.04.5 LTS (Focal Fossa)
β€’ Kernel: 5.4.0-135-generic
β€’ Hostname: ip-237-151-2prod
β€’ User: dev1
β€’ Uptime: 7 days, 21:00
β€’ Load average: 2.85, 0.62, 0.53
⚠️ ERROR MESSAGE:
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
πŸ” AVAILABLE COMMANDS:
1. ss -tulpn | grep :80
β”” Find which process is using port 80
2. systemctl status nginx
β”” Check nginx status
3. journalctl -u nginx
β”” Check nginx logs
4. systemctl restart nginx
β”” Restart nginx (will likely fail again)
❓ Which command would you run to troubleshoot this issue?
<eot>
<b>dev1@ip-237-151-2prod:~$ ss -tulpn | grep :80
<eot><h>πŸ“€ COMMAND OUTPUT:
tcp LISTEN 0 128 0.0.0.0:80 0.0.0.0:* users:(("apache2",pid=1234,fd=4))
<eot><b>πŸ” Root cause: Another process (likely Apache) is still listening on port 80, preventing nginx from binding.
πŸ”§ Resolution: Find the process using port 80: sudo ss -tulpn | grep :80. Stop the conflicting service: sudo systemctl stop apache2. Then start nginx.
βœ… Verification: Start nginx and verify it's listening on port 80 with 'ss -tulpn | grep :80'.
πŸ“‹ Recommended next steps:
β€’ systemctl stop apache2
β€’ systemctl start nginx
πŸ“Š System state evolving...
<eot>
<h>
πŸ“‹ PROBLEM:
Server load average is 1.6, 3.2, 2.3 and CPU temperature is unusually high at 51.2Β°C. Users report extreme sluggishness.
πŸ’» SYSTEM CONTEXT:
β€’ OS: Ubuntu 23.10 (Mantic Minotaur)
β€’ Kernel: 6.5.0-14-generic
β€’ Hostname: db-94-5-224dev
β€’ User: admin
β€’ Uptime: 20 days, 22:00
β€’ Load average: 1.60, 3.15, 2.25
⚠️ ERROR MESSAGE:
High CPU usage alert from monitoring (99% CPU)
πŸ” AVAILABLE COMMANDS:
1. renice -n 19 -p 9217
β”” Lower process priority
2. killall -9 crypto-miner
β”” Force kill processes by name
3. ps aux --sort=-%cpu | head -5
β”” Find the most CPU-intensive process
4. systemctl isolate multi-user.target
β”” Change runlevel
❓ Which command would you run to troubleshoot this issue?
<eot>
<b>admin@db-94-5-224dev:~$ ps aux --sort=-%cpu | head -5
<eot><h>πŸ“€ COMMAND OUTPUT:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
ubuntu 9371 99.5 3.5 285 10 ? Ss 0:47 /tmp/.crypto-miner
root 1012 9.8 1.5 760 84 ? Ss 0:11 /usr/sbin/cron
root 678 9.7 3.3 456 59 ? Ss 0:50 /lib/systemd/systemd-udevd
root 523 9.7 1.3 438 55 ? Ss 0:20 /lib/systemd/systemd-journald
root 1001 9.6 0.3 967 44 ? Ss 0:53 /usr/sbin/apache2
root 1004 8.9 0.1 877 94 ? Sl 0:19 /usr/sbin/bind9
root 1016 8.2 0.3 719 61 ? Ss 0:32 /usr/sbin/gitlab-runner
root 1000 7.9 2.2 377 34 ? Sl 0:57 /usr/sbin/memcached
root 1015 7.8 0.1 566 23 ? Ss 0:10 /usr/sbin/redis-server
root 1005 7.5 3.3 907 65 ? Ss 0:23 /usr/sbin/rabbitmq-server
root 1014 7.1 2.5 484 91 ? Ss 0:55 /usr/sbin/rsyslog
root 1013 5.9 4.7 363 29 ? Ss 0:49 /usr/sbin/nginx
systemd+ 892 5.3 0.4 222 52 ? Sl 0:05 /lib/systemd/systemd-timesyncd
root 1017 5.0 4.9 506 54 ? Ss 0:25 /usr/sbin/php8.2-fpm
mysql 1008 4.6 3.9 769 63 ? Ss 0:21 /usr/sbin/mysql
root 1002 4.1 3.2 282 27 ? Sl 0:59 /usr/sbin/ufw
root 1007 4.0 3.2 620 62 ? Sl 0:52 /usr/sbin/elasticsearch
root 1010 3.4 4.1 315 43 ? Sl 0:46 /usr/sbin/samba
root 1006 3.1 2.4 318 29 ? Ss 0:32 /usr/sbin/postgresql
root 1011 2.4 4.1 718 63 ? Ss 0:23 /usr/sbin/network-manager
root 2 2.4 2.1 651 48 ? Sl 0:10 [kthreadd]
root 1003 2.4 0.8 164 27 ? Sl 0:05 /usr/sbin/ssh
root 1009 1.3 1.6 110 45 ? Ss 0:20 /usr/sbin/prometheus
root 1 1.0 1.6 401 48 ? Sl 0:47 /sbin/init
root 3 0.0 4.7 514 49 ? Ss 0:04 [ksoftirqd/0]
<eot><b>πŸ” Root cause: A crypto-miner process is consuming 99% CPU. Likely installed through compromised application or vulnerability.
πŸ”§ Resolution: Terminate the process: kill -9 [PID]. Investigate how it was installed and remove the binary. Check for unauthorized access in auth.log.
βœ… Verification: Run 'top' or 'ps aux' to confirm the process is gone. Monitor for reappearance.
πŸ“‹ Recommended next steps:
β€’ kill -9 [PID]
β€’ rm -rf /tmp/.crypto-*
β€’ grep -r 'miner' /var/log/auth.log
πŸ“Š System state evolving...
<eot>
<h>
πŸ“‹ PROBLEM:
User 'web' needs to install a package but gets 'Permission denied' when running apt install. They need to set up a new service.
πŸ’» SYSTEM CONTEXT:
β€’ OS: Ubuntu 23.04 (Lunar Lobster)
β€’ Kernel: 6.2.0-39-generic
β€’ Hostname: app-134-184-151dev
β€’ User: web
β€’ Uptime: 24 days, 6:00
β€’ Load average: 1.03, 0.16, 1.55
⚠️ ERROR MESSAGE:
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
πŸ” AVAILABLE COMMANDS:
1. groups
β”” List user groups
2. cat /etc/sudoers | grep web
β”” Check sudoers file
3. sudo apt update
β”” Try updating package list with sudo
4. id
β”” Check user's group membership
❓ Which command would you run to troubleshoot this issue?
<eot>
<b>web@app-134-184-151dev:~$ id
<eot><h>πŸ“€ COMMAND OUTPUT:
uid=1169(web) gid=1169(web) groups=1169(web),web,adm
<eot><b>πŸ” Root cause: User lacks sudo privileges or is not in the sudo group.
πŸ”§ Resolution: Add user to sudo group: sudo usermod -aG sudo web (as root). Then log out and back in.
βœ… Verification: Run 'sudo apt update' successfully.
πŸ“‹ Recommended next steps:
β€’ sudo usermod -aG sudo web
β€’ newgrp sudo
πŸ“Š System state evolving...
<eot>
<h>
πŸ“‹ PROBLEM:
System is running slowly and needs investigation. Users report intermittent failures.
πŸ’» SYSTEM CONTEXT:
β€’ OS: Ubuntu 23.04 (Lunar Lobster)
β€’ Kernel: 6.2.0-39-generic
β€’ Hostname: worker-243-189-194001
β€’ User: app
β€’ Uptime: 20 days, 3:00
β€’ Load average: 0.54, 0.31, 1.90
⚠️ ERROR MESSAGE:
High load average and application timeouts
πŸ” AVAILABLE COMMANDS:
1. top -b -n 1
β”” Check running processes and resource usage
2. echo 3 > /proc/sys/vm/drop_caches
β”” Drop filesystem caches
3. reboot
β”” Restart the system (drastic)
4. kill -9 1
β”” Kill init/systemd process
❓ Which command would you run to troubleshoot this issue?
<eot>
<b>app@worker-243-189-194001:~$ top -b -n 1
<eot><h>πŸ“€ COMMAND OUTPUT:
top - 06:10:09 up 20 day, 3 users, load average: 0.54, 0.31, 1.90
Tasks: 24 total, 2 running, 21 sleeping, 0 stopped, 0 zombie
%Cpu(s): 5.4 us, 1.6 sy, 0.0 ni, 88.0 id, 1.3 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 12 total, 7 free, 4 used, 2 buff/cache
MiB Swap: 17 total, 16 free, 0 used. 8 avail Mem
PID USER PR NI VIRT RES SHR S %%CPU %%MEM TIME+ COMMAND
1006 root 20 0 182 89 89 S 9.8 3.3 594:58 /usr/sbin/elasticsearch
1008 mysql 20 0 429 81 81 S 9.7 1.0 910:09 /usr/sbin/mysql
1002 root 20 0 859 76 76 S 9.0 3.7 98:38 /usr/sbin/bind9
1003 root 20 0 780 74 74 S 8.3 2.6 1151:10 /usr/sbin/docker
3 root 20 0 601 53 53 S 7.9 3.9 1069:28 [ksoftirqd/0]
1016 root 20 0 549 76 76 S 7.9 0.2 552:21 /usr/sbin/gitlab-runner
678 root 20 0 605 71 71 S 6.6 4.7 1121:29 /lib/systemd/systemd-udevd
1010 root 20 0 553 92 92 S 6.3 3.2 268:37 /usr/sbin/mongodb
1009 root 20 0 330 78 78 S 5.8 2.0 1127:31 /usr/sbin/prometheus
1015 root 20 0 201 18 18 S 5.7 3.8 259:19 /usr/sbin/redis-server
<eot><b>πŸ” Root cause: Multiple factors could cause slow performance: high CPU, memory pressure, I/O wait, or network issues.
πŸ”§ Resolution: Use standard Linux troubleshooting tools to identify the bottleneck: top, iostat, vmstat, netstat.
βœ… Verification: Identify the root cause and resolve accordingly.
πŸ“Š System state evolving...
<eot>
<h>
πŸ“‹ PROBLEM:
User 'dev' reports they cannot write to a configuration file in /etc/nginx/sites-available/ that they need to update for a new site.
πŸ’» SYSTEM CONTEXT:
β€’ OS: Ubuntu 22.04.3 LTS (Jammy Jellyfish)
β€’ Kernel: 5.15.0-91-generic
β€’ Hostname: ip-101-239-69dev
β€’ User: dev
β€’ Uptime: 22 days, 6:00
β€’ Load average: 1.38, 1.79, 1.74
⚠️ ERROR MESSAGE:
Permission denied when saving file with editor
πŸ” AVAILABLE COMMANDS:
1. chmod 777 /etc/nginx/sites-available/default
β”” Give everyone write access (dangerous)
2. sudo -u dev touch /etc/nginx/sites-available/test
β”” Test writing as current user
3. ls -la /etc/nginx/sites-available/
β”” Check file permissions and ownership
4. chown dev:dev /etc/nginx/sites-available/default
β”” Change ownership to current user
❓ Which command would you run to troubleshoot this issue?
<eot>
<b>dev@ip-101-239-69dev:~$ ls -la /etc/nginx/sites-available/
<eot><h>πŸ“€ COMMAND OUTPUT:
total 32
drwxr-xr-x 2 dev dev 4096 26 06 .
drwxr-xr-x 5 dev dev 4096 26 06 ..
-rw-r--r-- 1 root root 1234 26 06 config.properties
-rw-rw-r-- 1 dev dev 567 26 06 document.txt
-rwxr-xr-x 1 dev dev 890 26 06 script.sh
<eot><b>πŸ” Root cause: Regular users don't have write permissions to system configuration directories. Files in /etc are owned by root.
πŸ”§ Resolution: Use sudo to edit the file: sudo nano /etc/nginx/sites-available/default. Or fix permissions if appropriate (not recommended for system files).
βœ… Verification: Successfully save the file with sudo.
πŸ“‹ Recommended next steps:
β€’ sudo nano /etc/nginx/sites-available/default
πŸ“Š System state evolving...
<eot>
<h>
πŸ“‹ PROBLEM:
User 'dev' needs to install a package but gets 'Permission denied' when running apt install. They need to set up a new service.
πŸ’» SYSTEM CONTEXT:
β€’ OS: Ubuntu 22.04.2 LTS (Jammy Jellyfish)
β€’ Kernel: 5.15.0-69-generic
β€’ Hostname: prod-249-85-6402
β€’ User: dev
β€’ Uptime: 16 days, 16:00
β€’ Load average: 2.14, 2.42, 0.02
⚠️ ERROR MESSAGE:
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
πŸ” AVAILABLE COMMANDS:
1. id
β”” Check user's group membership
2. sudo apt update
β”” Try updating package list with sudo
3. groups
β”” List user groups
4. cat /etc/sudoers | grep dev
β”” Check sudoers file
❓ Which command would you run to troubleshoot this issue?
<eot>
<b>dev@prod-249-85-6402:~$ id
<eot><h>πŸ“€ COMMAND OUTPUT:
uid=1021(dev) gid=1021(dev) groups=1021(dev),dev
<eot><b>πŸ” Root cause: User lacks sudo privileges or is not in the sudo group.
πŸ”§ Resolution: Add user to sudo group: sudo usermod -aG sudo dev (as root). Then log out and back in.
βœ… Verification: Run 'sudo apt update' successfully.
πŸ“‹ Recommended next steps:
β€’ sudo usermod -aG sudo dev
β€’ newgrp sudo
πŸ“Š System state evolving...
<eot>