SOURCES: ping_php_version4_snmpgetnext.patch (NEW), tree_console_m...

grzegorz grzegorz at pld-linux.org
Sat Feb 17 11:04:37 CET 2007


Author: grzegorz                     Date: Sat Feb 17 10:04:37 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:


---- Files affected:
SOURCES:
   ping_php_version4_snmpgetnext.patch (NONE -> 1.1)  (NEW), tree_console_missing_hosts.patch (NONE -> 1.1)  (NEW), thumbnail_graphs_not_working.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/ping_php_version4_snmpgetnext.patch
diff -u /dev/null SOURCES/ping_php_version4_snmpgetnext.patch:1.1
--- /dev/null	Sat Feb 17 11:04:37 2007
+++ SOURCES/ping_php_version4_snmpgetnext.patch	Sat Feb 17 11:04:32 2007
@@ -0,0 +1,42 @@
+--- 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);

================================================================
Index: SOURCES/tree_console_missing_hosts.patch
diff -u /dev/null SOURCES/tree_console_missing_hosts.patch:1.1
--- /dev/null	Sat Feb 17 11:04:37 2007
+++ SOURCES/tree_console_missing_hosts.patch	Sat Feb 17 11:04:32 2007
@@ -0,0 +1,20 @@
+--- cacti-0.8.6j/lib/html_tree.php	2007-01-17 19:23:10.000000000 -0500
++++ cacti-0.8.6j-patch/lib/html_tree.php	2007-01-27 15:48:50.390625000 -0500
+@@ -328,7 +328,7 @@
+ 	while ($i > 1) {
+ 		$i--;
+ 
+-		$parent_tier = substr($tier_string, 0, $i * CHARS_PER_TIER);
++		$parent_tier = tree_tier_string(substr($tier_string, 0, $i * CHARS_PER_TIER));
+ 		$parent_variable = "sess_tree_leaf_expand_" . $leaf["graph_tree_id"] . "_" . $parent_tier;
+ 
+ 		$effective = @$_SESSION[$parent_variable];
+@@ -365,8 +365,6 @@
+    @returns - the string representing the leaf position
+ */
+ function tree_tier_string($order_key, $chars_per_tier = CHARS_PER_TIER) {
+-	$root_test = str_pad('', $chars_per_tier, '0');
+-
+ 	$new_string = preg_replace("/0+$/",'',$order_key);
+ 
+ 	return $new_string;

================================================================
Index: SOURCES/thumbnail_graphs_not_working.patch
diff -u /dev/null SOURCES/thumbnail_graphs_not_working.patch:1.1
--- /dev/null	Sat Feb 17 11:04:37 2007
+++ SOURCES/thumbnail_graphs_not_working.patch	Sat Feb 17 11:04:32 2007
@@ -0,0 +1,20 @@
+--- cacti-0.8.6j/lib/rrd.php	2007-01-17 19:23:10.000000000 -0500
++++ cacti-0.8.6j-patch/lib/rrd.php	2007-02-01 20:29:59.687500000 -0500
+@@ -1080,9 +1080,15 @@
+ 
+ 		if ($graph_item_types{$graph_item["graph_type_id"]} == "COMMENT") {
+ 			if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
+-				$txt_graph_items .= $graph_item_types{$graph_item["graph_type_id"]} . ":\"" . str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]) . $hardreturn[$graph_item_id] . "\" ";
++				$comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":\"" . str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]) . $hardreturn[$graph_item_id] . "\" ";
++				if (trim($comment_string) != "COMMENT:\"\"") {
++					$txt_graph_items .= $comment_string;
++				}
+ 			}else {
+-				$txt_graph_items .= $graph_item_types{$graph_item["graph_type_id"]} . ":\"" . $graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id] . "\" ";
++				$comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":\"" . $graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id] . "\" ";
++				if (trim($command_string) != "COMMENT:\"\"") {
++					$txt_graph_items .= $comment_string;
++				}
+ 			}
+ 		}elseif (($graph_item_types{$graph_item["graph_type_id"]} == "GPRINT") && (!isset($graph_data_array["graph_nolegend"]))) {
+ 			$graph_variables["text_format"][$graph_item_id] = str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]); /* escape colons */
================================================================


More information about the pld-cvs-commit mailing list