Monitor and analyze server uptime and health in real-time.
UpOrNot is a "lightweight" server monitoring tool built in Go that keeps track of the health of your servers by regularly pinging them, recording response times, and calculating uptime percentages. It includes a web interface to view server statuses and a RESTful API to integrate monitoring data into your own applications.
- Real-Time Monitoring: Continuously checks server availability using ICMP ping.
- Detailed Metrics: Tracks response times, uptime percentages, and the number of successful checks.
- Web Interface: Serve a static web page to visualize server statuses easily.
- RESTful API: Access server health data programmatically via JSON.
- Concurrency: Efficiently monitors multiple servers using a thread-safe approach.
- Configurable: Read server configurations from a YAML file for easy setup and modification.
- Server Monitoring: UpOrNot uses ICMP pings to determine server status and response times.
- Data Storage: Metrics like uptime and checks are dynamically updated in memory.
- Web/API Access:
- A web interface (
static/index.html) is served to view server health. - An API endpoint (
/api/status) provides server details in JSON format.
- A web interface (
- Configurable Servers: Define servers to monitor in a
service-list.yamlfile.
- Clone the repository:
git clone https://github.com/yourusername/UpOrNot.git cd UpOrNot - Install dependencies:
go mod tidy
- Create a
service-list.yamlfile in the root directory:servers: - name: Google host: google.com - name: GitHub host: github.com
- Run the server:
go run main.go
- Open your browser and visit
http://localhost:8080to view the dashboard.
To run UpOrNot using Docker, use the provided docker-compose.yml file.
- Build and start the container:
docker-compose up -d
- Open your browser and visit
http://localhost:8080to view the dashboard.
Endpoint: /api/status
Method: GET
Response: JSON containing server statuses, uptime, and response times.
Example:
[
{
"name": "Google",
"host": "google.com",
"status": true,
"lastChecked": "2025-01-26T12:30:00Z",
"responseTime": 23,
"uptime": 99.9,
"checks": 100,
"successes": 99
},
{
"name": "GitHub",
"host": "github.com",
"status": false,
"lastChecked": "2025-01-26T12:29:58Z",
"responseTime": 0,
"uptime": 95.4,
"checks": 100,
"successes": 95
}
]- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add feature-name" - Push to the branch:
git push origin feature-name
- Create a pull request!
- Add TLS/SSL support for more secure API interactions.
- Improve the web interface with dynamic charts and graphs.
- Support other protocols like HTTP, TCP, and UDP for monitoring.
- Add persistent storage for metrics using a database.
- Add notifications for server downtime via email, SMS, or Slack.
This project is licensed under the MIT License.
Feel free to clone, modify, and use it in your projects!