Re: cacti-0.8.8b: Multiple COMMENT arguments in "rrdtool graph" ??
Marc-Christian Petersen <[email protected]>
| Newsgroups | gmane.network.cacti.user |
|---|---|
| Message-ID | <[email protected]> |
the problem code is this (diff 0.8.8a -> 0.8.8b):
lib/rrd.php
@@ -1344,14 +1344,14 @@ function rrdtool_function_graph($local_g
if ($graph_item_types{$graph_item["graph_type_id"]} == "COMMENT") {
if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
- $comment_string = $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(":", "\:", 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:\"\"") {
$txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item);
}
}else {
- $comment_string = $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"]} . ":" . 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:\"\"") {
unapplying this fixes the "no empty comments" problem.
Am 08.08.2013 um 9:45:03 Uhr schrieb Marc-Christian Petersen <[email protected]>:
> Hi Christian,
>
> Am 08.08.2013 um 8:55:27 Uhr schrieb Christian Adler <[email protected]>:
>
>
>> after upgrading to 0.8.8b we have problems with some thumbnail graphs.
>> In the logfile we found:
>> This results in "ERROR: Expected some arguments after 'COMMENT:'" and no
>> thumbnail displayed.
>> Why are there three COMMENT-arguments in this command??
>> How can we fix it?
>
> yep, there seems to be something fishi.
>
> All COMMENTS with <HR> are now nothing instead of empty newlines
> like in every release before.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk