Challenge - 5 Problems
Network Monitoring Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of ping command in a monitoring script
What is the output of this command snippet when the host is reachable?
Bash Scripting
ping -c 1 8.8.8.8 | grep '1 packets transmitted' | awk '{print $4, "received"}'
Attempts:
2 left
💡 Hint
Look for the part of the ping output that shows how many packets were received.
✗ Incorrect
The command filters the ping output to show the number of packets received. When the host is reachable, it shows '1 received'.
❓ Configuration
intermediate2:00remaining
Correct crontab entry for running a network check every 5 minutes
Which crontab entry correctly runs a script located at /usr/local/bin/netcheck.sh every 5 minutes?
Attempts:
2 left
💡 Hint
The first field controls minutes and '*/5' means every 5 minutes.
✗ Incorrect
The crontab syntax '*/5 * * * *' runs the command every 5 minutes.
❓ Troubleshoot
advanced3:00remaining
Why does this network monitoring script fail to detect downtime?
Given this script snippet:
#!/bin/bash
ping -c 1 192.168.1.1
if [ $? -eq 0 ]; then
echo "Host is up"
else
echo "Host is down"
fi
Why might it fail to detect downtime correctly?
Bash Scripting
#!/bin/bash ping -c 1 192.168.1.1 if [ $? -eq 0 ]; then echo "Host is up" else echo "Host is down" fi
Attempts:
2 left
💡 Hint
Consider network conditions beyond ping success.
✗ Incorrect
Ping may succeed if ICMP packets are allowed, but the host might still be unreachable for other services due to firewall or routing issues.
🔀 Workflow
advanced3:00remaining
Order the steps to create a basic network monitoring script
Put these steps in the correct order to create a simple network monitoring script that alerts on downtime.
Attempts:
2 left
💡 Hint
Think about the logical flow from script creation to scheduling.
✗ Incorrect
First write the ping script, then check its result, send alert if needed, and finally schedule it.
✅ Best Practice
expert3:00remaining
Best practice for handling false positives in network monitoring scripts
Which approach best reduces false positives when a network monitoring script detects downtime?
Attempts:
2 left
💡 Hint
Think about confirming failure before alerting.
✗ Incorrect
Multiple attempts reduce false alarms caused by transient network issues.