summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/status_rrd_graph_img.php
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-11-10 10:25:30 -0500
committerStephen Beaver <sbeaver@netgate.com>2015-11-10 10:25:30 -0500
commitaf9fd483747d1070400f475d79a8d13b9dd5de69 (patch)
treed86e746e6c6b8e7f4becffbefd7adb6df3b24a75 /src/usr/local/www/status_rrd_graph_img.php
parentf1551428c4fe708232fc80239ec207640b058a28 (diff)
parent588a6068e476c2867948735ece7a5e8c886abd5a (diff)
downloadpfsense-af9fd483747d1070400f475d79a8d13b9dd5de69.zip
pfsense-af9fd483747d1070400f475d79a8d13b9dd5de69.tar.gz
Merge pull request #2036 from heper/patch-1
Diffstat (limited to 'src/usr/local/www/status_rrd_graph_img.php')
-rw-r--r--src/usr/local/www/status_rrd_graph_img.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/usr/local/www/status_rrd_graph_img.php b/src/usr/local/www/status_rrd_graph_img.php
index 5ec51d5..4c789a1 100644
--- a/src/usr/local/www/status_rrd_graph_img.php
+++ b/src/usr/local/www/status_rrd_graph_img.php
@@ -284,6 +284,8 @@ $colorntpd = array('0080FF', '00E344', 'FF0000', '000000');
/* Captive Portal Concurrent Concurrent Users */
$colorcaptiveportalusers = array('990000');
+$colordhcpd = array('990000', '0000FF');
+
switch ($curstyle) {
case "absolute":
$multiplier = 1;
@@ -1233,6 +1235,31 @@ if ((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdataba
$graphcmd .= "GPRINT:\"wander:LAST:%7.2lf %S \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
+} elseif ((strstr($curdatabase, "-dhcpd.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
+ /* define graphcmd for dhcpd stats */
+ $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png ";
+ $graphcmd .= "--start $start --end $end --step $step ";
+ $graphcmd .= "--vertical-label \"Dhcp Leases\" ";
+ $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
+ $graphcmd .= "--title \"" . php_uname('n') . " - {$prettydb} - {$hperiod} - {$havg} average\" ";
+ $graphcmd .= "--height 200 --width 620 ";
+ $graphcmd .= "DEF:\"$curif-leases=$rrddbpath$curdatabase:leases:AVERAGE:step=$step\" ";
+ $graphcmd .= "DEF:\"$curif-staticleases=$rrddbpath$curdatabase:staticleases:AVERAGE:step=$step\" ";
+ $graphcmd .= "LINE1:\"$curif-leases#{$colordhcpd[0]}:Active Leases\" ";
+ $graphcmd .= "LINE1:\"$curif-staticleases#{$colordhcpd[1]}:Static Leases\" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t current\t\t average\t maximum\\n\" ";
+ $graphcmd .= "COMMENT:\"Leases Active\t\" ";
+ $graphcmd .= "GPRINT:\"$curif-leases:LAST:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-leases:AVERAGE:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-leases:MAX:%8.0lf \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"Leases Static\t\" ";
+ $graphcmd .= "GPRINT:\"$curif-staticleases:LAST:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-staticleases:AVERAGE:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-staticleases:MAX:%8.0lf \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%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