From d81ec135bdcaa35e4a446acde6582291c1b5f606 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 17 Jun 2006 15:46:43 +0000 Subject: [PATCH] Graph fixes from Seth. --- usr/local/www/status_rrd_graph.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 6b4c697564..f5c09b5267 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -53,6 +53,14 @@ if ($_GET['graph']) { $pgtitle = gettext("Status: RRD Graphs"); include("head.inc"); +$rrddbpath = "/var/db/rrd/"; +$traffic = "-traffic.rrd"; +$quality = "-quality.rrd"; +$queues = "-queues.rrd"; +$queuesdrop = "-queuesdrop.rrd"; +$packets = "-packets.rrd"; +$spamd = "spamd.rrd"; + ?> @@ -98,12 +106,14 @@ foreach ($graphs as $graph => $graphd) { $periods = array("2h", "6h", "48h", "14d", "2m", "18m"); -foreach($periods as $period => $interval) { - - PRINT "Analysis for $curif -- $interval $curgraph
"; - PRINT "\n\"$ifname

"; +if(file_exists("{$rrddbpath}{$curif}-{$curgraph}.rrd")) { + foreach($periods as $period => $interval) { + PRINT "Analysis for $curif -- $interval $curgraph
"; + PRINT "\n\"$ifname

"; + } +} else { + PRINT "There is no database available to generate $curgraph from.
"; } - ?>