Skip to content

Commit 18b7f88

Browse files
committed
degraded fix
1 parent 483e184 commit 18b7f88

File tree

4 files changed

+45
-65
lines changed

4 files changed

+45
-65
lines changed

.github/workflows/demo_page.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
echo 'curl;ftp://ftp.usa.openbsd.org/pub/OpenBSD/timestamp|ftp.usa.openbsd.org (curl)' >> status_hostname_list.txt
2929
echo 'nc;8.8.8.8|DNS @ Google (nc);53' >> status_hostname_list.txt
3030
echo 'script;/bin/true|Always up (/bin/true)' >> status_hostname_list.txt
31+
echo 'script;exit 80|Always degraded (exit 80)' >> status_hostname_list.txt
3132
echo 'script;/bin/false|Always down (/bin/false)' >> status_hostname_list.txt
3233
echo "config"
3334
cat config

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ With the script `alert.sh`, you can be alerted by email, SMS or Pushover in case
2121
## Installation 📦
2222

2323
By default, it's a good practice to create a `status` directory within your home directory and place everything in it :
24-
```
24+
```shell
2525
mkdir ~/status
2626
cd ~/status
2727
```
@@ -95,7 +95,7 @@ crontab -e
9595

9696
Add:
9797

98-
```
98+
```text
9999
*/1 * * * * bash "/path/to/status.sh" silent >> /dev/null
100100
```
101101

@@ -135,7 +135,7 @@ You can display a custom text instead of the HOSTNAME/IP/URL (see example below)
135135

136136
status_hostname_list.txt:
137137

138-
```csv
138+
```text
139139
ping;8.8.8.8|Google DNS
140140
nc;8.8.8.8|DNS @ Google;53
141141
curl;http://www.heise.de/ping|www.heise.de
@@ -173,30 +173,33 @@ Example JSON:
173173
If you want to signal directly if everything is fine or if something is wrong in the infrastructure, you can insert the SVG icon into your website.
174174

175175
Please remember to include the image with a cache breaker URL (eg. an appended timestamp:
176-
```
176+
```html
177177
<a href="status.html">Status <img src="status.svg?{{ timestamp }}"></a>
178178
```
179179

180180
Static websites need to fallback to render the icon with javascript, eg with:
181-
```
181+
```html
182182
document.write('<img src="status.svg?' + Date.now() + '">')
183183
```
184184

185185
## Custom Script Checks 🛠️
186186

187187
You can extend the checks of `status.sh` with your own custom shell scripts.
188188

189-
If the shell script outputs a return code 0 it is evaluated as available. With other return codes, it is a failure (outage, down).
189+
If the shell script outputs a return code `0` it is evaluated as available.
190+
With the special return code `80`, it is not classified as down but as degraded.
191+
With all other return codes, it is a failure (outage, down).
190192

191193
Add your script to the `status_hostname_list.txt` configuration file. Example:
192194

193-
```
195+
```text
194196
script;script.sh
195197
script;/path/to/your/script.sh|Custom Text
196198
script;/path/to/your/script.sh parameterA parameterB|Custom Text
197-
198199
```
199200

201+
The script [`check-websites.sh`](./scripts/check-websites.sh) is an example.
202+
200203
## TODO ✅
201204

202205
1. **Bug Fixes and Enhancements**: Address any reported issues and consider adding new features to improve the script's functionality.

0 commit comments

Comments
 (0)