Project

General

Profile

« Previous | Next » 

Revision 9dbbb0a3

Added by jeroen van breedam over 9 years ago

add dhcpd rrd graph

View differences:

src/usr/local/www/status_rrd_graph_img.php
285 285
/* Captive Portal Concurrent	Concurrent Users */
286 286
$colorcaptiveportalusers = array('990000');
287 287

  
288
$colordhcpd = array('990000');
289

  
288 290
switch ($curstyle) {
289 291
	case "absolute":
290 292
		$multiplier = 1;
......
1234 1236
	$graphcmd .= "GPRINT:\"wander:LAST:%7.2lf %S	\" ";
1235 1237
	$graphcmd .= "COMMENT:\"\\n\" ";
1236 1238
	$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
1239
} elseif ((strstr($curdatabase, "-dhcpd.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
1240
	/* define graphcmd for dhcpd stats */
1241
	$graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png ";
1242
	$graphcmd .= "--start $start --end $end --step $step ";
1243
	$graphcmd .= "--vertical-label \"Dhcp Leases\" ";
1244
	$graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
1245
	$graphcmd .= "--title \"" . php_uname('n') . " - {$prettydb} - {$hperiod} - {$havg} average\" ";
1246
	$graphcmd .= "--base=1000 ";
1247
	$graphcmd .= "--lower-limit=0 ";
1248
	$graphcmd .= "--slope-mode ";
1249
	$graphcmd .= "--height 200 --width 620 ";
1250
	$graphcmd .= "DEF:\"$curif-leases=$rrddbpath$curdatabase:leases:AVERAGE:step=$step\" ";
1251
	$graphcmd .= "AREA:\"$curif-leases#{$colordhcpd[0]}:Active Leases\" ";
1252
	$graphcmd .= "COMMENT:\"\\n\" ";
1253
	$graphcmd .= "COMMENT:\"\t\t\t	  current\t\t average\t		maximum\\n\" ";
1254
	$graphcmd .= "COMMENT:\"Leases Active\t\" ";
1255
	$graphcmd .= "GPRINT:\"$curif-leases:LAST:%8.0lf	  \" ";
1256
	$graphcmd .= "GPRINT:\"$curif-leases:AVERAGE:%8.0lf	  \" ";
1257
	$graphcmd .= "GPRINT:\"$curif-leases:MAX:%8.0lf \" ";
1258
	$graphcmd .= "COMMENT:\"\\n\" ";
1259
	$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\:%M\:%S %Y') . "\" ";
1237 1260
} else {
1238 1261
	$data = false;
1239 1262
	log_error(sprintf(gettext("Sorry we do not have data to graph for %s"),$curdatabase));

Also available in: Unified diff