diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-09-12 22:51:18 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-09-12 22:51:18 +0000 |
commit | fb707f4a3b00a05c441a19eb53ae1d33e6a342d3 (patch) | |
tree | 4ae81b0a331c9d61b4955d3df97b7c21c8a16963 /etc | |
parent | 998b88ad096a45083ce2d0e8a7e59e2887bd23e9 (diff) | |
download | pfsense-fb707f4a3b00a05c441a19eb53ae1d33e6a342d3.zip pfsense-fb707f4a3b00a05c441a19eb53ae1d33e6a342d3.tar.gz |
Correctly gather statictics for virtual interfaces. Maybe bridge needs to be added to the list but i will have to test that further.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 2f3c171..86c3322 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -3497,7 +3497,7 @@ function get_interface_info($ifdescr) { /* run netstat to determine link info */ unset($linkinfo); - exec("/usr/bin/netstat -I " . $ifinfo['hwif'] . " -nWb -f link", $linkinfo); + exec("/usr/bin/netstat -I " . $ifinfo['if'] . " -nWb -f link", $linkinfo); $linkinfo = preg_split("/\s+/", $linkinfo[1]); if (preg_match("/\*$/", $linkinfo[0])) { $ifinfo['status'] = "down"; @@ -3505,7 +3505,12 @@ function get_interface_info($ifdescr) { $ifinfo['status'] = "up"; } - if (!strstr($ifinfo['if'],'ovpn')) { + if (preg_match("/^enc|^tun|^ppp|^pptp|^ovpn/i", $ifinfo['if'])) { + $ifinfo['inpkts'] = $linkinfo[3]; + $ifinfo['inbytes'] = $linkinfo[5]; + $ifinfo['outpkts'] = $linkinfo[6]; + $ifinfo['outbytes'] = $linkinfo[8]; + } else { $ifinfo['macaddr'] = $linkinfo[3]; $ifinfo['inpkts'] = $linkinfo[4]; $ifinfo['inerrs'] = $linkinfo[5]; @@ -3514,11 +3519,6 @@ function get_interface_info($ifdescr) { $ifinfo['outerrs'] = $linkinfo[8]; $ifinfo['outbytes'] = $linkinfo[9]; $ifinfo['collisions'] = $linkinfo[10]; - } else { - $ifinfo['inpkts'] = $linkinfo[3]; - $ifinfo['inbytes'] = $linkinfo[5]; - $ifinfo['outpkts'] = $linkinfo[6]; - $ifinfo['outbytes'] = $linkinfo[8]; } $ifconfiginfo = ""; |