X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=syslog-count-link.pl;h=c78ee402c2fe6a0dde14778b0714c8a74bff81cb;hb=8362f4eaf891497a9cfd036a009d2ff8d460adfa;hp=d33c477e391dffc039f718ba067df088e9161ed0;hpb=b29b40ddb7d4b872ee7b36f087f52408bfc65518;p=dell-switch diff --git a/syslog-count-link.pl b/syslog-count-link.pl index d33c477..c78ee40 100755 --- a/syslog-count-link.pl +++ b/syslog-count-link.pl @@ -98,9 +98,9 @@ while(<>) { if ( m/(\S+)\s%LINK-[IW]-(\w+):\s*(\w+)/ ) { my ($host,$state,$port) = ($1,$2,$3); stat_host_port( $host, $port, substr($state,0,1) ); - } elsif ( m/(\S+)\s%STP-W-PORTSTATUS:\s([\w\/]+): STP status (\w+)/ ) { - my ($host,$port,$state) = ($1,$2,$3); - stat_host_port( $host, $port, '-' ); + } elsif ( m/(\S+)\s%STP-W-PORTSTATUS:\s([\w\/]+)(?: of instance \d+)?: STP status (\w+)/ ) { + my ($host,$port,$state) = ($1,$2,substr($3,0,1) ); + stat_host_port( $host, $port, $state =~ m/f/i ? '-' : $state ); ## Dell new @@ -131,7 +131,7 @@ while(<>) { next; } - if ( -e "$dir/dump" ) { + if ( -e "$dir/dump" || $ENV{DUMP} ) { print "### ",strftime("%Y-%m-%d %H:%M:%S",localtime(time)), "\n"; print_stats; }