1 commit 32f1538a4a382b7b27e2340705e9b034f335ae6e
2 Author: cigamit <jimmy@sqmail.org>
3 Date: Sat Jun 2 12:16:13 2018 -0500
7 * Default snmp quick print setting resulting in false poller ASSERTS on
9 * Also enhance the cacti snmp functions to require only 3 or 4
11 * Minor format change to the vendor file classSNMP.php. No functional
14 diff --git a/include/phpsnmp/classSNMP.php b/include/phpsnmp/classSNMP.php
15 index e0f5b86d..ffa4aa88 100644
16 --- a/include/phpsnmp/classSNMP.php
17 +++ b/include/phpsnmp/classSNMP.php
18 @@ -150,7 +150,7 @@ class SNMP {
19 $backup['valueretrieval'] = snmp_get_valueretrieval();
20 snmp_set_valueretrieval($this->valueretrieval);
22 - $backup['quick_print'] = snmp_get_quick_print();
23 + $backup['quick_print'] = snmp_get_quick_print();
24 snmp_set_quick_print($this->quick_print);
26 if ($this->oid_output_format !== NULL) {
27 diff --git a/lib/snmp.php b/lib/snmp.php
28 index 885a07ee..382f94aa 100644
31 @@ -47,8 +47,8 @@ if (!class_exists('SNMP')) {
32 include_once($config['include_path'] . '/phpsnmp/classSNMP.php');
35 -function cacti_snmp_session($hostname, $community, $version, $auth_user, $auth_pass,
36 - $auth_proto, $priv_pass, $priv_proto, $context, $engineid,
37 +function cacti_snmp_session($hostname, $community, $version, $auth_user = '', $auth_pass = '',
38 + $auth_proto = '', $priv_pass = '', $priv_proto = '', $context = '', $engineid = '',
39 $port = 161, $timeout = 500, $retries = 0, $max_oids = 10) {
42 @@ -74,6 +74,7 @@ function cacti_snmp_session($hostname, $community, $version, $auth_user, $auth_p
43 $session->valueretrieval = SNMP_VALUE_LIBRARY;
46 + $session->quick_print = false;
47 $session->max_oids = $max_oids;
49 if (read_config_option('oid_increasing_check_disable') == 'on') {
50 @@ -105,8 +106,8 @@ function cacti_snmp_session($hostname, $community, $version, $auth_user, $auth_p
54 -function cacti_snmp_get($hostname, $community, $oid, $version, $auth_user, $auth_pass,
55 - $auth_proto, $priv_pass, $priv_proto, $context,
56 +function cacti_snmp_get($hostname, $community, $oid, $version, $auth_user = '', $auth_pass = '',
57 + $auth_proto = '', $priv_pass = '', $priv_proto = '', $context = '',
58 $port = 161, $timeout = 500, $retries = 0, $environ = SNMP_POLLER,
59 $engineid = '', $value_output_format = SNMP_STRING_OUTPUT_GUESS) {
61 @@ -198,8 +199,8 @@ function cacti_snmp_get($hostname, $community, $oid, $version, $auth_user, $auth
65 -function cacti_snmp_get_raw($hostname, $community, $oid, $version, $auth_user, $auth_pass,
66 - $auth_proto, $priv_pass, $priv_proto, $context,
67 +function cacti_snmp_get_raw($hostname, $community, $oid, $version, $auth_user = '', $auth_pass = '',
68 + $auth_proto = '', $priv_pass = '', $priv_proto = '', $context = '',
69 $port = 161, $timeout = 500, $retries = 0, $environ = SNMP_POLLER,
70 $engineid = '', $value_output_format = SNMP_STRING_OUTPUT_GUESS) {
72 @@ -287,8 +288,8 @@ function cacti_snmp_get_raw($hostname, $community, $oid, $version, $auth_user, $
76 -function cacti_snmp_getnext($hostname, $community, $oid, $version, $auth_user, $auth_pass,
77 - $auth_proto, $priv_pass, $priv_proto, $context,
78 +function cacti_snmp_getnext($hostname, $community, $oid, $version, $auth_user = '', $auth_pass = '',
79 + $auth_proto = '', $priv_pass = '', $priv_proto = '', $context = '',
80 $port = 161, $timeout = 500, $retries = 0, $environ = SNMP_POLLER,
81 $engineid = '', $value_output_format = SNMP_STRING_OUTPUT_GUESS) {
83 @@ -530,8 +531,8 @@ function cacti_snmp_session_getnext($session, $oid) {
87 -function cacti_snmp_walk($hostname, $community, $oid, $version, $auth_user, $auth_pass,
88 - $auth_proto, $priv_pass, $priv_proto, $context,
89 +function cacti_snmp_walk($hostname, $community, $oid, $version, $auth_user = '', $auth_pass = '',
90 + $auth_proto = '', $priv_pass = '', $priv_proto = '', $context = '',
91 $port = 161, $timeout = 500, $retries = 0, $max_oids = 10, $environ = SNMP_POLLER,
92 $engineid = '', $value_output_format = SNMP_STRING_OUTPUT_GUESS) {
94 commit afa01553f574554f782bbed3d2f1efaa355df2d0
95 Author: cigamit <jimmy@sqmail.org>
96 Date: Sat Jun 2 20:16:28 2018 -0500
98 Additional Change for Issue #1634
100 diff --git a/cmd.php b/cmd.php
101 index 0820444d..5a17c7c6 100644
104 @@ -525,7 +525,7 @@ if ((sizeof($polling_items) > 0) && (read_config_option('poller_enabled') == 'on
106 if (isset($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']])) {
107 $sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']]->quick_print = true;
108 - $output = cacti_snmp_session_get($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']], $index_item['arg1'], true);
109 + $output = cacti_snmp_session_get($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']], $index_item['arg1']);
113 commit 9311987e8a22e9c838bc879ff8eceae7abfbeb65
114 Author: cigamit <jimmy@sqmail.org>
115 Date: Sat Jun 2 20:26:48 2018 -0500
117 Last update for issue #1634
119 diff --git a/cmd.php b/cmd.php
120 index 5a17c7c6..3061dc41 100644
123 @@ -524,7 +524,6 @@ if ((sizeof($polling_items) > 0) && (read_config_option('poller_enabled') == 'on
124 open_snmp_session($host_id, $item);
126 if (isset($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']])) {
127 - $sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']]->quick_print = true;
128 $output = cacti_snmp_session_get($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']], $index_item['arg1']);