diff options
author | jim-p <jimp@pfsense.org> | 2011-03-08 14:37:53 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-03-08 14:37:53 -0500 |
commit | 4db0365d15118ce8651b8cc1c1b9fbbe88f7ba08 (patch) | |
tree | 85756294723d011fdac922cd904acbb72cbf9ef7 /etc | |
parent | ae3c0a126f1d935bd266fd5ea01aa873d9e8b0c6 (diff) | |
download | pfsense-4db0365d15118ce8651b8cc1c1b9fbbe88f7ba08.zip pfsense-4db0365d15118ce8651b8cc1c1b9fbbe88f7ba08.tar.gz |
Keep the output in a variable before passing it to rrdtool in case we also want to pass it to something else.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/rrd.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index 472c207..52b826b 100644 --- a/etc/inc/rrd.inc +++ b/etc/inc/rrd.inc @@ -300,9 +300,10 @@ function enable_rrd_graphing() { $rrdupdatesh .= "# polling traffic for interface $ifname $realif \n"; $rrdupdatesh .= "TMPFILE=`mktemp -q /tmp/STATS_{$realif}.XXXXXX` \n"; $rrdupdatesh .= "$pfctl -vvsI -i {$realif} > \$TMPFILE \n"; - $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$traffic N:\\\n"; - $rrdupdatesh .= "`cat \$TMPFILE | awk '/In4\/Pass|Out4\/Pass/ {printf \$6 \":\"}'`\\\n"; + $rrdupdatesh .= "unset BYTES \n"; + $rrdupdatesh .= "BYTES=`cat \$TMPFILE | awk '/In4\/Pass|Out4\/Pass/ {printf \$6 \":\"}'`\\\n"; $rrdupdatesh .= "`cat \$TMPFILE | awk '/In4\/Block|Out4\/Block/ {printf \$6 \":\"}'|sed -e 's/.\$//'`\n"; + $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$traffic N:\$BYTES\n"; /* PACKETS, set up the rrd file */ if (!file_exists("$rrddbpath$ifname$packets")) { @@ -326,9 +327,10 @@ function enable_rrd_graphing() { $rrdupdatesh .= "\n"; $rrdupdatesh .= "# polling packets for interface $ifname $realif \n"; - $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$packets N:\\\n"; - $rrdupdatesh .= "`cat \$TMPFILE | awk '/In4\/Pass|Out4\/Pass/ {printf \$4 \":\"}'`\\\n"; + $rrdupdatesh .= "unset PACKETS \n"; + $rrdupdatesh .= "PACKETS=`cat \$TMPFILE | awk '/In4\/Pass|Out4\/Pass/ {printf \$4 \":\"}'`\\\n"; $rrdupdatesh .= "`cat \$TMPFILE | awk '/In4\/Block|Out4\/Block/ {printf \$4 \":\"}'|sed -e 's/.\$//'`\n"; + $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$packets N:\$PACKETS\n"; $rrdupdatesh .= "rm \$TMPFILE \n"; /* WIRELESS, set up the rrd file */ |