def check_page_faults(con, host, port, warning, critical, perf_data):
 warning = (warning or 10)
 critical = (critical or 30)
 data = get_server_status(con)
 try:
  page_faults = float(data['extra_info']['page_faults'])
 except:
  return exit_with_general_critical('page_faults unsupported on the underlaying system')
 (err, delta) = maintain_delta([page_faults], host, port, 'page_faults')
 if (err == 0):
  page_faults_ps = (delta[1] / delta[0])
  message = ('Page faults : %.2f ps' % page_faults_ps)
  message += performance_data(perf_data, [(('%.2f' % page_faults_ps), 'page_faults_ps', warning, critical)])
  return check_levels(page_faults_ps, warning, critical, message)
 else:
  return exit_with_general_warning('problem reading data from temp file')

def check_page_faults ( con , host , port , warning , critical , perf_data ) : warning = ( warning or 10 ) critical = ( critical or 30 ) data = get_server_status ( con ) try : page_faults = float ( data [ 'extra_info' ] [ 'page_faults' ] ) except : return exit_with_general_critical ( 'page_faults unsupported on the underlaying system' ) ( err , delta ) = maintain_delta ( [ page_faults ] , host , port , 'page_faults' ) if ( err == 0 ) : page_faults_ps = ( delta [ 1 ] / delta [ 0 ] ) message = ( 'Page faults : %.2f ps' % page_faults_ps ) message += performance_data ( perf_data , [ ( ( '%.2f' % page_faults_ps ) , 'page_faults_ps' , warning , critical ) ] ) return check_levels ( page_faults_ps , warning , critical , message ) else : return exit_with_general_warning ( 'problem reading data from temp file' )
a function to get page_faults per second from the system .