From 6a4cdd6b5066a0627bd51f882ca8693c12d6c6cd Mon Sep 17 00:00:00 2001 From: Kaushik Narayan R Date: Thu, 28 Nov 2024 01:22:59 -0700 Subject: [PATCH] some more dashboard stuff --- scripts/deploy.ps1 | 2 +- scripts/deploy.sh | 2 +- ...capture analysis.json => dashboard_1.json} | 0 ui/docker-compose.yaml | 4 +++- ui/grafana_dashboards.yaml | 19 +++++++++++++++++++ 5 files changed, 24 insertions(+), 3 deletions(-) rename ui/{Internet traffic capture analysis.json => dashboard_1.json} (100%) create mode 100644 ui/grafana_dashboards.yaml diff --git a/scripts/deploy.ps1 b/scripts/deploy.ps1 index 5d31f2c..eee7cd8 100644 --- a/scripts/deploy.ps1 +++ b/scripts/deploy.ps1 @@ -14,7 +14,7 @@ if ($downStack) { Write-Output "[+] Removing stack..." docker stack rm $stackName docker service rm registry - Start-Sleep 15 + Start-Sleep 20 docker volume rm $(docker volume ls --filter name=$stackName -q) } elseif ($MasterNode) { diff --git a/scripts/deploy.sh b/scripts/deploy.sh index f50d382..d1cc529 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -23,7 +23,7 @@ if [[ $downStack ]]; then echo "[+] Removing stack..." docker stack rm $stackName docker service rm registry - sleep 10 + sleep 20 docker volume rm $(docker volume ls --filter name=$stackName -q) elif ($MasterNode); then echo "[+] swarm master" diff --git a/ui/Internet traffic capture analysis.json b/ui/dashboard_1.json similarity index 100% rename from ui/Internet traffic capture analysis.json rename to ui/dashboard_1.json diff --git a/ui/docker-compose.yaml b/ui/docker-compose.yaml index 544b881..3698694 100644 --- a/ui/docker-compose.yaml +++ b/ui/docker-compose.yaml @@ -4,7 +4,9 @@ services: container_name: grafana volumes: - grafana-storage:/var/lib/grafana - - ../ui/grafana_clickhouse_datasource.yaml:/etc/grafana/provisioning/datasources/clickhouse.yaml + - ../ui/grafana_clickhouse_datasource.yaml:/etc/grafana/provisioning/datasources/clickhouse.yaml:ro + - ../ui/grafana_dashboards.yaml:/etc/grafana/provisioning/dashboards/grafana_dashboards.yaml:ro + - ../ui/dashboard_1.json:/var/lib/grafana/dashboards/dashboard_1.json networks: outside_net: aliases: diff --git a/ui/grafana_dashboards.yaml b/ui/grafana_dashboards.yaml new file mode 100644 index 0000000..1e729dc --- /dev/null +++ b/ui/grafana_dashboards.yaml @@ -0,0 +1,19 @@ +apiVersion: 1 + +providers: + - name: 'The Web Farm' + orgId: 1 + # name of the dashboard folder. + # provider type. Default to 'file' + type: file + # disable dashboard deletion + disableDeletion: false + # how often Grafana will scan for changed dashboards + updateIntervalSeconds: 10 + # allow updating provisioned dashboards from the UI + allowUiUpdates: false + options: + # path to dashboard files on disk. Required when using the 'file' type + path: /var/lib/grafana/dashboards + # use folder names from filesystem to create folders in Grafana + foldersFromFilesStructure: true