Skip to content

Commit

Permalink
improve dasboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jritter committed Mar 15, 2024
1 parent 939efc7 commit e400537
Showing 1 changed file with 149 additions and 43 deletions.
192 changes: 149 additions & 43 deletions configs/grafana/dashboards/openscap_dashboard.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
"type": "panel",
"id": "bargauge",
"name": "Bar gauge",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "10.4.0"
},
{
"type": "panel",
"id": "piechart",
"name": "Pie chart",
"version": ""
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "table",
"name": "Table",
"version": ""
}
],
"annotations": {
"list": [
{
Expand All @@ -24,14 +67,14 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -81,7 +124,7 @@
{
"id": "color",
"value": {
"fixedColor": "semi-dark-green",
"fixedColor": "green",
"mode": "fixed"
}
}
Expand All @@ -96,7 +139,7 @@
{
"id": "color",
"value": {
"fixedColor": "semi-dark-red",
"fixedColor": "red",
"mode": "fixed"
}
}
Expand All @@ -112,21 +155,16 @@
},
"id": 2,
"options": {
"displayLabels": [
"percent"
],
"displayLabels": ["percent"],
"legend": {
"displayMode": "list",
"placement": "bottom",
"values": [
"percent"
]
"showLegend": true,
"values": ["percent"]
},
"pieType": "pie",
"pieType": "donut",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
Expand All @@ -139,13 +177,17 @@
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "count_values(\"openscap_result\", openscap_results)",
"disableTextWrap": false,
"editorMode": "builder",
"expr": "count_values(\"openscap_result\", openscap_results{target=~\"$target\", severity=~\"$severity\"})",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A"
"refId": "A",
"useBackend": false
}
],
"title": "Overall Check status",
Expand All @@ -154,7 +196,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -187,30 +229,36 @@
"id": 4,
"options": {
"displayMode": "gradient",
"maxVizHeight": 300,
"minVizHeight": 10,
"minVizWidth": 0,
"namePlacement": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"showUnfilled": true
"showUnfilled": true,
"sizing": "auto",
"valueMode": "color"
},
"pluginVersion": "9.0.5",
"pluginVersion": "10.4.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "count by (severity) (openscap_results == 0)",
"expr": "count by(severity) (openscap_results{target=~\"$target\"} == 0)",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A"
"refId": "A",
"useBackend": false
}
],
"title": "Failed Rules by Severity",
Expand All @@ -219,7 +267,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
Expand All @@ -228,7 +276,9 @@
},
"custom": {
"align": "auto",
"displayMode": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"mappings": [],
Expand Down Expand Up @@ -281,32 +331,36 @@
},
"id": 6,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"reducer": ["sum"],
"show": false
},
"showHeader": true,
"sortBy": []
},
"pluginVersion": "9.0.5",
"pluginVersion": "10.4.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"disableTextWrap": false,
"editorMode": "builder",
"exemplar": false,
"expr": "openscap_results == 0",
"expr": "openscap_results{target=~\"$target\", severity=~\"$severity\"} == 0",
"format": "table",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": true,
"interval": "",
"legendFormat": "__auto",
"range": false,
"refId": "A"
"refId": "A",
"useBackend": false
}
],
"title": "Failed Rules",
Expand Down Expand Up @@ -336,19 +390,71 @@
"type": "table"
}
],
"schemaVersion": 36,
"style": "dark",
"refresh": "",
"schemaVersion": 39,
"tags": [],
"templating": {
"list": []
"list": [
{
"allValue": ".+",
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values(openscap_results,target)",
"hide": 0,
"includeAll": true,
"label": "OpenSCAP Target",
"multi": false,
"name": "target",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(openscap_results,target)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"allValue": ".+",
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values(openscap_results,severity)",
"hide": 0,
"includeAll": true,
"label": "Severity",
"multi": false,
"name": "severity",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(openscap_results,severity)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "SCAPinoculars Metrics",
"version": 9,
"title": "SCAPinoculars OpenSCAP Dashboard",
"uid": "bdfrrlu4ovk74a",
"version": 13,
"weekStart": ""
}
}

0 comments on commit e400537

Please sign in to comment.