From ae0bb8ed58f5d7d528be1ea7f7757491c9634e73 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 2 May 2021 12:06:53 +0200 Subject: [PATCH] bundles/postfix: rework exporter for better usability --- bundles/grafana/dashboard-rows/postfix.py | 4 +--- bundles/postfix/files/postfix-telegraf-queue | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bundles/grafana/dashboard-rows/postfix.py b/bundles/grafana/dashboard-rows/postfix.py index e1a186e..973d337 100644 --- a/bundles/grafana/dashboard-rows/postfix.py +++ b/bundles/grafana/dashboard-rows/postfix.py @@ -19,11 +19,9 @@ def dashboard_row_postfix(panel_id, node): |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == "postfix_queue" and - r["_field"] == "count" and - r["status"] == "{measurement}" and + r["_field"] == "{measurement}" and r["host"] == "{node.name}" ) - |> rename(columns: {{_field: "{measurement}"}}) |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false) |> yield(name: "{measurement}")""", 'resultFormat': 'time_series', diff --git a/bundles/postfix/files/postfix-telegraf-queue b/bundles/postfix/files/postfix-telegraf-queue index 7fc24a8..f5abfe7 100644 --- a/bundles/postfix/files/postfix-telegraf-queue +++ b/bundles/postfix/files/postfix-telegraf-queue @@ -14,4 +14,4 @@ for line in queue_json.splitlines(): queue_counts[j['queue_name']] += 1 for queue in ('incoming', 'active', 'deferred', 'corrupt', 'hold'): - print('postfix_queue,status={} count={}i'.format(queue, queue_counts.get(queue, 0))) + print('postfix_queue {}={}i'.format(queue, queue_counts.get(queue, 0)))