Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marialuizaleitao/sitemonitor
SiteMonitor is a simple application designed to aid in learning file manipulation in Go. It allows users to monitor the status of multiple websites simultaneously, conducting periodic checks on provided URLs, logging availability and potential failures.
https://github.com/marialuizaleitao/sitemonitor
go go-http golang-package
Last synced: about 2 months ago
JSON representation
SiteMonitor is a simple application designed to aid in learning file manipulation in Go. It allows users to monitor the status of multiple websites simultaneously, conducting periodic checks on provided URLs, logging availability and potential failures.
- Host: GitHub
- URL: https://github.com/marialuizaleitao/sitemonitor
- Owner: marialuizaleitao
- Created: 2024-06-03T17:33:08.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-03T17:54:43.000Z (7 months ago)
- Last Synced: 2024-06-03T20:36:16.115Z (7 months ago)
- Topics: go, go-http, golang-package
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Website Monitoring Tool
This is a simple command-line application written in Go (Golang) for monitoring the availability of websites. It allows users to specify the delay between checks and the number of monitorings to perform.
## Technologies Used
- **Go (Golang)**: The programming language used to develop the application.
- **HTTP Package**: Used for making HTTP requests to the specified websites.
- **OS Package**: Used for file operations, such as reading from `sites.txt` and logging to `log.txt`.
- **Time Package**: Used for introducing delays between monitorings.
- **Log Package**: Used for logging errors and status information.## Purpose
The primary purpose of this project is to learn how to manipulate files and handle HTTP requests in Go. It serves as a practical exercise to understand concepts such as reading from files, making HTTP requests, error handling, and logging in Go applications.
## Usage
1. **Setup**: List the websites to be monitored in the file `sites.txt`, with each URL on a new line.
2. **Run**: Execute the application and follow the on-screen instructions to start monitoring.
3. **Monitor**: The application will periodically check the specified websites for availability and log the results to `log.txt`.
4. **View Logs**: Use the application to display the logs stored in `log.txt`.## Sites for Simulation
The `sites.txt` file should contain URLs representing different websites with varying statuses. These URLs can be from personal websites, public APIs, or any online resource that returns different HTTP status codes. For example:
- http://example.com
- http://example.com/notfound
- http://example.com/servererror
- ...Ensure that the URLs in `sites.txt` are accessible and return the expected status codes to simulate different scenarios accurately.
## Contributing
Contributions are welcome! If you have any suggestions, improvements, or bug fixes, feel free to open an issue or create a pull request.