Complete the code to show what monitoring tools check first.
if system_logs.[1]('error') != -1: alert_admin()
The find method returns -1 if the pattern is not found, which helps detect threats early.
Complete the code to trigger an alert when CPU usage is high.
if cpu_usage [1] 80: send_alert('High CPU usage')
The operator > checks if CPU usage is greater than 80%, which indicates a potential threat or overload.
Fix the error in the code that checks for unusual login attempts.
if login_attempts.get('user123', 0) [1] 5: lock_account('user123')
The correct operator is >= to check if login attempts are 5 or more.
Fill both blanks to filter logs for failed login attempts over 3 times.
suspicious_users = {user: count for user, count in login_failures.items() if count [1] [2]The code filters users with failed login counts greater than 3.
Fill both blanks to create a dictionary of IPs with requests over 100.
high_traffic_ips = { ip: count for ip, count in requests.items() if count {BLANK_2}} {{BLANK_2}}The dictionary comprehension starts with {, filters counts greater than 100.
