diff options
author | Seth Mos <seth.mos@dds.nl> | 2011-05-24 22:44:17 +0200 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2011-05-24 22:44:17 +0200 |
commit | 92bb7a4174bcc89366cb45f192bfbda4f3fe3273 (patch) | |
tree | 9a4953dd1f554b1406840c5cb9a23e6a78693506 /etc/inc/rrd.inc | |
parent | 5aa28c8679ccd3fdfbb82bedee04ad4180d259cc (diff) | |
download | pfsense-92bb7a4174bcc89366cb45f192bfbda4f3fe3273.zip pfsense-92bb7a4174bcc89366cb45f192bfbda4f3fe3273.tar.gz |
Make it so that we use the correct fields in the right order
Diffstat (limited to 'etc/inc/rrd.inc')
-rw-r--r-- | etc/inc/rrd.inc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index d3de377..97d5a60 100644 --- a/etc/inc/rrd.inc +++ b/etc/inc/rrd.inc @@ -304,8 +304,14 @@ function enable_rrd_graphing() { $rrdupdatesh .= "\n"; $rrdupdatesh .= "# polling traffic for interface $ifname $realif IPv4/IPv6 counters \n"; - $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$traffic N:\\\n"; - $rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In4\/Pass|Out4\/Pass|In6\/Pass|Out6\/Pass|In4\/Block|Out4\/Block|In6\/Block|Out6\/Block/ {printf \$6 \":\"}'|sed -e 's/.\$//'`\n"; + $rrdupdatesh .= "TMPFILE=`mktemp -q /tmp/STATS_{$realif}.XXXXXX` \n"; + $rrdupdatesh .= "$pfctl -vvsI -i {$realif} > \$TMPFILE \n"; + $rrdupdatesh .= "unset BYTES \n"; + $rrdupdatesh .= "BYTES4P=`cat \$TMPFILE | awk '/In4\/Pass|Out4\/Pass/ {printf \$6 \":\"}'`\n"; + $rrdupdatesh .= "BYTES4B=`cat \$TMPFILE | awk '/In4\/Block|Out4\/Block/ {printf \$6 \":\"}'`\n"; + $rrdupdatesh .= "BYTES6P=`cat \$TMPFILE | awk '/In6\/Pass|Out6\/Pass/ {printf \$6 \":\"}'`\n"; + $rrdupdatesh .= "BYTES6B=`cat \$TMPFILE | awk '/In6\/Block|Out6\/Block/ {printf \$6 \":\"}'|sed -e 's/.\$//'`\n"; + $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$traffic N:\$BYTES4P\$BYTES4B\$BYTES6P\$BYTES6B\n"; /* PACKETS, set up the rrd file */ if (!file_exists("$rrddbpath$ifname$packets")) { @@ -333,8 +339,14 @@ function enable_rrd_graphing() { $rrdupdatesh .= "\n"; $rrdupdatesh .= "# polling packets for interface $ifname $realif \n"; - $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$packets N:\\\n"; - $rrdupdatesh .= "`$pfctl -vvsI -i {$realif} | awk '/In4\/Pass|Out4\/Pass|In6\/Pass|Out6\/Pass|In4\/Block|Out4\/Block|In6\/Block|Out6\/Block/ {printf \$4 \":\"}'|sed -e 's/.\$//'`\n"; + $rrdupdatesh .= "TMPFILE=`mktemp -q /tmp/STATS_{$realif}.XXXXXX` \n"; + $rrdupdatesh .= "$pfctl -vvsI -i {$realif} > \$TMPFILE \n"; + $rrdupdatesh .= "unset PACKETS \n"; + $rrdupdatesh .= "PACKETS4P=`cat \$TMPFILE | awk '/In4\/Pass|Out4\/Pass/ {printf \$4 \":\"}'`\n"; + $rrdupdatesh .= "PACKETS4B=`cat \$TMPFILE | awk '/In4\/Block|Out4\/Block/ {printf \$4 \":\"}'`\n"; + $rrdupdatesh .= "PACKETS6P=`cat \$TMPFILE | awk '/In6\/Pass|Out6\/Pass/ {printf \$4 \":\"}'`\n"; + $rrdupdatesh .= "PACKETS6B=`cat \$TMPFILE | awk '/In6\/Block|Out6\/Block/ {printf \$4 \":\"}'|sed -e 's/.\$//'`\n"; + $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$traffic N:\$PACKETS4P\$PACKETS4B\$PACKETS6P\$PACKETS6B\n"; /* WIRELESS, set up the rrd file */ if($config['interfaces'][$ifname]['wireless']['mode'] == "bss") { |