(no subject)
[email protected] Fri, 04 Apr 2014 23:14:56 +0400
| Newsgroups | gmane.network.cacti.user |
|---|---|
| Message-ID | <[email protected]> |
Hi all! I found bug in leatest stable version cacti 0.8.8b was installed today.
When i making graphs from http://forums.cacti.net/viewtopic.php?f=12&t=11020 all works fine without one piece.
When i opening graph preview of host with that graph, my preview was not display images, but if i open link of this broken image then graphs works fine.
After debug function i was found bug place and fix it.
patch for file lib/rrd.php
@@ -1347,14 +1347,14 @@
$comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":" . str_replace(":", "\:", cacti_escapeshellarg($graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id])) . " ";
if (trim($comment_string) == 'COMMENT:"\n"') {
$txt_graph_items .= 'COMMENT:" \n"'; # rrdtool will skip a COMMENT that holds a NL only; so add a blank to make NL work
- } else if (trim($comment_string) != "COMMENT:\"\"") {
+ } else if ((trim($comment_string) != "COMMENT:\"\"")&&(trim($comment_string) != "COMMENT:''")) {
$txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item);
}
}else {
$comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":" . cacti_escapeshellarg($graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id]) . " ";
if (trim($comment_string) == 'COMMENT:"\n"') {
$txt_graph_items .= 'COMMENT:" \n"'; # rrdtool will skip a COMMENT that holds a NL only; so add a blank to make NL work
- } else if (trim($comment_string) != "COMMENT:\"\"") {
+ } else if ((trim($comment_string) != "COMMENT:\"\"")&&(trim($comment_string) != "COMMENT:''")) {
$txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item);
}
}
I hope my fix help make cacti rater.
------------------------------------------------------------------------------