#Format perf data string con_perf_data_string = OutputFormatHelpers.perf_data_string( label='disk_io_op', value=disk_io_op, warn=s_warning, crit=s_critical, UOM='IOps' ) #format OUtput output = OutputFormatHelpers.check_output_string( status, disk_io_op_comment, [con_perf_data_string] ) print(output) except Exception as e: if debug: print(e) the_type, value, tb = sys.exc_info() traceback.print_tb(tb) print("Error: {m}".format(m=e)) sys.exit(2) finally: if status == "Critical":
if nb_docs_diff <= s_critical: status = 'Critical' #Format perf data string con_perf_data_string = OutputFormatHelpers.perf_data_string( label="{t}s_indexed_doc".format(t=measurement_time), value=nb_docs_diff, warn=s_warning, crit=s_critical ) #format OUtput output = OutputFormatHelpers.check_output_string( status, nb_docs_message, [con_perf_data_string] ) print(output) except Exception as e: if debug: print(e) the_type, value, tb = sys.exc_info() traceback.print_tb(tb) print("Error: {m}".format(m=e)) sys.exit(2) finally: if status == "Critical":
if cluster_status != 'green': status = 'Critical' comment = 'not green' if debug: print(status) cluster_status_comment=cluster_status_template.format( c=comment ) #format OUtput perfdata = None output = OutputFormatHelpers.check_output_string( status, cluster_status_comment, [perfdata] ) print(output) except Exception as e: if debug: print(e) the_type, value, tb = sys.exc_info() traceback.print_tb(tb) print("Error: {m}".format(m=e)) sys.exit(2) finally:
#Format perf data string con_perf_data_string = OutputFormatHelpers.perf_data_string( label='heap_used', value=percentage_heap_used, warn=s_warning, crit=s_critical, min=0, max=100, UOM='%' ) #format OUtput output = OutputFormatHelpers.check_output_string( status, heap_usage_comment, [con_perf_data_string] ) print(output) except Exception as e: if debug: print(e) the_type, value, tb = sys.exc_info() traceback.print_tb(tb) print("Error: {m}".format(m=e)) sys.exit(2) finally: if status == "Critical":