Uptime Monitoring Bot
The Utas Uptime Monitoring Bot is a powerful tool designed to monitor the availability and performance of websites. This bot checks websites at regular intervals to ensure they are up and running smoothly. If any issues are detected, the bot sends an alert, providing detailed information about the problem.
Information Collected
The Utas Uptime Monitoring Bot collects the following information during each check:
- HTTP Status Codes: The bot checks if the website returns a standard HTTP status code, such as 200 (OK), 301 (Moved Permanently), or 302 (Found). It also detects errors such as 404 (Not Found) or 500 (Internal Server Error).
- Response Time: The bot records how long it takes for the website to respond to the request. This helps in monitoring the performance and speed of the website.
- SSL Certificate Status: The bot verifies the SSL certificate of the website. If the certificate has expired or is not properly configured, the bot will log an SSL-related error.
- Redirections: The bot follows and logs any redirections (e.g., 301 or 302 redirects) that occur during the request.
- Error Details: In case of any issues, the bot captures detailed error messages, including connection timeouts, SSL errors, and any exceptions encountered.
Frequency of Requests
The bot is configured to check websites at a customizable interval. By default, the bot makes a request every 45 seconds. This frequency ensures that any downtime or issues are detected promptly, allowing for quick resolution.
Technology Used
The Utas Uptime Monitoring Bot is built using modern and reliable technologies:
- Python: The core logic of the bot is written in Python, leveraging the simplicity and efficiency of the language.
- Requests Library: The bot uses the
requests
library to send HTTP requests to the websites. This library is robust and widely used for making HTTP requests in Python. - ThreadPoolExecutor: To handle multiple website checks simultaneously, the bot employs Python's
ThreadPoolExecutor
, allowing it to efficiently monitor many websites at once without slowing down. - Logging: All activities and results are logged using Python's
logging
module. The logs include detailed information about each request, such as the status code, response time, and any errors encountered. - Nginx: The bot operates behind an Nginx server, ensuring that all requests are handled efficiently and that the server itself is properly managed.
- Telegram Integration: For alerting, the bot integrates with Telegram, sending notifications about any issues detected during the checks.
How the Bot Operates
- Request Initialization: The bot sends an HTTP GET request to the target website using a custom
User-Agent
string that identifies it as"Utas_Uptime - https://Utas.cc/bot"
. - Response Analysis: The bot analyzes the response, checking the status code, response time, and any redirections or errors.
- Error Handling: If any issues are detected, the bot logs the error details and prepares a notification message.
- Notification: The bot sends a notification to a predefined Telegram chat with the details of the issue.
- Logging: All interactions, whether successful or erroneous, are logged for future reference and analysis.
Security and Privacy
The bot only collects non-sensitive information that is publicly accessible when visiting a website. No personal data or private information is gathered or stored. The primary purpose is to monitor uptime and performance, ensuring that the websites are functioning as expected.