A console-based Python application that monitors the performance and availability of websites. Users can define websites and specify check intervals, and the application continuously tracks the uptime and response times for each website.
- Monitor the uptime and response time of multiple websites.
- Customizable check intervals for each website.
- Console-based interface.
- Colored output for success, warnings, and errors.
- URL validation to ensure valid website entries.
-
Clone the repository:
git clone https://github.com/yourusername/website-monitor-console.git cd website-monitor-console
-
Install dependencies using Poetry:
poetry install
-
Activate the virtual environment:
poetry shell
If you prefer to use pip
, you can also install the dependencies via a requirements.txt
file:
-
Clone the repository:
git clone https://github.com/yourusername/website-monitor-console.git cd website-monitor-console
-
Install the dependencies:
pip install -r requirements.txt
-
Run the application:
python main.py
-
Enter the website URLs you want to monitor. Make sure the URLs start with
http://
orhttps://
. You can enter multiple websites. -
For each website, enter the check interval (in seconds) for how often the app should check that website.
-
Once you're done entering websites, type
done
to start the monitoring process. -
The app will continuously monitor each website, providing colored output for:
- Green: Website is UP with response time.
- Yellow: Website is DOWN but returned an HTTP status code.
- Red: Website is DOWN due to a network or connection error.
$ python main.py
Enter a website URL (or type 'done' to finish): https://example.com
Enter the check interval in seconds for https://example.com: 30
Enter a website URL (or type 'done' to finish): https://anotherwebsite.com
Enter the check interval in seconds for https://anotherwebsite.com: 60
Enter a website URL (or type 'done' to finish): done
Starting website monitoring... Press Ctrl+C to stop.
Website https://example.com is UP. Response time: 120 ms.
Website https://anotherwebsite.com is DOWN. Status Code: 404.
To stop monitoring, press Ctrl+C
in the terminal.
requests
- For making HTTP requests.colorama
- For colored output in the terminal.validators
- For URL validation.charset-normalizer
,certifi
,idna
, andurllib3
- Dependency libraries used byrequests
.
These dependencies are automatically installed when using poetry install
or pip install -r requirements.txt
.
If you'd like to contribute, feel free to fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.