Changeset 32


Ignore:
Timestamp:
Aug 23, 2008, 7:21:27 PM (16 years ago)
Author:
george
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • measure_scripts/system.php

    r31 r32  
    77
    88
    9 function CheckPortStatus($Ip, $Port)
     9function CheckPortStatus($Ip, $Port, $Timeout = 0.5)
    1010{
    1111  set_error_handler('ErrorHandler');
    1212  //error_reporting(0);
    13   if($Fp1 = fsockopen($Ip, $Port, $ERROR_NO, $ERROR_STR,(float)0.5))
     13  if($Fp1 = fsockopen($Ip, $Port, $ERROR_NO, $ERROR_STR, (float)$Timeout))
    1414  {
    1515    fclose($Fp1);
    16     return true;
     16    return(TRUE);
    1717  } else
    1818  {
    1919    //echo($ERROR_NO.','.$ERROR_STR);
    20     //die();
    21     return false;
     20    return(FALSE);
    2221  }
    2322  restore_error_handler();
     
    141140}
    142141
     142function SystemUptime()
     143{
     144  $File = fopen('/proc/uptime', 'r');
     145  $Uptime = fgets($File);
     146  fclose($File);
     147  $UptimeParts = explode(' ', $Uptime);
     148  return($UptimeParts[0]);
     149}
     150
    143151?>
Note: See TracChangeset for help on using the changeset viewer.