projects
/
dell-switch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32a446a
)
added mikrotik parsing
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 19 Jun 2018 11:48:39 +0000
(13:48 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 19 Jun 2018 11:48:39 +0000
(13:48 +0200)
syslog-count-link.pl
patch
|
blob
|
history
diff --git
a/syslog-count-link.pl
b/syslog-count-link.pl
index
8371847
..
5d2baa2
100755
(executable)
--- a/
syslog-count-link.pl
+++ b/
syslog-count-link.pl
@@
-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 {