]> git.pld-linux.org Git - packages/cacti.git/blob - ping_php_version4_snmpgetnext.patch
*** empty log message ***
[packages/cacti.git] / ping_php_version4_snmpgetnext.patch
1 --- cacti-0.8.6j/lib/ping.php   2007-01-17 19:23:10.000000000 -0500
2 +++ cacti-0.8.6j-patch/lib/ping.php     2007-01-20 19:45:55.015625000 -0500
3 @@ -281,7 +281,13 @@
4  
5                 /* poll sysUptime for status */
6                 $retry_count = 0;
7 +
8 +               /* getnext does not work in php versions less than 5 */
9 +               if (version_compare("5", phpversion(), "<")) {
10                 $oid = ".1";
11 +               }else{\r                 $oid = ".1.3.6.1.2.1.1.3.0";
12 +               }
13 +
14                 while (1) {
15                         if ($retry_count >= $this->retries) {
16                                 $this->snmp_status   = "down";
17 @@ -289,6 +295,8 @@
18                                 return false;
19                         }
20  
21 +                       /* getnext does not work in php versions less than 5 */
22 +                       if (version_compare("5", phpversion(), "<")) {
23                         $output = cacti_snmp_getnext($this->host["hostname"],
24                                 $this->host["snmp_community"],
25                                 $oid,
26 @@ -298,6 +306,16 @@
27                                 $this->host["snmp_port"],
28                                 $this->host["snmp_timeout"],
29                                 SNMP_CMDPHP);
30 +                       }else{\r                         $output = cacti_snmp_get($this->host["hostname"],
31 +                                       $this->host["snmp_community"],
32 +                                       $oid,
33 +                                       $this->host["snmp_version"],
34 +                                       $this->host["snmp_username"],
35 +                                       $this->host["snmp_password"],
36 +                                       $this->host["snmp_port"],
37 +                                       $this->host["snmp_timeout"],
38 +                                       SNMP_CMDPHP);
39 +                       }
40  
41                         /* determine total time +- ~10% */
42                         $this->time = $this->get_time($this->precision);
This page took 0.078365 seconds and 3 git commands to generate.