summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-03-08 14:37:53 -0500
committerjim-p <jimp@pfsense.org>2011-03-08 14:37:53 -0500
commit4db0365d15118ce8651b8cc1c1b9fbbe88f7ba08 (patch)
tree85756294723d011fdac922cd904acbb72cbf9ef7 /etc
parentae3c0a126f1d935bd266fd5ea01aa873d9e8b0c6 (diff)
downloadpfsense-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.inc10
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 */
OpenPOWER on IntegriCloud