I was just wondering if it's possible to detect the current execution timing for a running script, I am creating an application to ping some computers on the network. As this is being done from a Linux machine the pinging system differs from Windows.
On a linux machine, if the computer is off then the server will hang on the primary message after issuing the ping command and not have any more output.. Will just hang (with my experience with linux pinging)
So I have this script:
$Computer_Array = array(
"Managers" => "192.168.0.5",
"Domain Controller" => "192.168.0.1"
"Proxy Controller" => "192.168.0.214"
);
foreach ($Computer_Array AS $Addresses){
exec('ping'.$Addresses, $Output);
}
Later on this will be used to display statistics.. Now the problem is, as the managers computer is subject to both power conditions such as on or off when issuing the ping command, just hangs.. So i'm wondering if there is a method to capture the microtime();
of the current executing function, if it exceeds a threshold then move on to the next element. I would rather keep this to core PHP, but if such solution can only be done via AJAX or another language, then I would have to consult the developer if it's alright to integrate an external method.