This project is designed to monitor the availability of websites and store the results in a PostgreSQL database. This project ensures continuous monitoring of website statuses, providing insights into their uptime and downtime periods.
- Python 3
- PostgreSQL
- Apache Kafka
-
Clone the repository:
-
Install the dependencies: pip install -r requirements.txt
Website-monitor can be configured using the config.yaml file in the root directory. The following params are available:
KafkaProducer configurations:
topic_name
: The name of the Kafka topic to publish check results tohost
: The hostname of the KafkaProducerssl_port
: The port number of the KafkaProducersecurity_protocol
: The security protocol to use when connecting to the KafkaProducerssl_cafile
: The path to the CA certificatessl_certfile
: The path to the CERT certificatessl_keyfile
: The path to the KEY certificate
KafkaCondumer configurations:
topic_name
: The name of the Kafka topic the check results will be read fromhost
: The hostname of the KafkaConsumerssl_port
: The port number of the KafkaConsumerconsumer_timeout_ms
: The time the consumer should wait for new messages to arrive before it returns control to the callerclient_id
: The consumer client IDgroup_id
: The consumer group IDsecurity_protocol
: The security protocol to use when connecting to the KafkaConsumerssl_cafile
: The path to the CA certificate (same as the KafkaProducer)ssl_certfile
: The path to the CERT certificate (same as the KafkaProducer)ssl_keyfile
: The path to the KEY certificate (same as the KafkaProducer)auto_offset_reset
: The consumer automatically resets the offset to the earliest available offset if it is unable to find the current offset
Database configurations:
database_type
: In this case it is postgresuser
: The username to connect to the PostgreSQL serverpassword
: The password to connect to the PostgreSQL serverhost
: The hostname of the PostgreSQL serverport
: The port of the PostgreSQL serverdatabase_name
: The name of the PostgreSQL database to connect tosslmode
: The SSL mode to use when connecting to the PostgreSQL server
List of websites to check
target_websites
: The list of websites that the website_monitor should check their availability
To start Website-checker-Database-writer, run the following command from the root directory "Website-checker-Database-writer": python .\main.py
Website-checker-Database-writer will start checking websites and publishing check results to the Kafka topic specified in the configuration.