次のmypingというshellで出るlogをWebで表示
#! /bin/sh date >> ~okada/log/pinglog ping -c3 202.59.187.76 >> ~okada/log/pinglog
<?php $match ="^rtt"; $fp = popen("/usr/bin/tail -200 ~okada/log/pinglog", "r"); while (!feof($fp)) { $line = fgets($fp, 1024); printf("%s <br>\n", $line); if (mb_ereg($match, $line)) { echo " <HR> Date : "; } } fclose($fp);
?>