Project

General

Profile

« Previous | Next » 

Revision 9bc8b6b6

Added by Seth Mos over 14 years ago

Add support for IPv6 counters to the RRD graphs. This adds 4 more data sources in the rrd file.
The graphing code colors are currently a mismatch and sorts waiting for someone with eyes to adjust to something useful
Other themes still need adjusting
Packets graph isn't done, that needs the same modification as the traffic counters.
updaterrd.sh shell script needs simplyfying and using variables instead of huge amounts of pfctl commands

View differences:

etc/inc/rrd.inc
278 278
				$rrdcreate .= "DS:outpass:COUNTER:$trafficvalid:0:$upstream ";
279 279
				$rrdcreate .= "DS:inblock:COUNTER:$trafficvalid:0:$downstream ";
280 280
				$rrdcreate .= "DS:outblock:COUNTER:$trafficvalid:0:$upstream ";
281
				$rrdcreate .= "DS:inpass6:COUNTER:$trafficvalid:0:$downstream ";
282
				$rrdcreate .= "DS:outpass6:COUNTER:$trafficvalid:0:$upstream ";
283
				$rrdcreate .= "DS:inblock6:COUNTER:$trafficvalid:0:$downstream ";
284
				$rrdcreate .= "DS:outblock6:COUNTER:$trafficvalid:0:$upstream ";
281 285
				$rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
282 286
				$rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
283 287
				$rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
......
288 292

  
289 293
			/* enter UNKNOWN values in the RRD so it knows we rebooted. */
290 294
			if($g['booting']) {
291
				mwexec("$rrdtool update $rrddbpath$ifname$traffic N:U:U:U:U");
295
				mwexec("$rrdtool update $rrddbpath$ifname$traffic N:U:U:U:U:U:U:U:U");
292 296
			}
293 297

  
294 298
			$rrdupdatesh .= "\n";
295
			$rrdupdatesh .= "# polling traffic for interface $ifname $realif \n";
299
			$rrdupdatesh .= "# polling traffic for interface $ifname $realif IPv4/IPv6 counters \n";
296 300
			$rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$traffic N:\\\n";
297 301
			$rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In4\/Pass|Out4\/Pass/ {printf \$6 \":\"}'`\\\n";
298
			$rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In4\/Block|Out4\/Block/ {printf \$6 \":\"}'|sed -e 's/.\$//'`\n";
302
			$rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In4\/Block|Out4\/Block/ {printf \$6 \":\"}'`\\\n";
303
			$rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In6\/Pass|Out6\/Pass/ {printf \$6 \":\"}'`\\\n";
304
			$rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In6\/Block|Out6\/Block/ {printf \$6 \":\"}'|sed -e 's/.\$//'`\n";
299 305

  
300 306
			/* PACKETS, set up the rrd file */
301 307
			if (!file_exists("$rrddbpath$ifname$packets")) {
......
304 310
				$rrdcreate .= "DS:outpass:COUNTER:$packetsvalid:0:$upstream ";
305 311
				$rrdcreate .= "DS:inblock:COUNTER:$packetsvalid:0:$downstream ";
306 312
				$rrdcreate .= "DS:outblock:COUNTER:$packetsvalid:0:$upstream ";
313
				$rrdcreate .= "DS:inpass6:COUNTER:$packetsvalid:0:$downstream ";
314
				$rrdcreate .= "DS:outpass6:COUNTER:$packetsvalid:0:$upstream ";
315
				$rrdcreate .= "DS:inblock6:COUNTER:$packetsvalid:0:$downstream ";
316
				$rrdcreate .= "DS:outblock6:COUNTER:$packetsvalid:0:$upstream ";
307 317
				$rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
308 318
				$rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
309 319
				$rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
......
314 324

  
315 325
			/* enter UNKNOWN values in the RRD so it knows we rebooted. */
316 326
			if($g['booting']) {
317
				mwexec("$rrdtool update $rrddbpath$ifname$packets N:U:U:U:U");
327
				mwexec("$rrdtool update $rrddbpath$ifname$packets N:U:U:U:U:U:U:U:U");
318 328
			}
319 329

  
320 330
			$rrdupdatesh .= "\n";
321 331
			$rrdupdatesh .= "# polling packets for interface $ifname $realif \n";
322 332
			$rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$packets N:\\\n";
323 333
			$rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In4\/Pass|Out4\/Pass/ {printf \$4 \":\"}'`\\\n";
324
			$rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In4\/Block|Out4\/Block/ {printf \$4 \":\"}'|sed -e 's/.\$//'`\n";
334
			$rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In4\/Block|Out4\/Block/ {printf \$4 \":\"}'`\\\n";
335
			$rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In6\/Pass|Out6\/Pass/ {printf \$4 \":\"}'`\\\n";
336
			$rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In6\/Block|Out6\/Block/ {printf \$4 \":\"}'|sed -e 's/.\$//'`\n";
325 337

  
326 338
			/* WIRELESS, set up the rrd file */
327 339
			if($config['interfaces'][$ifname]['wireless']['mode'] == "bss") {
......
695 707
	mwexec("/bin/pkill -f updaterrd.sh", true);
696 708
}
697 709

  
698
?>
710
?>

Also available in: Unified diff