- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Core Tech
Amazon Linux Scripting, Automation & Performance Monitoring
Automate service health checks with Bash, cron, and systemd timers on Amazon Linux 2023; manage an EC2 fleet with AWS Systems Manager Run Command; and diagnose performance bottlenecks using native OS tools paired with a CloudWatch Agent publishing custom memory and disk metrics.
Lab Info
Table of Contents
-
Challenge
Create and schedule automated service health-check scripts using Bash, cron, and systemd timers
- Write a Bash script that monitors
httpd,mariadb, and a custom service, logs structured status lines, and publishes an SNS alert when any service is inactive. - Schedule the script with a cron job in
/etc/cron.d/and verify execution through the system journal. - Refactor the schedule as a
systemdtimer with randomized delay and unified journal logging, then compare the two scheduling mechanisms.
- Write a Bash script that monitors
-
Challenge
Register and manage a fleet of EC2 instances using AWS Systems Manager Run Command
- Confirm that all three fleet instances are registered with Systems Manager and reporting as
Online. - Send a parallel Run Command to apply security patches and restart
httpdacross the fleet, then review per-target status and output. - Diagnose the failure on
fleet-node-2, identify the brokenhttpdsystemd drop-in override as the root cause, apply a targeted fix with a follow-up Run Command, and rerun the patch to bring the fleet to a consistent state.
- Confirm that all three fleet instances are registered with Systems Manager and reporting as
-
Challenge
Diagnose performance bottlenecks and configure CloudWatch Agent for custom OS-level metric monitoring
- Reproduce a CPU spike with
lab-stress.shand trace it to the responsible processes usingtop,vmstat, andps. - Reproduce an I/O spike and identify the runaway disk activity with
iostat. - Apply persistent sysctl network buffer tuning and validate it against an
iperf3server onfleet-node-1before and after. - Configure the CloudWatch Agent to publish
mem_used_percentanddisk_used_percentunder a custom namespace, then create an alarm that transitions fromINSUFFICIENT_DATAtoOKonce metrics flow.
- Reproduce a CPU spike with
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.