X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=contrib%2Fphp-collection%2Fgraph.php;h=fdfcbaaffe0e1f041f6a5514bf4f31ad273173ab;hb=8aad55ab7d737a97d5927458b2b00885e27cae4d;hp=17749e06926fd269da3c3b88c7a1f51582e08784;hpb=6a69db4d304118e11fd4bae9c761fc14674e4942;p=collectd.git diff --git a/contrib/php-collection/graph.php b/contrib/php-collection/graph.php index 17749e06..fdfcbaaf 100644 --- a/contrib/php-collection/graph.php +++ b/contrib/php-collection/graph.php @@ -86,7 +86,7 @@ function error($code, $code_msg, $title, $msg) { imagestring($png, 4, ceil(($w-strlen($title)*imagefontwidth(4)) / 2), 10, $title, $c_txt); imagestring($png, 5, 60, 35, sprintf('%s [%d]', $code_msg, $code), $c_etxt); if (function_exists('imagettfbbox') && is_file($config['error_font'])) { - // Detailled error message + // Detailed error message $fmt_msg = makeTextBlock($msg, $errorfont, 10, $w-86); $fmtbox = imagettfbbox(12, 0, $errorfont, $fmt_msg); imagettftext($png, 10, 0, 55, 35+3+imagefontwidth(5)-$fmtbox[7]+$fmtbox[1], $c_txt, $errorfont, $fmt_msg); @@ -164,7 +164,7 @@ $logscale = (boolean)read_var('logarithmic', $_GET, false); $tinylegend = (boolean)read_var('tinylegend', $_GET, false); // Check that at least 1 RRD exists for the specified request -$all_tinst = collectd_list_tinsts($host, $plugin, $pinst, $type); +$all_tinst = collectd_list_types($host, $plugin, $pinst, $type); if (count($all_tinst) == 0) return error404($graph_identifier, "No rrd file found for graphing"); @@ -182,7 +182,7 @@ if ($tinylegend) $opts['tinylegend'] = 1; $rrd_cmd = false; -if (isset($MetaGraphDefs[$type])) { +if ((is_null($tinst) || $tinst == '@merge') && isset($MetaGraphDefs[$type])) { $identifiers = array(); foreach ($all_tinst as &$atinst) $identifiers[] = collectd_identifier($host, $plugin, is_null($pinst) ? '' : $pinst, $type, $atinst);