Course outline · 0% complete

0/25 lessons0%

Course overview →

Capstone: run the diagnosis

lesson 9-2 · ~13 min · 25/25

Your turn on call

Time to use everything. First you will build the checklist's decision logic as a script, then you will diagnose three real-style tickets from their symptoms alone.

The script takes three findings, in checklist order: the DNS result (ok/fail), the TCP result (ok/fail), and the HTTP status code. It reports the first failing layer with advice, following the rules you know:

  • DNS failed → check the name and the resolver (unit 2)
  • TCP failed → server down or port blocked (unit 3, lesson 9-1)
  • status ≥ 500 → server-side (lesson 4-3)
  • status ≥ 400 → client-side, fix the request
  • otherwise → healthy

Code exercise · bash

Your turn. Complete the diagnose function: an if/elif chain that checks dns, then tcp, then the status code ranges, printing the exact messages shown in the expected output. Compare strings with = and numbers with -ge.

Problem

Ticket 1: a user's script prints "curl: (6) Could not resolve host: api.internal-shop.com". Which layer of the checklist failed? (One word.)

Problem

Ticket 2: dig +short db.example.com returns an IP, ping to it works, but connecting to port 5432 instantly prints "Connection refused". Naming the checklist layers, which one failed? (One word: the protocol at that layer.)

Problem

Ticket 3: curl -I https://shop.example.com works through DNS, TCP, and TLS, then returns "HTTP/1.1 502 Bad Gateway". Whose side needs the fix, client or server? (One word.)

Quiz

Final check. A page loads fine on your phone's mobile data but fails on the office Wi-Fi with a certificate warning naming the company's "SecureFilter" appliance. What is the most precise description of what is happening?