added mikrotik parsing
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 19 Jun 2018 11:48:39 +0000 (13:48 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 19 Jun 2018 11:48:39 +0000 (13:48 +0200)
syslog-count-link.pl

index 8371847..5d2baa2 100755 (executable)
@@ -97,6 +97,13 @@ while(<>) {
                $stat->{$host}->{_count}->{$port} += $state =~ m/F/ ? 1 : -1;
 
 
+       ## Mikrotik
+       } elsif ( m/($host_re) \w+: ([\w\-]+) link (\w+)/ ) {
+               my ($host, $port, $state ) = ($1,$2,$3);
+               $stat->{$host}->{$port} .= substr($state,0,1);
+               $stat->{$host}->{_count}->{$port} += $state =~ m/U/i ? 1 : -1;
+
+
        } elsif ( m'==> /var/log/' ) {
                # ignore tail output
        } else {