added support for older versions of 'ss' in 'netstat.pm' #271

This commit is contained in:
Jordi Sanfeliu 2020-02-27 10:05:50 +01:00
parent 580ef2263b
commit 2fff79df2a
1 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ sub netstat_update {
if($config->{os} eq "Linux") { if($config->{os} eq "Linux") {
my $cmd = $config->{netstat}->{cmd} || ""; my $cmd = $config->{netstat}->{cmd} || "";
if(!$cmd || $cmd eq "ss") { if(!$cmd || $cmd eq "ss") {
if(open(IN, "ss -na -f inet |")) { if(open(IN, "ss -naut -f inet |")) {
while(<IN>) { while(<IN>) {
m/^(\S+)\s+(\S+)/; m/^(\S+)\s+(\S+)/;
my $proto = $1 || ''; my $proto = $1 || '';
@ -205,7 +205,7 @@ sub netstat_update {
} }
close(IN); close(IN);
} }
if(open(IN, "ss -na -f inet6 |")) { if(open(IN, "ss -naut -f inet6 |")) {
while(<IN>) { while(<IN>) {
m/^(\S+)\s+(\S+)/; m/^(\S+)\s+(\S+)/;
my $proto = $1 || ''; my $proto = $1 || '';