name change from Tinystatus to Uptime Atomic

This commit is contained in:
mischa 2023-05-31 08:45:22 +00:00
parent d42ca95a4b
commit 8f8a96f50c
3 changed files with 22 additions and 15 deletions

View File

@ -1,7 +1,7 @@
MIT License
Copyright (c) 2021 Baptiste DE RENZO
Copyright (c) 2023 Mischa Peters
Copyright (c) 2021 Baptiste DE RENZO https://github.com/bderenzo/tinystatus
Copyright (c) 2023 Mischa Peters https://git.high5.nl/uptimeatomic/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
# Tinystatus
# Uptime Atomic
tinystatus generate an html status page via shell script.
uptimeatomic alerts when downtime happens and generates an html status page via shell script.
## Features
@ -15,17 +15,18 @@ tinystatus generate an html status page via shell script.
## Demo
An example site is available [here](https://lab.bdro.fr/tinystatus/).
An example site is available [here](https://ops.lowfive.nl/)
## Setup
To install tinystatus:
To install uptimeatomic:
* Clone the repository and go to the created directory
* Edit `tinystatus` variables to your liking
* Edit `uptimeatomic` variables to your liking
* Edit the checks file `checks.csv`
* To add incidents or maintenance, edit `incidents.txt`
* Generate status page `./tinystatus`
* To add past incidents or maintenance, edit `pastincidents.txt`
* Generate status page `./uptimeatomic`
* Serve the page with your favorite web server
## Configuration file
@ -33,6 +34,10 @@ To install tinystatus:
The syntax of `checks.csv` file is:
```
Command, Expected Code, Status Text, Host to check
http, 200, Google Website, https://google.com
maint, 200, Google Drive Maintenance, https://drive.google.com
ping, 0, Google ping, 8.8.8.8
port, 0, Google DNS, 8.8.8.8 53
```
Command can be:
@ -47,9 +52,10 @@ Note: `port4` and `port6` require OpenBSD `nc` binary.
## Parameters
```
./tinystatus -c CHECKFILE -i INCIDENTSFILE -o HTMLFILE
./uptimeatomic -c CHECKFILE -i INCIDENTSFILE -o HTMLFILE
Default:
-c = checks.csv
-i = incidents.txt
-p = pastincidents.txt
-o = index.html
```

View File

@ -1,7 +1,7 @@
#!/bin/ksh
#
# Tinystatus v20230530
# https://git.high5.nl/tinystatus/
# Uptime Atomic v20230531
# https://git.high5.nl/uptimeatomic/
#
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
@ -16,11 +16,11 @@ PUSHOVER_CONF="/home/mischa/_pushover.conf"
PUSHOVER_STATUS="status"
RECIPIENT="alerts@high5.nl"
REFRESH=60
SENDER="tinystatus@high5.nl"
SENDER="uptimeatomic@high5.nl"
TIMEOUT=10
TITLE="Tiny Status"
TITLE="Uptime Atomic"
USERAGENT="User-Agent: Mozilla/5.0 (OpenBSD; Intel OpenBSD 7.4; rv:109.0) Gecko/20100101 Firefox/113.0"
WORKDIR=/home/mischa/tinystatus
WORKDIR=/home/mischa/uptimeatomic
usage() {
echo "usage: ${0##*/} [-c checksfile] [-i incidentsfile] [-p pastincidentsfile] [-o htmlfile]" 1>&2
@ -198,13 +198,14 @@ ls ${tmp}/ok/*.status 2>/dev/null | sort -V | while read file; do
done
cat << EOF >> ${_htmlfile}
</ul>
<p class=small> Last check: $(date +%FT%T%z) <a href="https://git.high5.nl/tinystatus/">Tinystatus</a> loosely based on <a href="https://github.com/bderenzo/tinystatus">Tinystatus</a></p>
<p class=small>Last check: $(date +%FT%T%z)</p>
EOF
if [ -s "${PASTINCIDENTSFILE}" ]; then
echo '<h1>Past Incidents</h1>' >> ${_htmlfile}
sed 's|^\(.*\)$|<p>\1</p>|' "${PASTINCIDENTSFILE}" >> ${_htmlfile}
fi
cat << EOF >> ${_htmlfile}
<p class=small><a href="https://git.high5.nl/uptimeatomic/">Uptime Atomic</a> loosely based on <a href="https://github.com/bderenzo/tinystatus">Tinystatus</a></p>
</div>
</body>
</html>