Skip to main content
PRACTICE / AUTOMATING IT OPERATIONS / LESSON 04

Infrastructure Monitoring.

Write eight independent Python helpers that validate monitoring policies, classify evidence, track failure streaks and recoveries, compare baselines, compute bounded schedules and prepare accurate handoffs.

8 coding challengesReal PythonAltered input fixturesOffline fictional monitoring

Real Python, simulated monitoring: Your code runs against fictional device records and monitoring samples inside the isolated browser runtime. No network probes, scheduled background tasks, credential access, live tickets or service changes occur. The written lesson includes a separate, optional offline project.

JOELEARNS / PYTHON WORKBENCH

Write it. Run it. Understand it.

Real Python execution, a variable trace and feedback against the requirements. You write the code—answers aren't revealed up front.

Python 3.14 · in-browser
CHALLENGE 01 / 8 · INTERMEDIATE

Validate a scheduled monitor's complete policy

Write monitor_policy(raw). Require a dictionary with exactly host, check, interval_s and timeout_s. host/check must be nonblank strings without newline or carriage-return characters, with check one of https, dns or backup after trimming and lowering. interval_s must be an actual int from 10 through 3600; timeout_s an actual int from 1 through 30 and strictly less than interval_s. Return a NEW dict with uppercase trimmed host, lowercase check, and unchanged numeric values. Return None for any invalid data, extra keys or bool values. Print the normalized host for the fictional sample.

EXPECTED OUTPUTAPP-01
script.py editableCtrl / Cmd + Enter to run
Your code is stored only in session storage when enabled. Never paste secrets. Clearing this option clears saved drafts, not the editor.
Code executes only when you choose Run or Check. No account needed.
HINTS · OPTIONAL

Try solving it before asking for help. Hints never show a completed program.

PYTHON OUTPUTReady

Your printed output and errors will appear here.

VARIABLE TRACER

Run the code, then step through the executed lines to watch variable values change.

About this environment: The Python runtime is loaded on demand from a version-pinned CDN and runs inside a sandboxed, opaque-origin browser frame. Runs have a time limit. OS/network automation is outside this introductory workbench. If your code calls input(), a response panel appears to supply text to those calls. Don't paste secrets or untrusted scripts.

When you finish Practice, use the shared Continue Your Learning Path panel below to mark this milestone complete. Continue to Lesson 05, Safe Remediation & Recovery, through that panel after completing the monitoring clinic; the integrated capstone remains in development.

CONTINUE YOUR LEARNING PATH · AUTOMATING IT OPERATIONS

Ready for Phase 05?

You've reached the end of this Practice module. The next guided step is Safe Remediation & Recovery. You can review your answers or revisit the lesson, but you don't need to return to the course roadmap to find what comes next. Next: milestone 9 of 12.

Your completion marks are saved in this browser only.