This is a simple command-line application written in Go that monitors the availability of websites. It is part of a series of Golang studies that I've been doing in the past months. The application periodically sends HTTP requests to the specified websites and logs their status.
-
Clone the repository to your local machine:
git clone https://github.com/your-username/website-monitor.git
-
Navigate to the project directory:
cd website-monitor
-
Compile and run the application:
go run main.go
-
Follow the on-screen instructions to choose from the available options.
- Start monitoring websites for availability.
- Display logs of website availability and downtime.
- Exit the program.
- The application reads a list of website URLs from the
sites.txt
file. - It then repeatedly sends HTTP requests to each website to check their status.
- The application logs the results, recording the date, time, website, and status in the
log.txt
file.
- Adjust the
monitoring
constant to specify the number of monitoring cycles. - The
delay
constant controls the time interval between monitoring cycles. - The
sites.txt
file should contain one website URL per line. - Logs are stored in the
log.txt
file.
Feel free to modify and enhance the application according to your needs.
Happy monitoring!