summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorthompsa <andy@fud.org.nz>2009-12-27 11:36:47 +1300
committerthompsa <andy@fud.org.nz>2009-12-27 11:36:47 +1300
commitec51a2224e6d25056cf5c12a8b5def5dfb5b1a48 (patch)
treee5b1b73a9ecb677808d0554b4e35f03e7917103f /usr
parent2248a940278a5bcad64322ca8d8c591968ca51d8 (diff)
downloadpfsense-ec51a2224e6d25056cf5c12a8b5def5dfb5b1a48.zip
pfsense-ec51a2224e6d25056cf5c12a8b5def5dfb5b1a48.tar.gz
Add graphing for 3G cellular modems.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/status_rrd_graph.php3
-rw-r--r--usr/local/www/status_rrd_graph_img.php28
2 files changed, 30 insertions, 1 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index a1b6f42..618f69b 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -107,6 +107,7 @@ rsort($databases);
$dbheader = array("allgraphs-traffic.rrd",
"allgraphs-quality.rrd",
"allgraphs-wireless.rrd",
+ "allgraphs-cellular.rrd",
"allgraphs-packets.rrd",
"system-allgraphs.rrd",
"system-throughput.rrd",
@@ -148,6 +149,8 @@ include("head.inc");
$tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops");
if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; }
$tab_array[] = array("Wireless", $tabactive, "status_rrd_graph.php?cat=wireless");
+ if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular");
if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; }
$tab_array[] = array("Settings", $tabactive, "status_rrd_graph_settings.php");
display_top_tabs($tab_array);
diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php
index 7e36c41..b395c99 100644
--- a/usr/local/www/status_rrd_graph_img.php
+++ b/usr/local/www/status_rrd_graph_img.php
@@ -795,7 +795,33 @@ elseif((strstr($curdatabase, "spamd.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "GPRINT:\"consavg:AVERAGE:\"Avg\\:%6.2lf\\t\" ";
$graphcmd .= "GPRINT:\"consmax:MAX:\"Max\\:%6.2lf\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" ";
-} else {
+}
+elseif((strstr($curdatabase, "-cellular.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
+ $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$interval.png ";
+ $graphcmd .= "--start -$seconds -e -$average ";
+ $graphcmd .= "--vertical-label \"signal\" ";
+ $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
+ $graphcmd .= "--title \"`hostname` - {$prettydb} - {$hperiod} - {$havg} average\" ";
+ $graphcmd .= "--height 200 --width 620 -x \"$scale\" ";
+ $graphcmd .= "DEF:\"$curif-signal1=$rrddbpath$curdatabase:signal1:AVERAGE\" ";
+ $graphcmd .= "DEF:\"$curif-signal2=$rrddbpath$curdatabase:signal2:AVERAGE\" ";
+ $graphcmd .= "LINE2:\"$curif-signal1#{$colorwireless[0]}:$curif-signal1\" ";
+ $graphcmd .= "LINE2:\"$curif-signal2#{$colorwireless[1]}:$curif-signal2\" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t maximum\t\t average\t current\\n\" ";
+ $graphcmd .= "COMMENT:\"Signal1\t\t\" ";
+ $graphcmd .= "GPRINT:\"$curif-signal1:MAX:%7.2lf dBm \" ";
+ $graphcmd .= "GPRINT:\"$curif-signal1:AVERAGE:%7.2lf dBm \" ";
+ $graphcmd .= "GPRINT:\"$curif-signal1:LAST:%7.2lf dBm\" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Signal2\t\t\" ";
+ $graphcmd .= "GPRINT:\"$curif-signal2:MAX:%7.2lf dBm \" ";
+ $graphcmd .= "GPRINT:\"$curif-signal2:AVERAGE:%7.2lf dBm \" ";
+ $graphcmd .= "GPRINT:\"$curif-signal2:LAST:%7.2lf dBm\" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" ";
+}
+else {
$data = false;
log_error("Sorry we do not have data to graph for $curdatabase");
}
OpenPOWER on IntegriCloud