Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37864472
en ru br
Репозитории ALT
S:1.2.24-alt1
5.1: 0.8.7b-alt4
4.1: 0.8.7b-alt2
4.0: 0.8.6j-alt1
www.altlinux.org/Changes

Группа :: Мониторинг
Пакет: cacti

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: cacti-0.8.6j-ping_php_version4_snmpgetnext.patch
Скачать


--- cacti-0.8.6j/lib/ping.php	2007-01-17 19:23:10.000000000 -0500
+++ cacti-0.8.6j-patch/lib/ping.php	2007-01-20 19:45:55.015625000 -0500
@@ -281,7 +281,13 @@
 
 		/* poll sysUptime for status */
 		$retry_count = 0;
+
+		/* getnext does not work in php versions less than 5 */
+		if (version_compare("5", phpversion(), "<")) {
 		$oid = ".1";
+		}else{
			$oid = ".1.3.6.1.2.1.1.3.0";
+		}
+
 		while (1) {
 			if ($retry_count >= $this->retries) {
 				$this->snmp_status   = "down";
@@ -289,6 +295,8 @@
 				return false;
 			}
 
+			/* getnext does not work in php versions less than 5 */
+			if (version_compare("5", phpversion(), "<")) {
 			$output = cacti_snmp_getnext($this->host["hostname"],
 				$this->host["snmp_community"],
 				$oid,
@@ -298,6 +306,16 @@
 				$this->host["snmp_port"],
 				$this->host["snmp_timeout"],
 				SNMP_CMDPHP);
+			}else{
				$output = cacti_snmp_get($this->host["hostname"],
+					$this->host["snmp_community"],
+					$oid,
+					$this->host["snmp_version"],
+					$this->host["snmp_username"],
+					$this->host["snmp_password"],
+					$this->host["snmp_port"],
+					$this->host["snmp_timeout"],
+					SNMP_CMDPHP);
+			}
 
 			/* determine total time +- ~10% */
 			$this->time = $this->get_time($this->precision);
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin