Here’s a simple website uptime checker script in Python that you can use to monitor whether a website is up or down. It uses the requests
library to ping the site and reports the status based on the HTTP response code.
How this works:
-
The script tries to perform a GET request to the given URL.
-
If the response code is 200, it means the website is reachable and considered up.
-
If the status code is anything else, it reports that code.
-
If an exception occurs (timeout, DNS error, no connection), it reports the website as down.
If you want me to write a more advanced uptime checker with features like scheduled checks, email alerts, or a web interface, just ask!
Leave a Reply