From 3c4315f14a3de0c6911a075d10e18eb9365ecce4 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Tue, 27 Jun 2023 18:22:46 -0600 Subject: [PATCH] check_graylog: show more data when only cluster mode --- check_graylog.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/check_graylog.py b/check_graylog.py index 95406d8..86dbdff 100755 --- a/check_graylog.py +++ b/check_graylog.py @@ -209,7 +209,7 @@ def main(): 'value': elastisearch_active_shards, 'min': 0 }, - 'indexder_failures': { + 'indexer_failures': { 'value': indexer_failures['total'], 'min': 0, }, @@ -258,7 +258,12 @@ def main(): if args.crit_notif: exit_code = nagios.STATE_CRIT # force crit - text_result = text_result + f' JVM memory usage: {int((perfdata["jvm_memory_used"]["value"] / metrics_data["jvm_memory_heap_max"]) * 100)}%' + if args.input: + # show less data + text_result = text_result + f' JVM memory usage: {int((perfdata["jvm_memory_used"]["value"] / metrics_data["jvm_memory_heap_max"]) * 100)}%' + else: + # show more data + text_result = text_result + f' JVM memory usage: {int((perfdata["jvm_memory_used"]["value"] / metrics_data["jvm_memory_heap_max"]) * 100)}%, throughput last 1 second: {human_readable_size(perfdata["throughput_input_1_sec_rate"]["value"])} in - {human_readable_size(perfdata["throughput_output_1_sec_rate"]["value"])} out, elastisearch_active_shards: {perfdata["elastisearch_active_shards"]["value"]}' if args.input: text_result = text_result + f' {input_name_clean} events/second for last minute: {perfdata[f"{input_name_clean}_incoming_messages_rate_per_sec_1min"]["value"]}, {input_name_clean}_connections: {perfdata[f"{input_name_clean}_connections"]["value"]}, {input_name_clean}_network_in_total: {human_readable_size(perfdata[f"{input_name_clean}_network_in_total"]["value"], decimal_places=0)}'