From 3e3608960f50b3ff961fa34df9af6bdcfe669f19 Mon Sep 17 00:00:00 2001 From: Antoine Van Elstraete Date: Tue, 28 Dec 2021 00:14:51 +0100 Subject: [PATCH] Add "per second" (if it's per second... use munin graph_period) --- knot_ | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/knot_ b/knot_ index bc21c4c..ffbc0b0 100755 --- a/knot_ +++ b/knot_ @@ -24,7 +24,7 @@ def responses(stats, config): if config: print("graph_title Knot responses") print("graph_category dns") - print("graph_vlabel responses") + print("graph_vlabel responses / ${graph_period}") print("graph_args --base 1000 --lower-limit 0") for code in responses_stats: print(f"{code}.label {code}") @@ -52,7 +52,7 @@ def proto(stats, config): if config: # Configure the plugin print("graph_title Knot protocols") print("graph_category dns") - print("graph_vlabel numbers of requests") + print("graph_vlabel numbers of requests / ${graph_period}") print("graph_args --base 1000 --lower-limit 0") for proto in proto_stats: print(f"{proto}.label {proto}") @@ -66,6 +66,7 @@ def proto(stats, config): if __name__ == '__main__': # Retrieve datas : file = getenv('stats_file_path') + munin_time = getenv('munin_time', 300) with open(file, "r") as stats_file: stats = yaml.safe_load(stats_file) if not "mod-stats" in stats: @@ -75,8 +76,8 @@ if __name__ == '__main__': else: config = False if "responses" in argv[0]: - responses(stats, config) + responses(stats, config, munin_time) elif "proto" in argv[0]: - proto(stats, config) + proto(stats, config, munin_time) else: pass # Nothing happens if no "munin underscore args"