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
";
+if(file_exists("{$rrddbpath}{$curif}-{$curgraph}.rrd")) {
+ foreach($periods as $period => $interval) {
+ PRINT "Analysis for $curif -- $interval $curgraph
";
+ PRINT "\n
";
+ }
+} else {
+ PRINT "There is no database available to generate $curgraph from.
";
}
-
?>