Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 159278
Collapse All | Expand All

(-)ping.php.orig (-10 / +28 lines)
Lines 281-287 Link Here
281
281
282
		/* poll sysUptime for status */
282
		/* poll sysUptime for status */
283
		$retry_count = 0;
283
		$retry_count = 0;
284
		$oid = ".1";
284
285
		/* getnext does not work in php versions less than 5 */
286
		if (version_compare("5", phpversion(), "<")) {
287
			$oid = ".1";
288
		}else{			$oid = ".1.3.6.1.2.1.1.3.0";
289
		}
290
285
		while (1) {
291
		while (1) {
286
			if ($retry_count >= $this->retries) {
292
			if ($retry_count >= $this->retries) {
287
				$this->snmp_status   = "down";
293
				$this->snmp_status   = "down";
Lines 289-303 Link Here
289
				return false;
295
				return false;
290
			}
296
			}
291
297
292
			$output = cacti_snmp_getnext($this->host["hostname"],
298
			/* getnext does not work in php versions less than 5 */
293
				$this->host["snmp_community"],
299
			if (version_compare("5", phpversion(), "<")) {
294
				$oid,
300
				$output = cacti_snmp_getnext($this->host["hostname"],
295
				$this->host["snmp_version"],
301
					$this->host["snmp_community"],
296
				$this->host["snmp_username"],
302
					$oid,
297
				$this->host["snmp_password"],
303
					$this->host["snmp_version"],
298
				$this->host["snmp_port"],
304
					$this->host["snmp_username"],
299
				$this->host["snmp_timeout"],
305
					$this->host["snmp_password"],
300
				SNMP_CMDPHP);
306
					$this->host["snmp_port"],
307
					$this->host["snmp_timeout"],
308
					SNMP_CMDPHP);
309
			}else{				$output = cacti_snmp_get($this->host["hostname"],
310
					$this->host["snmp_community"],
311
					$oid,
312
					$this->host["snmp_version"],
313
					$this->host["snmp_username"],
314
					$this->host["snmp_password"],
315
					$this->host["snmp_port"],
316
					$this->host["snmp_timeout"],
317
					SNMP_CMDPHP);
318
			}
301
319
302
			/* determine total time +- ~10% */
320
			/* determine total time +- ~10% */
303
			$this->time = $this->get_time($this->precision);
321
			$this->time = $this->get_time($this->precision);

Return to bug 159278