def check_write_to_datafiles(con, warning, critical, perf_data):
 warning = (warning or 20)
 critical = (critical or 40)
 try:
  data = get_server_status(con)
  writes = data['dur']['writeToDataFilesMB']
  message = ('Write to data files : %.2f MB' % writes)
  message += performance_data(perf_data, [(('%.2f' % writes), 'write_to_data_files', warning, critical)])
  return check_levels(writes, warning, critical, message)
 except Exception as e:
  return exit_with_general_critical(e)

def check_write_to_datafiles ( con , warning , critical , perf_data ) : warning = ( warning or 20 ) critical = ( critical or 40 ) try : data = get_server_status ( con ) writes = data [ 'dur' ] [ 'writeToDataFilesMB' ] message = ( 'Write to data files : %.2f MB' % writes ) message += performance_data ( perf_data , [ ( ( '%.2f' % writes ) , 'write_to_data_files' , warning , critical ) ] ) return check_levels ( writes , warning , critical , message ) except Exception as e : return exit_with_general_critical ( e )
checking the average amount of data in megabytes written to the databases datafiles in the last four seconds .