From 02ca519489bea1e600579bbaa257da65af8f03c3 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Sun, 4 Jul 2021 23:17:57 +0200 Subject: [PATCH] wip --- bundles/grafana/items.py | 4 ++-- bundles/telegraf/items.py | 1 + data/grafana/dashboard.py | 3 +-- nodes/home.server.py | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bundles/grafana/items.py b/bundles/grafana/items.py index dd21d2f..67e6c11 100644 --- a/bundles/grafana/items.py +++ b/bundles/grafana/items.py @@ -4,9 +4,9 @@ assert node.has_bundle('postgresql') from mako.template import Template from shlex import quote from copy import deepcopy +from itertools import count import yaml import json -from itertools import count svc_systemd['grafana-server'] = { 'needs': [ @@ -94,8 +94,8 @@ for dashboard_id, monitored_node in enumerate(monitored_nodes, start=1): dashboard = deepcopy(dashboard_template) dashboard['id'] = dashboard_id dashboard['title'] = monitored_node.name + dashboard['uid'] = monitored_node.metadata.get('id') panel_id = count(start=1) - for row_id, row_name in enumerate(sorted(monitored_node.metadata.get('grafana_rows')), start=1): with open(repo.path.join([f'data/grafana/rows/{row_name}.py'])) as file: diff --git a/bundles/telegraf/items.py b/bundles/telegraf/items.py index 9210db8..2b6bf84 100644 --- a/bundles/telegraf/items.py +++ b/bundles/telegraf/items.py @@ -10,5 +10,6 @@ files['/etc/telegraf/telegraf.conf'] = { svc_systemd['telegraf'] = { 'needs': [ 'file:/etc/telegraf/telegraf.conf', + 'pkg_apt:telegraf', ], } diff --git a/data/grafana/dashboard.py b/data/grafana/dashboard.py index a5f6f03..7dde561 100644 --- a/data/grafana/dashboard.py +++ b/data/grafana/dashboard.py @@ -1,6 +1,7 @@ { # "id": 1, # "title": "some dashboard", +# "uid": "IBPgYBznk", "annotations": { "list": [ { @@ -17,7 +18,6 @@ "editable": True, "gnetId": None, "graphTooltip": 0, - "iteration": 1625410820978, "links": [], "panels": [], "refresh": False, @@ -33,6 +33,5 @@ }, "timepicker": {}, "timezone": "", - "uid": "IBPgYBznk", "version": 15 } diff --git a/nodes/home.server.py b/nodes/home.server.py index 8391adc..560f24f 100644 --- a/nodes/home.server.py +++ b/nodes/home.server.py @@ -5,6 +5,7 @@ 'backup', 'debian-10', # 'nextcloud', + 'monitored', ], 'bundles': [ 'gitea',