Репозитории ALT
S: | 1.2.24-alt1 |
5.1: | 0.8.7b-alt4 |
4.1: | 0.8.7b-alt2 |
4.0: | 0.8.6j-alt1 |
Группа :: Мониторинг
Пакет: cacti
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: cacti-0.8.7g-ping.patch
Скачать
Скачать
diff -ruBbd cacti-0.8.7g/lib/ping.php cacti-0.8.7g-patched/lib/ping.php
--- cacti-0.8.7g/lib/ping.php 2010-07-09 18:33:46.000000000 -0400
+++ cacti-0.8.7g-patched/lib/ping.php 2010-08-31 20:31:22.000000000 -0400
@@ -577,12 +577,16 @@
switch(socket_select($r = array($this->socket), $w = array($this->socket), $f = array($this->socket), $to_sec, $to_usec)){
case 2:
/* connection refused */
- $this->ping_response = "TCP ping connection refused";
- $this->ping_status = "down";
+ $this->time = $this->get_time($this->precision);
+
+ if (($this->time*1000) <= $this->timeout) {
+ $this->ping_response = "TCP Ping connection refused (" . $this->time*1000 . " ms)";
+ $this->ping_status = $this->time*1000;
+ }
$this->close_socket();
- return false;
+ return true; /* "connection refused" says: host is alive (else ping would time out) */
case 1:
/* connected, so calculate the total time and return */
$this->time = $this->get_time($this->precision);