I have an IT inventory script that has a feature where it actually does a quick ping and returns an "up" or "down" image stating that systems status.
Basically I do this:
$cmd=shell_exec("ping -n 1 -w 1 $servername");
$dati_mount=explode(",",$cmd);
if (eregi ("1", $dati_mount[1], $out)) {$pingimg = "<img src='http://isweb.ksnet.com/images/server_inv/stat_up.gif' height=16' width='16' border='0' alt=''><br>";}
print {$pingimg = "<img src='http://isweb.ksnet.com/images/server_inv/stat_down.gif' height=16' width='16' border='0' alt=''><br>";}
echo $pingimg;
The problem is now that there is 100+ systems on the list it takes a little while for it to run through each ping in the "while" loops.
What I would like to do is have something where it calls a separate php file in each loop that returns the image without having to wait each ping to finish.
Basically keep going through the loops and have the image appear whenever the external script finishes. Is that even possible? Just want to check. Any other suggestions to speed this up?
Thanks for any help!!!