check_graylog: show more data when only cluster mode

This commit is contained in:
Cyberes 2023-06-27 18:22:46 -06:00
parent 52e465a791
commit 3c4315f14a
1 changed files with 7 additions and 2 deletions

View File

@ -209,7 +209,7 @@ def main():
'value': elastisearch_active_shards, 'value': elastisearch_active_shards,
'min': 0 'min': 0
}, },
'indexder_failures': { 'indexer_failures': {
'value': indexer_failures['total'], 'value': indexer_failures['total'],
'min': 0, 'min': 0,
}, },
@ -258,7 +258,12 @@ def main():
if args.crit_notif: if args.crit_notif:
exit_code = nagios.STATE_CRIT # force crit exit_code = nagios.STATE_CRIT # force crit
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)}%' 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: 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)}' 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)}'