From 3467e23376c05b85f982efd404abe937899cb1a0 Mon Sep 17 00:00:00 2001 From: M Date: Mon, 26 May 2025 14:16:29 +0200 Subject: [PATCH 01/13] Add script --- src/components/services/Gatus.vue | 96 +++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 src/components/services/Gatus.vue diff --git a/src/components/services/Gatus.vue b/src/components/services/Gatus.vue new file mode 100644 index 0000000..5649a9a --- /dev/null +++ b/src/components/services/Gatus.vue @@ -0,0 +1,96 @@ + + + + + From 721c224765c7015d720b8e72cc95778e9e345275 Mon Sep 17 00:00:00 2001 From: M Date: Mon, 26 May 2025 14:16:35 +0200 Subject: [PATCH 02/13] Add dummy data --- dummy-data/gatus/api/v1/endpoints/statuses | 211 +++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 dummy-data/gatus/api/v1/endpoints/statuses diff --git a/dummy-data/gatus/api/v1/endpoints/statuses b/dummy-data/gatus/api/v1/endpoints/statuses new file mode 100644 index 0000000..e859f21 --- /dev/null +++ b/dummy-data/gatus/api/v1/endpoints/statuses @@ -0,0 +1,211 @@ +[ + { + "name": "Gateway", + "group": "Services", + "key": "services_gateway", + "results": [ + { + "status": 200, + "hostname": "gateway.example.com", + "duration": 8752855, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": true + }, + { + "condition": "[RESPONSE_TIME] < 500", + "success": true + } + ], + "success": true, + "timestamp": "2025-05-26T07:35:41.784208588Z" + }, + { + "status": 200, + "hostname": "gateway.example.com", + "duration": 8784324, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": true + }, + { + "condition": "[RESPONSE_TIME] < 500", + "success": true + } + ], + "success": true, + "timestamp": "2025-05-26T07:40:41.804489793Z" + }, + { + "status": 200, + "hostname": "gateway.example.com", + "duration": 8506461, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": true + }, + { + "condition": "[RESPONSE_TIME] < 500", + "success": true + } + ], + "success": true, + "timestamp": "2025-05-26T07:45:41.837925713Z" + }, + { + "status": 200, + "hostname": "gateway.example.com", + "duration": 9101240, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": true + }, + { + "condition": "[RESPONSE_TIME] < 500", + "success": true + } + ], + "success": true, + "timestamp": "2025-05-26T07:50:41.848391366Z" + } + ] + }, + { + "name": "Website", + "group": "Services", + "key": "services_website", + "results": [ + { + "status": 200, + "hostname": "www.example.com", + "duration": 8752855, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": true + }, + { + "condition": "[RESPONSE_TIME] < 500", + "success": false + } + ], + "success": false, + "timestamp": "2025-05-26T07:35:41.784208588Z" + }, + { + "status": 200, + "hostname": "gateway.example.com", + "duration": 8784324, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": false + }, + { + "condition": "[RESPONSE_TIME] < 500", + "success": true + }, + ], + "success": false, + "timestamp": "2025-05-26T07:40:41.804489793Z" + }, + { + "status": 200, + "hostname": "gateway.example.com", + "duration": 8506461, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": true + }, + { + "condition": "[RESPONSE_TIME] < 500", + "success": true + } + ], + "success": true, + "timestamp": "2025-05-26T07:45:41.837925713Z" + }, + { + "status": 200, + "hostname": "gateway.example.com", + "duration": 9101240, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": true + }, + { + "condition": "[RESPONSE_TIME] < 500", + "success": true + } + ], + "success": true, + "timestamp": "2025-05-26T07:50:41.848391366Z" + } + ] + }, + { + "name": "DNS", + "group": "Services", + "key": "services_dns", + "results": [ + { + "status": 200, + "hostname": "ns1.example", + "duration": 8752855, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": false + } + ], + "success": false, + "timestamp": "2025-05-26T07:35:41.784208588Z" + }, + { + "status": 200, + "hostname": "ns1.example.com", + "duration": 8784324, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": false + } + ], + "success": false, + "timestamp": "2025-05-26T07:40:41.804489793Z" + }, + { + "status": 200, + "hostname": "ns1.example.com", + "duration": 8506461, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": false + } + ], + "success": false, + "timestamp": "2025-05-26T07:45:41.837925713Z" + }, + { + "status": 200, + "hostname": "ns1.example.com", + "duration": 9101240, + "conditionResults": [ + { + "condition": "[STATUS] == 200", + "success": false + } + ], + "success": false, + "timestamp": "2025-05-26T07:50:41.848391366Z" + } + ] + } +] From 6bf4ed05926bf97f5ec774f29dc720461b59ecd6 Mon Sep 17 00:00:00 2001 From: M Date: Mon, 26 May 2025 14:16:44 +0200 Subject: [PATCH 03/13] Add documentation --- docs/customservices.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/customservices.md b/docs/customservices.md index c1f0812..7391987 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -154,6 +154,16 @@ The FreshRSS service displays unread and subscriptions counts from your FreshRSS updateInterval: 5000 # (Optional) Interval (in ms) for updating the stats ``` +## Gatus + +The Gatus service displays information about the configured services from the defined Gatus server. +Two lines are needed in the config.yml : + +```yaml + type: "Gatus" + url: "http://192.168.0.151/gatus" + +``` ## Gitea / Forgejo This service displays a version string instead of a subtitle. Example configuration: From 0f168f87c2d890c1880209dec28839ad43486124 Mon Sep 17 00:00:00 2001 From: M Date: Mon, 26 May 2025 15:09:49 +0200 Subject: [PATCH 04/13] Add optional filtering on groups --- src/components/services/Gatus.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/services/Gatus.vue b/src/components/services/Gatus.vue index 5649a9a..022bfbc 100644 --- a/src/components/services/Gatus.vue +++ b/src/components/services/Gatus.vue @@ -42,6 +42,11 @@ export default { this.api = await this.fetch("/api/v1/endpoints/statuses", { method: "GET", cache: "no-cache" }).catch((e) => { console.error(e); }); + if (this.item.groups) { + this.api = this.api?.filter((job) => { + return this.item.groups.includes(job.group) === true; + }) + } }, countUp: function() { if (!this.api) { From 63ab2f5371737942b358e420cc6c54afedd21439 Mon Sep 17 00:00:00 2001 From: M Date: Mon, 26 May 2025 15:09:59 +0200 Subject: [PATCH 05/13] Update dummy data for groups example --- dummy-data/gatus/api/v1/endpoints/statuses | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dummy-data/gatus/api/v1/endpoints/statuses b/dummy-data/gatus/api/v1/endpoints/statuses index e859f21..2243771 100644 --- a/dummy-data/gatus/api/v1/endpoints/statuses +++ b/dummy-data/gatus/api/v1/endpoints/statuses @@ -76,8 +76,8 @@ }, { "name": "Website", - "group": "Services", - "key": "services_website", + "group": "External", + "key": "external_website", "results": [ { "status": 200, @@ -108,7 +108,7 @@ { "condition": "[RESPONSE_TIME] < 500", "success": true - }, + } ], "success": false, "timestamp": "2025-05-26T07:40:41.804489793Z" From 1c8b1e0e0e3ed989e0416b0a7c151ab424de5119 Mon Sep 17 00:00:00 2001 From: M Date: Mon, 26 May 2025 15:10:10 +0200 Subject: [PATCH 06/13] Add documentation on Groups --- docs/customservices.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/customservices.md b/docs/customservices.md index 7391987..d8fedde 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -164,6 +164,12 @@ Two lines are needed in the config.yml : url: "http://192.168.0.151/gatus" ``` + +Optionally, the results can be filtered to only include jobs in the defined groups: +```yaml + groups: [Services, External] +``` + ## Gitea / Forgejo This service displays a version string instead of a subtitle. Example configuration: From 33b8bc68f55fd3f132160b4ad0ff05a3c8acf1e3 Mon Sep 17 00:00:00 2001 From: M Date: Mon, 26 May 2025 15:22:03 +0200 Subject: [PATCH 07/13] Add missing link in docs --- docs/customservices.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/customservices.md b/docs/customservices.md index d8fedde..61e131b 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -18,6 +18,7 @@ within Homer: - [Docker Socket Proxy](#docker-socket-proxy) - [Emby / Jellyfin](#emby--jellyfin) - [FreshRSS](#freshrss) +- [Gatus](#gatus) - [Gitea / Forgejo](#gitea--forgejo) - [Glances](#glances) - [Gotify](#gotify) From 3919e5858e54dd89e0c5c0d8ecb92c4165a118bb Mon Sep 17 00:00:00 2001 From: M Date: Mon, 26 May 2025 16:21:11 +0200 Subject: [PATCH 08/13] Simplify durations --- dummy-data/gatus/api/v1/endpoints/statuses | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dummy-data/gatus/api/v1/endpoints/statuses b/dummy-data/gatus/api/v1/endpoints/statuses index 2243771..1f97de5 100644 --- a/dummy-data/gatus/api/v1/endpoints/statuses +++ b/dummy-data/gatus/api/v1/endpoints/statuses @@ -7,7 +7,7 @@ { "status": 200, "hostname": "gateway.example.com", - "duration": 8752855, + "duration": 10000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -24,7 +24,7 @@ { "status": 200, "hostname": "gateway.example.com", - "duration": 8784324, + "duration": 10000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -41,7 +41,7 @@ { "status": 200, "hostname": "gateway.example.com", - "duration": 8506461, + "duration": 10000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -58,7 +58,7 @@ { "status": 200, "hostname": "gateway.example.com", - "duration": 9101240, + "duration": 10000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -82,7 +82,7 @@ { "status": 200, "hostname": "www.example.com", - "duration": 8752855, + "duration": 10000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -99,7 +99,7 @@ { "status": 200, "hostname": "gateway.example.com", - "duration": 8784324, + "duration": 10000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -116,7 +116,7 @@ { "status": 200, "hostname": "gateway.example.com", - "duration": 8506461, + "duration": 10000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -133,7 +133,7 @@ { "status": 200, "hostname": "gateway.example.com", - "duration": 9101240, + "duration": 10000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -157,7 +157,7 @@ { "status": 200, "hostname": "ns1.example", - "duration": 8752855, + "duration": 20000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -170,7 +170,7 @@ { "status": 200, "hostname": "ns1.example.com", - "duration": 8784324, + "duration": 20000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -183,7 +183,7 @@ { "status": 200, "hostname": "ns1.example.com", - "duration": 8506461, + "duration": 20000, "conditionResults": [ { "condition": "[STATUS] == 200", @@ -196,7 +196,7 @@ { "status": 200, "hostname": "ns1.example.com", - "duration": 9101240, + "duration": 20000, "conditionResults": [ { "condition": "[STATUS] == 200", From 4c3bc3974fdbcd450a967788d9d959e174e7e09c Mon Sep 17 00:00:00 2001 From: M Date: Mon, 26 May 2025 16:22:02 +0200 Subject: [PATCH 09/13] Refactor: Allow reload. Reformat with template by joriswvanrijn --- src/components/services/Gatus.vue | 184 +++++++++++++++++++----------- 1 file changed, 120 insertions(+), 64 deletions(-) diff --git a/src/components/services/Gatus.vue b/src/components/services/Gatus.vue index 022bfbc..c836f92 100644 --- a/src/components/services/Gatus.vue +++ b/src/components/services/Gatus.vue @@ -1,13 +1,21 @@