This commit is contained in:
mwiegand 2021-07-04 23:17:57 +02:00
parent 7eff2aa76e
commit 02ca519489
4 changed files with 5 additions and 4 deletions

View file

@ -4,9 +4,9 @@ assert node.has_bundle('postgresql')
from mako.template import Template from mako.template import Template
from shlex import quote from shlex import quote
from copy import deepcopy from copy import deepcopy
from itertools import count
import yaml import yaml
import json import json
from itertools import count
svc_systemd['grafana-server'] = { svc_systemd['grafana-server'] = {
'needs': [ 'needs': [
@ -94,8 +94,8 @@ for dashboard_id, monitored_node in enumerate(monitored_nodes, start=1):
dashboard = deepcopy(dashboard_template) dashboard = deepcopy(dashboard_template)
dashboard['id'] = dashboard_id dashboard['id'] = dashboard_id
dashboard['title'] = monitored_node.name dashboard['title'] = monitored_node.name
dashboard['uid'] = monitored_node.metadata.get('id')
panel_id = count(start=1) panel_id = count(start=1)
for row_id, row_name in enumerate(sorted(monitored_node.metadata.get('grafana_rows')), 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: with open(repo.path.join([f'data/grafana/rows/{row_name}.py'])) as file:

View file

@ -10,5 +10,6 @@ files['/etc/telegraf/telegraf.conf'] = {
svc_systemd['telegraf'] = { svc_systemd['telegraf'] = {
'needs': [ 'needs': [
'file:/etc/telegraf/telegraf.conf', 'file:/etc/telegraf/telegraf.conf',
'pkg_apt:telegraf',
], ],
} }

View file

@ -1,6 +1,7 @@
{ {
# "id": 1, # "id": 1,
# "title": "some dashboard", # "title": "some dashboard",
# "uid": "IBPgYBznk",
"annotations": { "annotations": {
"list": [ "list": [
{ {
@ -17,7 +18,6 @@
"editable": True, "editable": True,
"gnetId": None, "gnetId": None,
"graphTooltip": 0, "graphTooltip": 0,
"iteration": 1625410820978,
"links": [], "links": [],
"panels": [], "panels": [],
"refresh": False, "refresh": False,
@ -33,6 +33,5 @@
}, },
"timepicker": {}, "timepicker": {},
"timezone": "", "timezone": "",
"uid": "IBPgYBznk",
"version": 15 "version": 15
} }

View file

@ -5,6 +5,7 @@
'backup', 'backup',
'debian-10', 'debian-10',
# 'nextcloud', # 'nextcloud',
'monitored',
], ],
'bundles': [ 'bundles': [
'gitea', 'gitea',