2021-05-12 21:49:55 +02:00
|
|
|
# Uptime Status
|
|
|
|
|
|
|
|
Simple status page for server uptime.
|
2021-05-15 14:40:53 +02:00
|
|
|
|
2021-05-15 14:56:11 +02:00
|
|
|
![screenshot](screenshot.png)
|
|
|
|
|
2021-05-15 15:00:31 +02:00
|
|
|
Displays the up indicator of node-exporter from your prometheus for the last 14 days in 6h steps.
|
|
|
|
|
2021-05-15 14:40:53 +02:00
|
|
|
## Deployment
|
|
|
|
Init codebase
|
|
|
|
```
|
|
|
|
git clone https://github.com/clerie/uptime-status.git
|
|
|
|
cd uptime-status/
|
|
|
|
virtualenv -p python3 ENV
|
|
|
|
cd ..
|
|
|
|
```
|
|
|
|
|
|
|
|
Create `config.cfg` with the following contents and edit values for your needs:
|
|
|
|
|
|
|
|
```
|
|
|
|
PROMETHEUS_API_BASE="http://[::1]:9090"
|
2021-05-15 15:22:38 +02:00
|
|
|
PROMETHEUS_QUERY='(sum_over_time(up{job="node-exporter"}[6h]) / count_over_time(up{job="node-exporter"}[6h]))[14d:6h]'
|
2021-05-15 14:40:53 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Starten und updaten lässt sich die Flask-App folgendermaßen:
|
|
|
|
```
|
|
|
|
cd uptime-status/
|
|
|
|
git pull
|
|
|
|
source ENV/bin/activate
|
|
|
|
pip install -r requirements.txt
|
|
|
|
UPTIMESTATUS_SETTINGS=/path/to/config.cfg gunicorn uptimestatus:app
|
|
|
|
deactivate
|
|
|
|
```
|