error graphs match size. use correct variables for storate and mempools overview.

git-svn-id: http://www.observium.org/svn/observer/trunk@2509 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-09-19 11:46:45 +00:00
parent f367b07294
commit 4514365d4f
3 changed files with 12 additions and 11 deletions
+7 -6
View File
@@ -84,16 +84,17 @@ else
function graph_error($string) function graph_error($string)
{ {
global $config, $width, $height, $debug, $graphfile, $rrd_options, $rrd_switches; global $_GET, $config, $debug, $graphfile;
#$rrd_options .= " HRULE:0#cc0000"; $_GET['bg'] = "FFBBBB";
#$rrd_cmd = $config['rrdtool'] . " graph $graphfile $rrd_options" . $rrd_switches;
echo(rrdtool_graph($graphfile, " --title='".$string."' -l 0 -u 100 -E --start -10y --end now --width $width --height $height -c BACK#ff9999cc -c SHADEA#EEEEEE00 -c SHADEB#EEEEEE00 -c FONT#000000 -c CANVAS#FFFFFF00 -c GRID#a5a5a5 -c MGRID#FF9999 -c FRAME#5e5e5e -c ARROW#5e5e5e -R normal --font LEGEND:8:DejaVuSansMono --font AXIS:7:DejaVuSansMono --font-render-mode normal HRULE:0#cc0000")); include("includes/graphs/common.inc.php");
$rrd_options .= " HRULE:0#555555";
$rrd_options .= " --title='".$string."'";
rrdtool_graph($graphfile, $rrd_options);
if ($height > "99") { if ($height > "99") {
#$rrd_cmd .= " --only-graph"; }
$woo = shell_exec($rrd_cmd); $woo = shell_exec($rrd_cmd);
if ($debug) { echo("<pre>".$rrd_cmd."</pre>"); } if ($debug) { echo("<pre>".$rrd_cmd."</pre>"); }
if (is_file($graphfile) && !$debug) if (is_file($graphfile) && !$debug)
+2 -2
View File
@@ -16,12 +16,12 @@ if (count($mempools))
foreach($mempools as $mempool) foreach($mempools as $mempool)
{ {
if (is_integer($mempool_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } if (is_integer($mempool_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
$perc = round($mempool['mempool_perc'],0); $percent= round($mempool['mempool_perc'],0);
$text_descr = rewrite_entity_descr($mempool['mempool_descr']); $text_descr = rewrite_entity_descr($mempool['mempool_descr']);
$total = formatStorage($mempool['mempool_total']); $total = formatStorage($mempool['mempool_total']);
$used = formatStorage($mempool['mempool_used']); $used = formatStorage($mempool['mempool_used']);
$free = formatStorage($mempool['mempool_free']); $free = formatStorage($mempool['mempool_free']);
$background = get_percentage_colours($perc); $background = get_percentage_colours($percent);
$graph_array = array(); $graph_array = array();
$graph_array['height'] = "100"; $graph_array['height'] = "100";
+3 -3
View File
@@ -42,11 +42,11 @@ if (count($drives))
if ($skipdrive) { continue; } if ($skipdrive) { continue; }
if (is_integer($drive_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } if (is_integer($drive_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
$perc = round($drive['storage_perc'], 0); $percent = round($drive['storage_perc'], 0);
$total = formatStorage($drive['storage_size']); $total = formatStorage($drive['storage_size']);
$free = formatStorage($drive['storage_free']); $free = formatStorage($drive['storage_free']);
$used = formatStorage($drive['storage_used']); $used = formatStorage($drive['storage_used']);
$background = get_percentage_colours($perc); $background = get_percentage_colours($percent);
$graph_array = array(); $graph_array = array();
$graph_array['height'] = "100"; $graph_array['height'] = "100";
@@ -69,7 +69,7 @@ if (count($drives))
$minigraph = generate_graph_tag($graph_array); $minigraph = generate_graph_tag($graph_array);
echo("<tr bgcolor=$row_colour> echo("<tr bgcolor=$row_colour>
<td class=tablehead>".overlib_link($link, $text_descr, $overlib_content)."</td> <td class=tablehead>".overlib_link($link, $drive['storage_descr'], $overlib_content)."</td>
<td width=90>".overlib_link($link, $minigraph, $overlib_content)."</td> <td width=90>".overlib_link($link, $minigraph, $overlib_content)."</td>
<td width=200>".overlib_link($link, print_percentage_bar (200, 20, $percent, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right']), $overlib_content)." <td width=200>".overlib_link($link, print_percentage_bar (200, 20, $percent, NULL, "ffffff", $background['left'], $percent . "%", "ffffff", $background['right']), $overlib_content)."
</a></td> </a></td>