Use comma-separated value text file
CSV is a well-supported standard and makes things more predictable/easier to see where things go.main
parent
5bba428b4c
commit
11bddbb4fa
|
@ -20,7 +20,7 @@ An example site is available [here](https://lab.bdro.fr/tinystatus/).
|
||||||
To install tinystatus:
|
To install tinystatus:
|
||||||
|
|
||||||
* Clone the repository and go to the created directory
|
* Clone the repository and go to the created directory
|
||||||
* Edit the checks file `checks.list`
|
* Edit the checks file `checks.csv`
|
||||||
* To add incidents or maintenance, edit `incidents.list`
|
* To add incidents or maintenance, edit `incidents.list`
|
||||||
* Generate status page `./tinystatus > index.html`
|
* Generate status page `./tinystatus > index.html`
|
||||||
* Serve the page with your favorite web server
|
* Serve the page with your favorite web server
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
http, 200, Google Website, https://google.com
|
||||||
|
http, 404, Google 404, https://google.com/dummy
|
||||||
|
http4, 200, Google website (IPv4), https://google.com
|
||||||
|
http6, 200, Google website (IPv6), https://google.com
|
||||||
|
ping, 0, Google ping, 8.8.8.8
|
||||||
|
port, 0, Google DNS, 8.8.8.8 53
|
|
|
@ -1,6 +0,0 @@
|
||||||
http | 200 | Google website | https://google.com
|
|
||||||
http4 | 200 | Google website (IPv4) | https://google.com
|
|
||||||
http6 | 200 | Google website (IPv6) | https://google.com
|
|
||||||
http | 404 | Google 404 | https://google.com/dummy
|
|
||||||
ping | 0 | Google ping | 8.8.8.8
|
|
||||||
port | 0 | Google dns | 8.8.8.8 53
|
|
|
@ -3,7 +3,7 @@
|
||||||
title=tinystatus
|
title=tinystatus
|
||||||
timeout=10
|
timeout=10
|
||||||
tmp="$(mktemp -d)"
|
tmp="$(mktemp -d)"
|
||||||
checkfile="${1:-checks.list}"
|
checkfile="${1:-checks.csv}"
|
||||||
incidentsfile="${2:-incidents.list}"
|
incidentsfile="${2:-incidents.list}"
|
||||||
useragent="User-Agent: Mozilla/5.0 (X11; Linux x86_64; Debian) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36"
|
useragent="User-Agent: Mozilla/5.0 (X11; Linux x86_64; Debian) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36"
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ command_exists(){
|
||||||
}
|
}
|
||||||
|
|
||||||
get_element(){
|
get_element(){
|
||||||
echo "${2}" | awk -v col="${1}" -F'|' '{gsub(/^[ \t]+|[ \t]+$/, "", $col); print $col}'
|
echo "${2}" | awk -v col="${1}" -F',' '{gsub(/^[ \t]+|[ \t]+$/, "", $col); print $col}'
|
||||||
}
|
}
|
||||||
|
|
||||||
check(){
|
check(){
|
||||||
|
|
Loading…
Reference in New Issue