From 83e466a4bdc229f3da20e93ce560017a107f8aa1 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Wed, 14 Sep 2011 13:44:19 +0000 Subject: [PATCH] more improvements to graphs git-svn-id: http://www.observium.org/svn/observer/trunk@2455 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/graphs/device/bits.inc.php | 21 ++++++++++++++++--- .../generic_multi_bits_separated.inc.php | 1 + 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/html/includes/graphs/device/bits.inc.php b/html/includes/graphs/device/bits.inc.php index 65398a184..023851e5d 100644 --- a/html/includes/graphs/device/bits.inc.php +++ b/html/includes/graphs/device/bits.inc.php @@ -28,14 +28,29 @@ foreach (dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ?", array($id)) } } - if (is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($int['ifIndex'] . ".rrd")) && $ignore != 1) + $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($int['ifIndex'] . ".rrd"); + if (is_file($rrd_filename) && $ignore != 1) { - $rrd_filenames[] = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($int['ifIndex'] . ".rrd"); + $rrd_filenames[] = $rrd_filename; + $rrd_list[$i]['filename'] = $rrd_filename; + $rrd_list[$i]['descr'] = $port['ifDescr']; + $rrd_list[$i]['rra_in'] = $rra_in; + $rrd_list[$i]['rra_out'] = $rra_out; + $i++; } unset($ignore); } +$units ='bps'; +$total_units ='B'; +$colours_in ='greens'; +$multiplier = "8"; +$colours_out = 'blues'; + +$nototal = 1; + + $rra_in = "INOCTETS"; $rra_out = "OUTOCTETS"; @@ -46,6 +61,6 @@ $colour_line_out = "000099"; $colour_area_in = "CDEB8B"; $colour_area_out = "C3D9FF"; -include("includes/graphs/generic_multi_bits.inc.php"); +include("includes/graphs/generic_multi_bits_separated.inc.php"); ?> diff --git a/html/includes/graphs/generic_multi_bits_separated.inc.php b/html/includes/graphs/generic_multi_bits_separated.inc.php index 44bb04128..d6efbd755 100644 --- a/html/includes/graphs/generic_multi_bits_separated.inc.php +++ b/html/includes/graphs/generic_multi_bits_separated.inc.php @@ -9,6 +9,7 @@ if (!$nototal) { $rrd_options .= " COMMENT:'Total '"; } $rrd_options .= " COMMENT:'Out\: Current Maximum'"; if (!$nototal) { $rrd_options .= " COMMENT:' Total'"; } $rrd_options .= " COMMENT:'\\n'"; +if(!isset($multiplier)) { $multiplier = "8"; } foreach ($rrd_list as $rrd) {