summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_rrd_graph_img.php
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2011-01-28 17:16:19 +0200
committerWarren Baker <warren@decoy.co.za>2011-01-28 17:16:19 +0200
commit20413b72bfd31282276c8ac2a116014f92914d4e (patch)
tree01a33a0783da5edda830302b96c98d5757fb13ba /usr/local/www/status_rrd_graph_img.php
parent9b2e42c9faef82b0e040f106737d7bc33a6ee7ed (diff)
downloadpfsense-20413b72bfd31282276c8ac2a116014f92914d4e.zip
pfsense-20413b72bfd31282276c8ac2a116014f92914d4e.tar.gz
Added Captive Portal RRD graphs, there are two graphs one for the number of logged in users since last rrd poll, and concurrent number of users logged in.
Diffstat (limited to 'usr/local/www/status_rrd_graph_img.php')
-rw-r--r--usr/local/www/status_rrd_graph_img.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php
index 4610233..34040db 100644
--- a/usr/local/www/status_rrd_graph_img.php
+++ b/usr/local/www/status_rrd_graph_img.php
@@ -209,6 +209,7 @@ if(file_exists($rrdcolors)) {
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
$colorvpnusers = array('990000');
+ $colorcaptiveportalusers = array('990000');
}
switch ($curstyle) {
@@ -910,6 +911,44 @@ elseif((strstr($curdatabase, "-cellular.rrd")) && (file_exists("$rrddbpath$curda
$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\"`\" ";
}
+elseif((strstr($curdatabase, "-loggedin.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
+ /* define graphcmd for online Captive Portal users stats */
+ $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png ";
+ $graphcmd .= "--start $start --end $end ";
+ $graphcmd .= "--vertical-label \"Captive Portal Users\" ";
+ $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
+ $graphcmd .= "--title \"`hostname` - {$prettydb} - {$hperiod} - {$havg} average\" ";
+ $graphcmd .= "--height 200 --width 620 ";
+ $graphcmd .= "DEF:\"$curif-loggedinusers=$rrddbpath$curdatabase:loggedinusers:AVERAGE\" ";
+ $graphcmd .= "LINE2:\"$curif-loggedinusers#{$colorcaptiveportalusers[0]}:$curif-loggedinusers\" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t current\t\t average\t maximum\\n\" ";
+ $graphcmd .= "COMMENT:\"Users Online\t\" ";
+ $graphcmd .= "GPRINT:\"$curif-loggedinusers:LAST:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-loggedinusers:AVERAGE:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-loggedinusers:MAX:%7.2lf \" ";
+ $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\"`\" ";
+}
+elseif((strstr($curdatabase, "-concurrent.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
+ /* define graphcmd for online Captive Portal users stats */
+ $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png ";
+ $graphcmd .= "--start $start --end $end ";
+ $graphcmd .= "--vertical-label \"Captive Portal Users\" ";
+ $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
+ $graphcmd .= "--title \"`hostname` - {$prettydb} - {$hperiod} - {$havg} average\" ";
+ $graphcmd .= "--height 200 --width 620 ";
+ $graphcmd .= "DEF:\"$curif-concurrentusers=$rrddbpath$curdatabase:concurrentusers:AVERAGE\" ";
+ $graphcmd .= "LINE2:\"$curif-concurrentusers#{$colorcaptiveportalusers[0]}:$curif-concurrentusers\" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t current\t\t average\t maximum\\n\" ";
+ $graphcmd .= "COMMENT:\"Users Online\t\" ";
+ $graphcmd .= "GPRINT:\"$curif-concurrentusers:LAST:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-concurrentusers:AVERAGE:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-concurrentusers:MAX:%7.2lf \" ";
+ $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(sprintf(gettext("Sorry we do not have data to graph for %s"),$curdatabase));
OpenPOWER on IntegriCloud