Python Prompts Free Prompt

Python Script to Monitor Network Latency (Ping)

Write a Python script that pings multiple hosts and logs response times
☆ Save
Prompt
You are a Python developer. Write a script that uses subprocess or ping3 to ping a list of hosts. The script must: 1) Read hosts from file, 2) Ping each host, 3) Record response time or failure, 4) Log to CSV, 5) Alert if high latency, 6) Run periodically, 7) Provide a summary. Add comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.