diff options
Diffstat (limited to 'src/usr/local/www/status_rrd_graph_img.php')
-rw-r--r-- | src/usr/local/www/status_rrd_graph_img.php | 23 |
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)); |