From dea96bf3a6a0031c00ee5ba8593f7138aad8d6a3 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Mon, 5 Jul 2021 01:07:06 +0200 Subject: [PATCH] wip --- bundles/grafana/items.py | 2 +- bundles/telegraf/README.md | 4 ++++ bundles/telegraf/metadata.py | 1 + data/grafana/rows/mem.py | 20 ++++++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 bundles/telegraf/README.md create mode 100644 data/grafana/rows/mem.py diff --git a/bundles/grafana/items.py b/bundles/grafana/items.py index 67e6c11..8917d9d 100644 --- a/bundles/grafana/items.py +++ b/bundles/grafana/items.py @@ -142,7 +142,7 @@ for dashboard_id, monitored_node in enumerate(monitored_nodes, start=1): dashboard['panels'].append(panel) files[f'/var/lib/grafana/dashboards/{monitored_node.name}.json'] = { - 'content': json.dumps(dashboard, sort_keys=True, indent=4), + 'content': json.dumps(dashboard, indent=4), 'triggers': [ 'svc_systemd:grafana-server:restart', ] diff --git a/bundles/telegraf/README.md b/bundles/telegraf/README.md new file mode 100644 index 0000000..9f74cb6 --- /dev/null +++ b/bundles/telegraf/README.md @@ -0,0 +1,4 @@ +``` +setfacl -Rm g:telegraf:rX /var/spool/postfix/ +setfacl -dm g:telegraf:rX /var/spool/postfix/ +``` diff --git a/bundles/telegraf/metadata.py b/bundles/telegraf/metadata.py index 2d36aa0..622b2c6 100644 --- a/bundles/telegraf/metadata.py +++ b/bundles/telegraf/metadata.py @@ -50,6 +50,7 @@ defaults = { }, 'grafana_rows': [ 'cpu', + 'mem', 'disk_io', 'net_io', ], diff --git a/data/grafana/rows/mem.py b/data/grafana/rows/mem.py new file mode 100644 index 0000000..4242f9f --- /dev/null +++ b/data/grafana/rows/mem.py @@ -0,0 +1,20 @@ +{ + 'memory': { + 'stacked': True, + 'queries': { + 'memory': { + 'filters': { + '_measurement': 'mem', + '_field': [ + 'used', + 'cached', + 'buffered', + 'free', + ], + }, + 'function': 'mean', + }, + }, + 'unit': 'decbytes', + }, +}