a8c837
Resolves: #1422797
a8c837
a8c837
--- a/scripts/services/sshd	2017-08-28 13:11:02.078000000 +0200
a8c837
+++ b/scripts/services/sshd	2017-08-28 13:38:22.097000000 +0200
a8c837
@@ -290,7 +290,9 @@
a8c837
        ($ThisLine =~ /^Failed keyboard-interactive for <invalid username> from/ ) or
a8c837
        ($ThisLine =~ /^Keyboard-interactive \(PAM\) userauth failed/ ) or
a8c837
        ($ThisLine =~ /^debug1: /) or
a8c837
-       ($ThisLine =~ /Nasty PTR record .* is set up for [\da-fA-F.:]+, ignoring/)
a8c837
+       ($ThisLine =~ /Nasty PTR record .* is set up for [\da-fA-F.:]+, ignoring/) or
a8c837
+       ($ThisLine =~ /Exiting on signal .*$/) or
a8c837
+       ($ThisLine =~ /Disconnected from (?:[^ ]*) port .*$/)
a8c837
    ) {
a8c837
       # Ignore these
a8c837
    } elsif ( my ($Method,$User,$Host,$Port) = ($ThisLine =~ /^Accepted (\S+) for (\S+) from ([\d\.:a-f]+) port (\d+)/) ) {
a8c837
@@ -379,7 +381,9 @@
a8c837
       $RefusedConnections{$1}++;
a8c837
    } elsif ( my ($Reason) = ($ThisLine =~ /^Authentication refused: (.*)$/ ) ) {
a8c837
       $RefusedAuthentication{$Reason}++;
a8c837
-   } elsif ( my ($Host,$Reason) = ($ThisLine =~ /^Received disconnect from ([^ ]*): (.*)$/)) {
a8c837
+   # Old format: Received disconnect from 192.168.122.1: 11: disconnected by user
a8c837
+   # New format: Received disconnect from 192.168.122.1 port 43680:11: disconnected by user
a8c837
+   } elsif ( my ($Host,$Reason) = ($ThisLine =~ /^Received disconnect from ([^ ]*)(?: port \d+)?: ?(.*)$/)) {
a8c837
       $DisconnectReceived{$Reason}{$Host}++;
a8c837
    } elsif ( my ($Host) = ($ThisLine =~ /^ROOT LOGIN REFUSED FROM ([^ ]*)$/)) {
a8c837
       $RootLogin{$Host}++;