Changeset 32 for measure_scripts/system.php
- Timestamp:
- Aug 23, 2008, 7:21:27 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
measure_scripts/system.php
r31 r32 7 7 } 8 8 9 function CheckPortStatus($Ip, $Port )9 function CheckPortStatus($Ip, $Port, $Timeout = 0.5) 10 10 { 11 11 set_error_handler('ErrorHandler'); 12 12 //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)) 14 14 { 15 15 fclose($Fp1); 16 return true;16 return(TRUE); 17 17 } else 18 18 { 19 19 //echo($ERROR_NO.','.$ERROR_STR); 20 //die(); 21 return false; 20 return(FALSE); 22 21 } 23 22 restore_error_handler(); … … 141 140 } 142 141 142 function 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 143 151 ?>
Note:
See TracChangeset
for help on using the changeset viewer.