summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/status_rrd_graph_img.php
diff options
context:
space:
mode:
authorheper <heper@users.noreply.github.com>2015-11-06 18:00:31 +0100
committerheper <heper@users.noreply.github.com>2015-11-06 18:00:31 +0100
commit9dbbb0a3006ebaa3cc29ce0d1a778be10c95b0e1 (patch)
treec808389cd3de38528106daeee6a2c5ceff2a9f53 /src/usr/local/www/status_rrd_graph_img.php
parent6837a0f5a8b39bd09122051638bfdd0130c32a27 (diff)
downloadpfsense-9dbbb0a3006ebaa3cc29ce0d1a778be10c95b0e1.zip
pfsense-9dbbb0a3006ebaa3cc29ce0d1a778be10c95b0e1.tar.gz
add dhcpd rrd graph
Diffstat (limited to 'src/usr/local/www/status_rrd_graph_img.php')
-rw-r--r--src/usr/local/www/status_rrd_graph_img.php23
1 files changed, 23 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 be1320f..907f46d 100644
--- a/src/usr/local/www/status_rrd_graph_img.php
+++ b/src/usr/local/www/status_rrd_graph_img.php
@@ -285,6 +285,8 @@ $colorntpd = array('0080FF', '00E344', 'FF0000', '000000');
/* Captive Portal Concurrent Concurrent Users */
$colorcaptiveportalusers = array('990000');
+$colordhcpd = array('990000');
+
switch ($curstyle) {
case "absolute":
$multiplier = 1;
@@ -1234,6 +1236,27 @@ 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 .= "--base=1000 ";
+ $graphcmd .= "--lower-limit=0 ";
+ $graphcmd .= "--slope-mode ";
+ $graphcmd .= "--height 200 --width 620 ";
+ $graphcmd .= "DEF:\"$curif-leases=$rrddbpath$curdatabase:leases:AVERAGE:step=$step\" ";
+ $graphcmd .= "AREA:\"$curif-leases#{$colordhcpd[0]}:Active 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:\"\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