From 58ed950ac7c7282e6a639cc15c4accac4597665a Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Fri, 20 Aug 2010 09:04:16 +0300 Subject: fix --- pingraph.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pingraph.php') diff --git a/pingraph.php b/pingraph.php index 62b2187..c83aa22 100755 --- a/pingraph.php +++ b/pingraph.php @@ -14,13 +14,16 @@ $data = array(); $columns = array(); $max_ping = 0; $min_ping = 0; +$host = 'ping'; while (!feof($ifh)) { $line = fgets($ifh, 4096); - preg_match('/from (\d+\.\d+\.\d+\.\d+) icmp_seq=(\d+) ttl=\d+ time=(\d+\.\d+)/', $line, $m); + preg_match('/from (\d+\.\d+\.\d+\.\d+): icmp_seq=(\d+) ttl=\d+ time=(\d+\.\d+)/', $line, $m); if (!empty($m)) { + print_r($m); $ts += $interval; - $time = $m[2]; + $host = $m[1]; + $time = $m[3]; if ($time > $max_ping) { $max_ping = $time; } @@ -48,7 +51,7 @@ $as =<<