1 diff -ruBbd cacti-0.8.7g/lib/ping.php cacti-0.8.7g-patched/lib/ping.php
2 --- cacti-0.8.7g/lib/ping.php 2010-07-09 18:33:46.000000000 -0400
3 +++ cacti-0.8.7g-patched/lib/ping.php 2010-08-31 20:31:22.000000000 -0400
5 switch(socket_select($r = array($this->socket), $w = array($this->socket), $f = array($this->socket), $to_sec, $to_usec)){
7 /* connection refused */
8 - $this->ping_response = "TCP ping connection refused";
9 - $this->ping_status = "down";
10 + $this->time = $this->get_time($this->precision);
12 + if (($this->time*1000) <= $this->timeout) {
13 + $this->ping_response = "TCP Ping connection refused (" . $this->time*1000 . " ms)";
14 + $this->ping_status = $this->time*1000;
17 $this->close_socket();
20 + return true; /* "connection refused" says: host is alive (else ping would time out) */
22 /* connected, so calculate the total time and return */
23 $this->time = $this->get_time($this->precision);