mirror of https://github.com/mikaku/Monitorix.git
added support for older versions of 'ss' in 'netstat.pm' #271
This commit is contained in:
parent
580ef2263b
commit
2fff79df2a
|
@ -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 || '';
|
||||||
|
|
Loading…
Reference in New Issue