mirror of https://github.com/mikaku/Monitorix.git
fixed to not show the red background color in listening network ports using IPv6 in the 'port' graph
This commit is contained in:
parent
9ab35fa122
commit
9a56b9608c
3
Changes
3
Changes
|
@ -34,6 +34,9 @@
|
||||||
- Fixed a wrong example in the documentation when showing how to define the same
|
- Fixed a wrong example in the documentation when showing how to define the same
|
||||||
port number using IPv4 and IPv6 in the 'port' graph.
|
port number using IPv4 and IPv6 in the 'port' graph.
|
||||||
(thanks to Dirk Tanneberger, os AT tanneberger.biz for pointing this out)
|
(thanks to Dirk Tanneberger, os AT tanneberger.biz for pointing this out)
|
||||||
|
- Fixed to not show the red background color in listening network ports using
|
||||||
|
IPv6 in the 'port' graph.
|
||||||
|
(thanks to Dirk Tanneberger, os AT tanneberger.biz for pointing this out)
|
||||||
- Small cosmetic changes.
|
- Small cosmetic changes.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -500,12 +500,15 @@ sub port_cgi {
|
||||||
}
|
}
|
||||||
my $pnum;
|
my $pnum;
|
||||||
$pl[$n] = trim($pl[$n]);
|
$pl[$n] = trim($pl[$n]);
|
||||||
|
my $num = ($pl[$n] =~ m/^(\d+).*?/)[0]; # strips any suffix from port number
|
||||||
my $pn = trim((split(',', $port->{desc}->{$pl[$n]}))[0]);
|
my $pn = trim((split(',', $port->{desc}->{$pl[$n]}))[0]);
|
||||||
my $pp = trim((split(',', $port->{desc}->{$pl[$n]}))[1]);
|
my $pp = trim((split(',', $port->{desc}->{$pl[$n]}))[1]);
|
||||||
$pp =~ s/6//;
|
$pp =~ s/6//;
|
||||||
my $prig = trim((split(',', $port->{desc}->{$pl[$n]}))[3]);
|
my $prig = trim((split(',', $port->{desc}->{$pl[$n]}))[3]);
|
||||||
my $plim = trim((split(',', $port->{desc}->{$pl[$n]}))[4]);
|
my $plim = trim((split(',', $port->{desc}->{$pl[$n]}))[4]);
|
||||||
@riglim = @{setup_riglim($prig, $plim)};
|
@riglim = @{setup_riglim($prig, $plim)};
|
||||||
|
|
||||||
|
# check if the network port is still listening
|
||||||
undef(@warning);
|
undef(@warning);
|
||||||
if($config->{os} eq "Linux") {
|
if($config->{os} eq "Linux") {
|
||||||
open(IN, "netstat -nl --$pp |");
|
open(IN, "netstat -nl --$pp |");
|
||||||
|
@ -513,7 +516,7 @@ sub port_cgi {
|
||||||
(undef, undef, undef, $pnum) = split(' ', $_);
|
(undef, undef, undef, $pnum) = split(' ', $_);
|
||||||
chomp($pnum);
|
chomp($pnum);
|
||||||
$pnum =~ s/.*://;
|
$pnum =~ s/.*://;
|
||||||
if($pnum eq $pl[$n]) {
|
if($pnum eq $num) {
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -529,14 +532,14 @@ sub port_cgi {
|
||||||
chomp($pnum);
|
chomp($pnum);
|
||||||
($pnum) = ($pnum =~ m/^.*?(\.\d+$)/);
|
($pnum) = ($pnum =~ m/^.*?(\.\d+$)/);
|
||||||
$pnum =~ s/\.//;
|
$pnum =~ s/\.//;
|
||||||
if($pnum eq $pl[$n]) {
|
if($pnum eq $num) {
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(IN);
|
close(IN);
|
||||||
}
|
}
|
||||||
if(lc($pcon) ne "out" && $pnum ne $pl[$n]) {
|
if(lc($pcon) ne "out" && $pnum ne $num) {
|
||||||
push(@warning, $colors->{warning_color});
|
push(@warning, $colors->{warning_color});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue