diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyatta-wlb-connection.pl | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/vyatta-wlb-connection.pl b/scripts/vyatta-wlb-connection.pl index 308010e..902e0aa 100644 --- a/scripts/vyatta-wlb-connection.pl +++ b/scripts/vyatta-wlb-connection.pl @@ -25,11 +25,21 @@ use lib "/opt/vyatta/share/perl5/"; - -if (!open($FILE, "<", "/proc/net/ip_conntrack")) { +#examine /var/load-balance/wlb.conf for disable-source-nat +if (!open($CONFFILE, "<", "/var/load-balance/wlb.conf")) { return; } - +$_ = <$CONFFILE>; +if (/disable-source-nat/) { + if (!open($FILE, "<", "/proc/net/ip_conntrack")) { + return; + } +} +else { + if (!open($FILE, "/usr/sbin/conntrack -L -n|")) { + return; + } +} print "Type\tState\t\tSrc\t\t\tDst\t\t\tPackets\tBytes\n"; |