diff options
author | N0YB <Al_Stu@Frontier.com> | 2014-02-19 18:18:07 -0800 |
---|---|---|
committer | N0YB <Al_Stu@Frontier.com> | 2014-02-19 18:18:07 -0800 |
commit | d55cba63e730d919f50c398fc07c35138c682ca9 (patch) | |
tree | e0e1c8ca6ae3caf31afae5f3e5230e2941886df6 /etc/inc/rrd.inc | |
parent | d3515e02d5b8ea9f0eb8245316015852b17193c9 (diff) | |
download | pfsense-d55cba63e730d919f50c398fc07c35138c682ca9.zip pfsense-d55cba63e730d919f50c398fc07c35138c682ca9.tar.gz |
Fix gateway quality RRD to have the correct granularity and be consistent with the pfSense graphs set.
Create gateway quality RRD with settings suitable for pfSense graph set, since apinger uses default step (300) and other settings that are not so good/consistent with the pfSense graphs set.
Originally Submitted as Pull Request #672.
Resubmitting to Master.
Diffstat (limited to 'etc/inc/rrd.inc')
-rw-r--r-- | etc/inc/rrd.inc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index f08ad52..222c39b 100644 --- a/etc/inc/rrd.inc +++ b/etc/inc/rrd.inc @@ -927,6 +927,33 @@ function enable_rrd_graphing() { } +# Create gateway quality RRD with settings suitable for pfSense graph set. +function create_gateway_quality_rrd($rrd_file) { + $rrdinterval = 60; + $valid = $rrdinterval * 2; + $rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool"; + + /* GATEWAY QUALITY, set up the rrd file */ + if (!file_exists("$rrd_file")) { + $rrdcreate = "$rrdtool create $rrd_file --step $rrdinterval "; + $rrdcreate .= "DS:loss:GAUGE:$valid:0:100 "; + $rrdcreate .= "DS:delay:GAUGE:$valid:0:100000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:1:1200 "; + $rrdcreate .= "RRA:AVERAGE:0.5:5:720 "; + $rrdcreate .= "RRA:AVERAGE:0.5:60:1860 "; + $rrdcreate .= "RRA:AVERAGE:0.5:1440:2284 "; + + create_new_rrd($rrdcreate); + unset($rrdcreate); + } + + /* enter UNKNOWN values in the RRD so it knows we rebooted. */ + if($g['booting']) { + mwexec("$rrdtool update $rrd_file N:U:U"); + } + unset($rrdtool, $rrdinterval, $valid, $rrd_file); +} + function kill_traffic_collector() { global $g; |