Public Access
feat: rewrite dashboard tables with clean filterFieldsByName pattern
- Site Health: rewritten from scratch — site_url via label_replace on HTTP query (works for offline sites), filterFieldsByName to keep only needed fields, endpoint URL as clickable Site column - Joomla Core & Extensions: rewritten — same pattern, Site links to /administrator/ - Backup Status: rewritten — same pattern, Site links to Akeeba Manage - Combined SSL Days and Last Scrape into Site Health table - Collapsed Joomla Core section by default - Moved dashboard to Endpoints folder - Added site-uptime-alert.sh for ntfy critical alerts on site downtime - Split updates into System and Ext Updates columns Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,34 +15,29 @@
|
||||
"type": "row"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "PBFA97CFB590B2093"
|
||||
},
|
||||
"datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"noValue": "—",
|
||||
"custom": {
|
||||
"align": "center",
|
||||
"cellOptions": { "type": "auto" }
|
||||
}
|
||||
"custom": { "align": "center", "cellOptions": { "type": "auto" } }
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "Site" },
|
||||
"properties": [
|
||||
{ "id": "custom.width", "value": 150 },
|
||||
{ "id": "custom.align", "value": "left" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "URL" },
|
||||
"properties": [
|
||||
{ "id": "custom.width", "value": 300 },
|
||||
{ "id": "custom.align", "value": "left" },
|
||||
{ "id": "links", "value": [{ "title": "Open Site", "url": "${__value.text}", "targetBlank": true }] }
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "Online" },
|
||||
"properties": [
|
||||
{ "id": "mappings", "value": [{ "options": { "0": { "color": "orange", "text": "OFFLINE" }, "1": { "color": "green", "text": "ONLINE" } }, "type": "value" }] },
|
||||
{ "id": "thresholds", "value": { "mode": "absolute", "steps": [{ "color": "orange", "value": null }, { "color": "green", "value": 1 }] } },
|
||||
{ "id": "custom.cellOptions", "value": { "type": "color-background", "mode": "basic" } }
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "Status" },
|
||||
"properties": [
|
||||
@@ -59,14 +54,6 @@
|
||||
{ "id": "links", "value": [{ "title": "HTTP Status Code Reference", "url": "https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#${__value.raw}", "targetBlank": true }] }
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "Online" },
|
||||
"properties": [
|
||||
{ "id": "mappings", "value": [{ "options": { "0": { "color": "orange", "text": "OFFLINE" }, "1": { "color": "green", "text": "ONLINE" } }, "type": "value" }] },
|
||||
{ "id": "thresholds", "value": { "mode": "absolute", "steps": [{ "color": "orange", "value": null }, { "color": "green", "value": 1 }] } },
|
||||
{ "id": "custom.cellOptions", "value": { "type": "color-background", "mode": "basic" } }
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "API" },
|
||||
"properties": [
|
||||
@@ -76,7 +63,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "SSL Days" },
|
||||
"matcher": { "id": "byName", "options": "SSL" },
|
||||
"properties": [
|
||||
{ "id": "decimals", "value": 0 },
|
||||
{ "id": "unit", "value": "d" },
|
||||
@@ -92,110 +79,64 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"w": 24,
|
||||
"h": 8
|
||||
},
|
||||
"gridPos": { "x": 0, "y": 1, "w": 24, "h": 8 },
|
||||
"id": 1,
|
||||
"options": {
|
||||
"showHeader": true,
|
||||
"cellHeight": "sm",
|
||||
"footer": { "show": false }
|
||||
},
|
||||
"options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false } },
|
||||
"targets": [
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
|
||||
"expr": "probe_success{site_name=~\"$site\", job=\"blackbox-http\"} and on(site_name) label_replace(joomla_site_online{site=~\"$site\"} == 1, \"site_name\", \"$1\", \"site\", \"(.+)\")",
|
||||
"instant": true,
|
||||
"format": "table",
|
||||
"refId": "STATUS"
|
||||
"instant": true, "format": "table", "refId": "STATUS"
|
||||
},
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
|
||||
"expr": "probe_http_status_code{site_name=~\"$site\", job=\"blackbox-http\"}",
|
||||
"instant": true,
|
||||
"format": "table",
|
||||
"refId": "HTTP"
|
||||
"expr": "label_replace(probe_http_status_code{site_name=~\"$site\", job=\"blackbox-http\"}, \"site_url\", \"$1\", \"instance\", \"(.+)\")",
|
||||
"instant": true, "format": "table", "refId": "HTTP"
|
||||
},
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
|
||||
"expr": "label_replace(joomla_site_online{site=~\"$site\"}, \"site_name\", \"$1\", \"site\", \"(.+)\")",
|
||||
"instant": true,
|
||||
"format": "table",
|
||||
"refId": "ONLINE"
|
||||
"instant": true, "format": "table", "refId": "ONLINE"
|
||||
},
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
|
||||
"expr": "label_replace(joomla_site_api_reachable{site=~\"$site\"}, \"site_name\", \"$1\", \"site\", \"(.+)\") and on(site_name) label_replace(joomla_site_online{site=~\"$site\"} == 1, \"site_name\", \"$1\", \"site\", \"(.+)\")",
|
||||
"instant": true,
|
||||
"format": "table",
|
||||
"refId": "API"
|
||||
"instant": true, "format": "table", "refId": "API"
|
||||
},
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
|
||||
"expr": "(probe_ssl_earliest_cert_expiry{site_name=~\"$site\"} - time()) / 86400",
|
||||
"instant": true,
|
||||
"format": "table",
|
||||
"refId": "SSL"
|
||||
"instant": true, "format": "table", "refId": "SSL"
|
||||
},
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
|
||||
"expr": "label_replace(joomla_monitor_last_scrape{site=~\"$site\"} * 1000, \"site_name\", \"$1\", \"site\", \"(.+)\")",
|
||||
"instant": true,
|
||||
"format": "table",
|
||||
"refId": "LASTSCRAPE"
|
||||
"instant": true, "format": "table", "refId": "LASTSCRAPE"
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{ "id": "joinByField", "options": { "byField": "site_name", "mode": "outer" } },
|
||||
{
|
||||
"id": "joinByField",
|
||||
"options": { "byField": "site_name", "mode": "outer" }
|
||||
"id": "filterFieldsByName",
|
||||
"options": {
|
||||
"include": { "pattern": "^(site_url|Value #).*" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {
|
||||
"excludeByName": {
|
||||
"Time": true, "Time 1": true, "Time 2": true, "Time 3": true, "Time 4": true, "Time 5": true, "Time 6": true,
|
||||
"client": true, "client 1": true, "client 2": true, "client 3": true, "client 4": true, "client 5": true, "client 6": true,
|
||||
"exported_instance": true, "exported_instance 1": true, "exported_instance 2": true, "exported_instance 3": true,
|
||||
"instance 1": true, "instance 2": true, "instance 3": true, "instance 4": true, "instance 5": true, "instance 6": true,
|
||||
"job": true, "job 1": true, "job 2": true, "job 3": true, "job 4": true, "job 5": true, "job 6": true,
|
||||
"site": true, "site 1": true, "site 2": true, "site 3": true,
|
||||
"site_name 1": true, "site_name 2": true, "site_name 3": true, "site_name 4": true,
|
||||
"site_type": true, "site_type 1": true, "site_type 2": true, "site_type 3": true,
|
||||
"__name__": true, "__name__ 1": true, "__name__ 2": true, "__name__ 3": true, "__name__ 4": true, "__name__ 5": true, "__name__ 6": true
|
||||
},
|
||||
"renameByName": {
|
||||
"site_name": "Site",
|
||||
"instance": "URL",
|
||||
"site_url": "Site",
|
||||
"Value #ONLINE": "Online",
|
||||
"Value #STATUS": "Status",
|
||||
"Value #HTTP": "HTTP",
|
||||
"Value #ONLINE": "Online",
|
||||
"Value #API": "API",
|
||||
"Value #SSL": "SSL Days",
|
||||
"Value #SSL": "SSL",
|
||||
"Value #LASTSCRAPE": "Last Scrape"
|
||||
},
|
||||
"indexByName": {
|
||||
"site_name": 0,
|
||||
"instance": 1,
|
||||
"Value #ONLINE": 2,
|
||||
"Value #STATUS": 3,
|
||||
"Value #HTTP": 4,
|
||||
"Value #API": 5,
|
||||
"Value #SSL": 6,
|
||||
"Value #LASTSCRAPE": 7
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "sortBy",
|
||||
"options": {
|
||||
"fields": {},
|
||||
"sort": [{ "field": "Site", "desc": false }]
|
||||
}
|
||||
}
|
||||
{ "id": "sortBy", "options": { "sort": [{ "field": "Site", "desc": false }] } }
|
||||
],
|
||||
"title": "Site Health",
|
||||
"type": "table"
|
||||
@@ -222,13 +163,6 @@
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "Site" },
|
||||
"properties": [
|
||||
{ "id": "custom.width", "value": 180 },
|
||||
{ "id": "custom.align", "value": "left" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "URL" },
|
||||
"properties": [
|
||||
{ "id": "custom.width", "value": 300 },
|
||||
{ "id": "custom.align", "value": "left" },
|
||||
@@ -277,15 +211,11 @@
|
||||
},
|
||||
"gridPos": { "x": 0, "y": 26, "w": 24, "h": 8 },
|
||||
"id": 10,
|
||||
"options": {
|
||||
"showHeader": true,
|
||||
"cellHeight": "sm",
|
||||
"footer": { "show": false }
|
||||
},
|
||||
"options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false } },
|
||||
"targets": [
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
|
||||
"expr": "joomla_core_version_info{site=~\"$site\"}",
|
||||
"expr": "label_replace(joomla_core_version_info{site=~\"$site\"}, \"site_url\", \"$1\", \"exported_instance\", \"(.+)\")",
|
||||
"instant": true, "format": "table", "refId": "VERSION"
|
||||
},
|
||||
{
|
||||
@@ -315,49 +245,27 @@
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "joinByField",
|
||||
"options": { "byField": "site", "mode": "outer" }
|
||||
},
|
||||
{ "id": "joinByField", "options": { "byField": "site", "mode": "outer" } },
|
||||
{ "id": "filterFieldsByName", "options": { "include": { "pattern": "^(site_url|version|Value #).*" } } },
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {
|
||||
"excludeByName": {
|
||||
"Time": true, "Time 1": true, "Time 2": true, "Time 3": true, "Time 4": true, "Time 5": true, "Time 6": true,
|
||||
"Value #VERSION": true,
|
||||
"client": true, "client 1": true, "client 2": true, "client 3": true, "client 4": true, "client 5": true, "client 6": true,
|
||||
"exported_instance 1": true, "exported_instance 2": true, "exported_instance 3": true, "exported_instance 4": true, "exported_instance 5": true, "exported_instance 6": true,
|
||||
"instance": true, "instance 1": true, "instance 2": true, "instance 3": true, "instance 4": true, "instance 5": true, "instance 6": true,
|
||||
"job": true, "job 1": true, "job 2": true, "job 3": true, "job 4": true, "job 5": true, "job 6": true,
|
||||
"site 1": true, "site 2": true, "site 3": true, "site 4": true, "site 5": true,
|
||||
"__name__": true, "__name__ 1": true, "__name__ 2": true, "__name__ 3": true, "__name__ 4": true, "__name__ 5": true, "__name__ 6": true
|
||||
},
|
||||
"renameByName": {
|
||||
"site": "Site",
|
||||
"exported_instance": "URL",
|
||||
"site_url": "Site",
|
||||
"version": "Version",
|
||||
"Value #VERSION": "v_hidden",
|
||||
"Value #SYSTEM": "System",
|
||||
"Value #EXTUPDATES": "Ext Updates",
|
||||
"Value #TOTAL": "Total",
|
||||
"Value #ENABLED": "Enabled",
|
||||
"Value #DISABLED": "Disabled"
|
||||
},
|
||||
"indexByName": {
|
||||
"site": 0,
|
||||
"exported_instance": 1,
|
||||
"version": 2,
|
||||
"Value #SYSTEM": 3,
|
||||
"Value #EXTUPDATES": 4,
|
||||
"Value #TOTAL": 5,
|
||||
"Value #ENABLED": 6,
|
||||
"Value #DISABLED": 7
|
||||
"excludeByName": {
|
||||
"v_hidden": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "sortBy",
|
||||
"options": { "fields": {}, "sort": [{ "field": "Site", "desc": false }] }
|
||||
}
|
||||
{ "id": "sortBy", "options": { "sort": [{ "field": "Site", "desc": false }] } }
|
||||
],
|
||||
"title": "Joomla Core & Extensions",
|
||||
"type": "table"
|
||||
@@ -493,13 +401,6 @@
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "Site" },
|
||||
"properties": [
|
||||
{ "id": "custom.width", "value": 150 },
|
||||
{ "id": "custom.align", "value": "left" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": { "id": "byName", "options": "URL" },
|
||||
"properties": [
|
||||
{ "id": "custom.width", "value": 300 },
|
||||
{ "id": "custom.align", "value": "left" },
|
||||
@@ -533,15 +434,11 @@
|
||||
},
|
||||
"gridPos": { "x": 0, "y": 56, "w": 24, "h": 8 },
|
||||
"id": 40,
|
||||
"options": {
|
||||
"showHeader": true,
|
||||
"cellHeight": "sm",
|
||||
"footer": { "show": false }
|
||||
},
|
||||
"options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false } },
|
||||
"targets": [
|
||||
{
|
||||
"datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" },
|
||||
"expr": "max by (site, exported_instance) (joomla_backup_status{site=~\"$site\"})",
|
||||
"expr": "label_replace(max by (site, exported_instance) (joomla_backup_status{site=~\"$site\"}), \"site_url\", \"$1\", \"exported_instance\", \"(.+)\")",
|
||||
"instant": true, "format": "table", "refId": "STATUS"
|
||||
},
|
||||
{
|
||||
@@ -556,43 +453,20 @@
|
||||
}
|
||||
],
|
||||
"transformations": [
|
||||
{
|
||||
"id": "joinByField",
|
||||
"options": { "byField": "site", "mode": "outer" }
|
||||
},
|
||||
{ "id": "joinByField", "options": { "byField": "site", "mode": "outer" } },
|
||||
{ "id": "filterFieldsByName", "options": { "include": { "pattern": "^(site_url|Value #).*" } } },
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {
|
||||
"excludeByName": {
|
||||
"Time": true, "Time 1": true, "Time 2": true, "Time 3": true,
|
||||
"client": true, "client 1": true, "client 2": true, "client 3": true,
|
||||
"instance": true, "instance 1": true, "instance 2": true, "instance 3": true,
|
||||
"job": true, "job 1": true, "job 2": true, "job 3": true,
|
||||
"site 1": true, "site 2": true,
|
||||
"status": true,
|
||||
"exported_instance 1": true, "exported_instance 2": true,
|
||||
"__name__": true, "__name__ 1": true, "__name__ 2": true, "__name__ 3": true
|
||||
},
|
||||
"renameByName": {
|
||||
"site": "Site",
|
||||
"exported_instance": "URL",
|
||||
"site_url": "Site",
|
||||
"Value #STATUS": "Status",
|
||||
"Value #AGE": "Age",
|
||||
"Value #RECORDS": "Records"
|
||||
},
|
||||
"indexByName": {
|
||||
"site": 0,
|
||||
"exported_instance": 1,
|
||||
"Value #STATUS": 2,
|
||||
"Value #AGE": 3,
|
||||
"Value #RECORDS": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "sortBy",
|
||||
"options": { "fields": {}, "sort": [{ "field": "Site", "desc": false }] }
|
||||
}
|
||||
{ "id": "sortBy", "options": { "sort": [{ "field": "Site", "desc": false }] } }
|
||||
],
|
||||
"title": "Backup Status",
|
||||
"type": "table"
|
||||
|
||||
Reference in New Issue
Block a user