diff options
author | jim-p <jimp@pfsense.org> | 2013-09-23 09:55:05 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-09-23 10:01:26 -0400 |
commit | 428ea19f8abcb4f261e7136e2664494af834239d (patch) | |
tree | 718a3475e4ca9edef47624df213137ce310d6326 | |
parent | 9e768dafa4b34e0983ee02af84216d9d560e9410 (diff) | |
download | pfsense-428ea19f8abcb4f261e7136e2664494af834239d.zip pfsense-428ea19f8abcb4f261e7136e2664494af834239d.tar.gz |
Fix CP stats generation for concurrent users. Fixes #3225
-rw-r--r-- | etc/inc/rrd.inc | 4 | ||||
-rw-r--r-- | usr/local/bin/captiveportal_gather_stats.php | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index af1908b..d09ef82 100644 --- a/etc/inc/rrd.inc +++ b/etc/inc/rrd.inc @@ -800,7 +800,7 @@ function enable_rrd_graphing() { /* the Captive Portal stats gathering function. */ $rrdupdatesh .= "\n"; $rrdupdatesh .= "# polling Captive Portal for number of concurrent users\n"; - $rrdupdatesh .= "CP=`$php -q $captiveportal_gather '$cpkey' $concurrent`\n"; + $rrdupdatesh .= "CP=`${php} -q ${captiveportal_gather} '${cpkey}' 'concurrent'`\n"; $rrdupdatesh .= "$rrdtool update $concurrent_filename \${CP}\n"; $loggedin_filename = $rrddbpath . $ifname . '-' . $cpkey . $captiveportalloggedin; @@ -836,7 +836,7 @@ function enable_rrd_graphing() { /* the Captive Portal stats gathering function. */ $rrdupdatesh .= "\n"; $rrdupdatesh .= "# polling Captive Portal for number of logged in users\n"; - $rrdupdatesh .= "CP=`$php -q $captiveportal_gather $cpkey loggedin`\n"; + $rrdupdatesh .= "CP=`${php} -q ${captiveportal_gather} '${cpkey}' 'loggedin'`\n"; $rrdupdatesh .= "$rrdtool update $loggedin_filename \${CP}\n"; } diff --git a/usr/local/bin/captiveportal_gather_stats.php b/usr/local/bin/captiveportal_gather_stats.php index 63d91a2..639edef 100644 --- a/usr/local/bin/captiveportal_gather_stats.php +++ b/usr/local/bin/captiveportal_gather_stats.php @@ -55,6 +55,7 @@ if(empty($type)) /* echo the rrd required syntax */ echo "N:"; +$result = "NaN"; if ($type == "loggedin") { @@ -101,7 +102,7 @@ if ($type == "loggedin") { else { $result = $current_user_count; } -} else +} elseif ($type == "concurrent") $result = $no_users; echo "$result"; |