From f66ce9bdd91a1942308fc0f1e905554a6fb573c2 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Tue, 1 Apr 2008 11:15:11 +0000 Subject: [PATCH] fixing some graphing bits git-svn-id: http://www.observium.org/svn/observer/trunk@218 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/default.php | 2 ++ includes/graphing.php | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/html/pages/default.php b/html/pages/default.php index 3f699ac57..0a6ce2af7 100644 --- a/html/pages/default.php +++ b/html/pages/default.php @@ -28,6 +28,7 @@ while($device = mysql_fetch_array($sql)){ echo("
".generatedevicelink($device, shorthost($device['hostname']))."
Device Down + ".truncate($device['location'], 20)."
"); @@ -39,6 +40,7 @@ while($interface = mysql_fetch_array($sql)){ generate_front_box("warn", "
".generatedevicelink($interface, shorthost($interface['hostname']))."
Port Down + ".generateiflink($interface, makeshortif($interface['ifDescr']))."
".truncate($interface['ifAlias'], 20)."
"); diff --git a/includes/graphing.php b/includes/graphing.php index 4aaa056cc..2b789a98c 100644 --- a/includes/graphing.php +++ b/includes/graphing.php @@ -137,6 +137,7 @@ function graph_device_bits ($device, $graph, $from, $to, $width, $height) { global $config, $rrdtool, $installdir, $mono_font; $imgfile = "graphs/" . "$graph"; $options = "--alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height "; + if($height < "33") { $options .= " --only-graph"; } $hostname = gethostbyid($device); $query = mysql_query("SELECT `ifIndex` FROM `interfaces` WHERE `device_id` = '$device' AND `ifType` NOT LIKE '%oopback%' AND `ifType` NOT LIKE '%SVI%' AND `ifType` != 'l2vlan'"); if($width <= "300") { $options .= "--font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; } @@ -179,6 +180,7 @@ function trafgraph ($rrd, $graph, $from, $to, $width, $height) { $imgfile = "graphs/" . "$graph"; $period = $to - $from; $options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height "; + if($height < "33") { $options .= " --only-graph"; } if($width <= "300") { $options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; } $options .= " DEF:inoctets=$database:INOCTETS:AVERAGE"; $options .= " DEF:outoctets=$database:OUTOCTETS:AVERAGE"; @@ -316,7 +318,7 @@ function cpugraph ($rrd, $graph , $from, $to, $width, $height) { global $config, $rrdtool, $installdir, $mono_font; $database = $config['rrd_dir'] . "/" . $rrd; $imgfile = "graphs/" . "$graph"; - $options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height "; + $options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height "; if($width <= "300") {$options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; } $options .= " DEF:5s=$database:LOAD5S:AVERAGE"; $options .= " DEF:5m=$database:LOAD5M:AVERAGE"; @@ -351,7 +353,7 @@ function memgraph ($rrd, $graph , $from, $to, $width, $height, $title, $vertical $database = $config['rrd_dir'] . "/" . $rrd; $imgfile = "graphs/" . "$graph"; $period = $to - $from; - $options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height "; + $options = "-l 0 --alt-autoscale-max -E --start $from --end $to --width $width --height $height "; if($width <= "300") { $options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; } $options .= " DEF:MEMTOTAL=$database:MEMTOTAL:AVERAGE"; $options .= " DEF:IOFREE=$database:IOFREE:AVERAGE";