Updated cisco script

Niels Baggesen <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Hi,

after I got some new devices (AP's) running, I was greated with some new
messages that logwatch should know about. At the same time I found it
time to sort the collected messages on host name (done in many other
scripts) and then I tripped over hash indices with comma in them. These
commas generate a zero-byte which not all mail clients take lightly.

So, here is a rather large patch for the Cisco script, but it is mostly
cleaning and sorting.

/Niels

-- 
Niels Baggesen -- @home -- Århus -- Denmark -- [email protected]
The purpose of computing is insight, not numbers  --  R W Hamming

_______________________________________________
Logwatch-Devel mailing list
[email protected]
http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
logwatch.dif (text/plain, 38.1 KB)
? dif
? scripts/shared/removehost
Index: scripts/services/cisco
===================================================================
RCS file: /var/cvs/logwatch/scripts/services/cisco,v
retrieving revision 1.7
diff -u -r1.7 cisco
--- scripts/services/cisco	17 May 2006 21:14:55 -0000	1.7
+++ scripts/services/cisco	14 Mar 2007 14:34:10 -0000
@@ -1,3 +1,4 @@
+#!/usr/bin/perl
 ##########################################################################
 # $Id: cisco,v 1.7 2006/05/17 21:14:55 bjorn Exp $
 ##########################################################################
@@ -46,6 +47,9 @@
          ($ThisLine =~ /Copyright/ ) or 
          ($ThisLine =~ /Cisco Internetwork Operating System Software/ ) or 
          ($ThisLine =~ /IOS \(tm\)/ ) or 
+         ($ThisLine =~ /Cisco IOS/ ) or
+         ($ThisLine =~ /Technical Support/ ) or
+         ($ThisLine =~ /self test passed/ ) or
          ($ThisLine =~ /TAC:Home:SW:IOS:Specials/ )
     ) {
       # don't care about this, will code this later
@@ -174,11 +178,17 @@
       $JavaBlock++;
    }
    elsif ( ($username,$vty,$address) = ($ThisLine =~ /%SYS-5-CONFIG_I: Configured from console by (\S+) on (\S+) \((\S+)\)/) ) {
-      $Configured{$host}{"Configured from $vty by $username at ",LookupIP($address)}++;
+      $Configured{$host}{"Configured from $vty by $username at ".LookupIP($address)}++;
    }
    elsif ( ($username,$vty) = ($ThisLine =~ /%SYS-5-CONFIG_I: Configured from console by (\S+) on (\S+)/) ) {
       $Configured{$host}{"Configured from $vty by $username"}++;
    }
+   elsif ( ($username,$vty) = ($ThisLine =~ /%SYS-5-CONFIG_I: Configured from console by (\S+) \((\S+)\)/) ) {
+      $Configured{$host}{"Configured from ".LookupIP($vty)." by $username"}++;
+   }
+   elsif ( ($file,$vty) = ($ThisLine =~ /%SYS-5-CONFIG_I: Configured from (\S+) by (console)/) ) {
+      $Configured{$host}{"Configured from ".$vty." using $file"}++;
+   }
    elsif ( ($unmatched) = ($ThisLine =~ /%SYS-5-CONFIG_I: (.+)/) ) {
       $Configured{$host}{"UNMATCHED: $unmatched"}++;
    }
@@ -186,19 +196,19 @@
       $ConfigChange{$host}++;
    }
    elsif ( ($interface,$errortype,$withwho) = ($ThisLine =~ /duplex mismatch discovered on (.+) \(.*\), with (.*)/) ) {
-      $DuplexMismatched{$host}{$interface," with ",$errortype}++;
+      $DuplexMismatched{$host}{$interface." with ".$errortype}++;
    }
    elsif ( ($interface,$vlan_number,$withwho) = ($ThisLine =~ /Native VLAN mismatch discovered on (.+) \(([^ ]+)\), with ([^ ]+)/) ) {
-      $VLANMismatched{$host}{$interface," vlan ",$vlan_number}++;
+      $VLANMismatched{$host}{$interface." vlan ".$vlan_number}++;
    }
    elsif ( ($interface) = ($ThisLine =~ /NVLANMISMATCH:Native vlan mismatch detected on port (.*)/) ) {
       $VLANMismatched{$host}{$interface}++;
    }
-   elsif ( ($interface,$state) = ($ThisLine =~ /Interface (.+), changed state to (.*)/) ) {
-      $InterfaceState{$host}{$interface," ",$state}++;
-   }
    elsif ( ($interface,$state) = ($ThisLine =~ /Line protocol on Interface (.+), changed state to (.*)/) ) {
-      $LineProtocolInterfaceState{$host}{$interface," ",$state}++;
+      $LineProtocolInterfaceState{$host}{$interface." ".$state}++;
+   }
+   elsif ( ($interface,$state) = ($ThisLine =~ /Interface (.+), changed state to (.*)/) ) {
+      $InterfaceState{$host}{$interface." ".$state}++;
    }
    elsif ( ($interface_experiencing_error) = ($ThisLine =~ /ERROR: (.*) is experiencing errors/) ) {
       $InterfaceError{$host}{$interface_experiencing_error}++;
@@ -210,10 +220,10 @@
       $DuplexMismatched{$host}{$interface}++;
    }
    elsif ( ($interface,$state,$destination_port) = ($ThisLine =~ /PORTFROMSTP:Port (.+) (.+) bridge port (.*)/) ) {
-      $PortStateBridge{$host}{$interface," ",$state," ",$destination_port}++;
+      $PortStateBridge{$host}{$interface." ".$state." ".$destination_port}++;
    }
    elsif ( ($interface,$state,$destination_port) = ($ThisLine =~ /PORTTOSTP:Port (.+) (.+) bridge port (.*)/) ) {
-      $PortStateBridge{$host}{$interface," ",$state," ",$destination_port}++;
+      $PortStateBridge{$host}{$interface." ".$state." ".$destination_port}++;
    }
    elsif ( ($Unit) = ($ThisLine =~ /Unit (.*), excessive modem control changes/) ) {
     $ModemChange{$host}{$Unit}++;
@@ -371,11 +381,11 @@
    elsif ( ($interface,$msg) = ($ThisLine =~ /DOT11-4-MAXRETRIES: Packet to client ....\.....\..... reached(.*)/) ) {
       $Dot11Retrys{$host}{$interface}++;
    }
-   elsif ( ($interface) = ($ThisLine =~ /DOT11-6-ASSOC: Interface Dot11Radio0, Station (.*)/) ) {
-      $Dot11Assoc{$host}{$interface}++;
+   elsif ( ($radio,$interface) = ($ThisLine =~ /DOT11-6-ASSOC: Interface (.*), Station +(.*)/) ) {
+      $Dot11Assoc{$host}{"$radio $interface"}++;
    }
-   elsif ( ($interface) = ($ThisLine =~ /DOT11-6-DISASSOC: Interface Dot11Radio0, Deauthenticating Station (.*)/) ) {
-      $Dot11Disassoc{$host}{$interface}++;
+   elsif ( ($radio,$interface) = ($ThisLine =~ /DOT11-6-DISASSOC: Interface (.*), Deauthenticating Station (.*)/) ) {
+      $Dot11Disassoc{$host}{"$radio $interface"}++;
    }
    elsif ( ($interface) = ($ThisLine =~ /DOT11-6-ROAMED: Station (.*)/) ) {
       $Dot11Roamed{$host}{$interface}++;
@@ -386,8 +396,8 @@
    elsif ( ($interface) = ($ThisLine =~ /DOT11-6-FREQ_USED: (.*)/) ) {
       $Dot11FreqUsed{$host}{$interface}++;
    }
-   elsif ( ($interface) = ($ThisLine =~ /DOT11-4-LOADING_RADIO: Interface Dot11Radio0, loading the radio firmware (.*)/) ) {
-      $Dot11LoadingRadio{$host}{$interface}++;
+   elsif ( ($radio,$interface) = ($ThisLine =~ /DOT11-4-LOADING_RADIO: Interface (.*), loading the radio firmware (.*)/) ) {
+      $Dot11LoadingRadio{$host}{"$radio $interface"}++;
    }
    elsif ( ($interface) = ($ThisLine =~ /ICMP Echo Req: (.*)/) ) {
       $ICMP_Echo_Req{$host}{$interface}++;
@@ -395,28 +405,31 @@
    elsif ( ($interface) = ($ThisLine =~ /ICMP Echo Rply: (.*)/) ) {
       $ICMP_Echo_Rep{$host}{$interface}++;
    }
+   elsif ( ($interface) = ($ThisLine =~ /AMDP2_FE-5-COLL: (.*)/) ) {
+      $ExcessiveCollision{$host}{$interface}++;
+   }
    else {
       # Report any unmatched entries...
-	  chomp $ThisLine;
-	  $OtherList{$ThisLine}++;
+      chomp $ThisLine;
+      ($msg) = ($ThisLine =~ /(%.*)/);
+      $msg ||= $ThisLine;
+      $OtherList{"$host: $msg"}++;
    }
 }
 
 if (keys %Started) {
    print "\nDevice started :\n";
-   foreach $ThisOne (keys %Started) {
+   foreach $ThisOne (sort keys %Started) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Started{$ThisOne}}) {
-         print "\t Started" .$ThatOne . "\t: " . $Started{$ThisOne} . " Time(s)\n";
-      }
+      print "\t Started: " . $Started{$ThisOne} . " Time(s)\n";
    }
 }
 
 if (keys %Restarted) {
    print "\nDevice restarted :\n";
-   foreach $ThisOne (keys %Restarted) {
+   foreach $ThisOne (sort keys %Restarted) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Restarted{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Restarted{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $Restarted{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -424,20 +437,19 @@
 
 if (keys %ReloadRequested) {
    print "\nDevice reload requested :\n";
-   foreach $ThisOne (keys %ReloadRequested) {
+   foreach $ThisOne (sort keys %ReloadRequested) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$ReloadRequested{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$ReloadRequested{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $ReloadRequested{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-
 if (keys %DuplexMismatched) {
    print "\nDuplex Mismatch warning:\n";
-   foreach $ThisOne (keys %DuplexMismatched) {
+   foreach $ThisOne (sort keys %DuplexMismatched) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$DuplexMismatched{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$DuplexMismatched{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $DuplexMismatched{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -445,9 +457,9 @@
 
 if (keys %VLANMismatched) {
    print "\nNative VLAN mismatch warning:\n";
-   foreach $ThisOne (keys %VLANMismatched) {
+   foreach $ThisOne (sort keys %VLANMismatched) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$VLANMismatched{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$VLANMismatched{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $VLANMismatched{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -455,9 +467,9 @@
 
 if (keys %TRUNKPORTON) {
    print "\nPort/Interface trunk on :\n";
-   foreach $ThisOne (keys %TRUNKPORTON) {
+   foreach $ThisOne (sort keys %TRUNKPORTON) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$TRUNKPORTON{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$TRUNKPORTON{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $TRUNKPORTON{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -465,9 +477,9 @@
 
 if (keys %TRUNKPORTOFF) {
    print "\nPort/Interface trunk off :\n";
-   foreach $ThisOne (keys %TRUNKPORTOFF) {
+   foreach $ThisOne (sort keys %TRUNKPORTOFF) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$TRUNKPORTOFF{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$TRUNKPORTOFF{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $TRUNKPORTOFF{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -475,9 +487,9 @@
 
 if (keys %PORT_IN_ERRORS) {
    print "\nPort/Interface in errors :\n";
-   foreach $ThisOne (keys %PORT_IN_ERRORS) {
+   foreach $ThisOne (sort keys %PORT_IN_ERRORS) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$PORT_IN_ERRORS{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$PORT_IN_ERRORS{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $PORT_IN_ERRORS{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -485,9 +497,9 @@
 
 if (keys %PORT_SSUPOK) {
    print "\nPort in Standy Mode :\n";
-   foreach $ThisOne (keys %PORT_SSUPOK) {
+   foreach $ThisOne (sort keys %PORT_SSUPOK) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$PORT_SSUPOK{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$PORT_SSUPOK{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $PORT_SSUPOK{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -495,20 +507,19 @@
 
 if (keys %PortStateBridge) {
    print "\nPort/Interface left/joined bridge :\n";
-   foreach $ThisOne (keys %PortStateBridge) {
+   foreach $ThisOne (sort keys %PortStateBridge) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$PortStateBridge{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$PortStateBridge{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $PortStateBridge{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-
 if (keys %Flapping) {
    print "\nPort/Interface Flapping :\n";
-   foreach $ThisOne (keys %Flapping) {
+   foreach $ThisOne (sort keys %Flapping) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Flapping{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Flapping{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $Flapping{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -516,20 +527,19 @@
 
 if (keys %$DuplicateAddress) {
    print "\nPort/Interface duplicate address :\n";
-   foreach $ThisOne (keys %$DuplicateAddress) {
+   foreach $ThisOne (sort keys %$DuplicateAddress) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$$DuplicateAddress{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$$DuplicateAddress{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $DuplicateAddress{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-
 if (keys %InvalidMulticast) {
    print "\nPort/Interface invalid multicast :\n";
-   foreach $ThisOne (keys %InvalidMulticast) {
+   foreach $ThisOne (sort keys %InvalidMulticast) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$InvalidMulticast{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$InvalidMulticast{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $InvalidMulticast{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -537,31 +547,39 @@
 
 if (keys %SpantreeFailure) {
    print "\nPort/Interface spantree failure :\n";
-   foreach $ThisOne (keys %SpantreeFailure) {
+   foreach $ThisOne (sort keys %SpantreeFailure) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SpantreeFailure{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SpantreeFailure{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SpantreeFailure{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-
-
-if (keys %LineProtocolInterfaceState) {
+if ($Detail >= 5 && keys %LineProtocolInterfaceState) {
    print "\nLine protocol on Port/Interface changed state :\n";
-   foreach $ThisOne (keys %LineProtocolInterfaceState) {
+   foreach $ThisOne (sort keys %LineProtocolInterfaceState) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$LineProtocolInterfaceState{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$LineProtocolInterfaceState{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $LineProtocolInterfaceState{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
+if (( $Detail >= 5 ) and (keys %InterfaceState)) {
+   print "\nPort/Interface state change :\n";
+   foreach $ThisOne (sort keys %InterfaceState) {
+      print "   " . $ThisOne . ":\n";
+      foreach $ThatOne (sort keys %{$InterfaceState{$ThisOne}}) {
+         print "\tPort or Interface " .$ThatOne . "\t: " . $InterfaceState{$ThisOne}{$ThatOne} . " Time(s)\n";
+      }
+   }
+}
+
 if (keys %Underflow) {
    print "\nPort/Interface transmit error(underflow) :\n";
-   foreach $ThisOne (keys %Underflow) {
+   foreach $ThisOne (sort keys %Underflow) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Underflow{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Underflow{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $Underflow{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -569,9 +587,9 @@
 
 if (keys %LostCarrier) {
    print "\nPort/Interface transmit error (lost carrier) :\n";
-   foreach $ThisOne (keys %LostCarrier) {
+   foreach $ThisOne (sort keys %LostCarrier) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$LostCarrier{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$LostCarrier{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $LostCarrier{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -579,9 +597,9 @@
 
 if (keys %LateCollision) {
    print "\nPort/Interface transmit error (Late collision) :\n";
-   foreach $ThisOne (keys %LateCollision) {
+   foreach $ThisOne (sort keys %LateCollision) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$LateCollision{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$LateCollision{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $LateCollision{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -589,20 +607,19 @@
 
 if (keys %ExcessiveCollision) {
    print "\nPort/Interface Excessive collision :\n";
-   foreach $ThisOne (keys %ExcessiveCollision) {
+   foreach $ThisOne (sort keys %ExcessiveCollision) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$ExcessiveCollision{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$ExcessiveCollision{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $ExcessiveCollision{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-
 if (keys %InterfaceError) {
    print "\nPort/Interface experiencing error :\n";
-   foreach $ThisOne (keys %InterfaceError) {
+   foreach $ThisOne (sort keys %InterfaceError) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$InterfaceError{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$InterfaceError{$ThisOne}}) {
          print "\tPort or Interface " .$ThatOne . "\t: " . $InterfaceError{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -610,19 +627,19 @@
 
 if (keys %ModemChange) {
    print "\nExcessive modem control changes:\n";
-   foreach $ThisOne (keys %ModemChange) {
+   foreach $ThisOne (sort keys %ModemChange) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$ModemChange{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$ModemChange{$ThisOne}}) {
          print "\tUnit " .$ThatOne . "\t: " . $ModemChange{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
 if (keys %CountersMsg) {
-   print "\nCounters chnages:\n";
-   foreach $ThisOne (keys %CountersMsg) {
+   print "\nCounters changes:\n";
+   foreach $ThisOne (sort keys %CountersMsg) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$CountersMsg{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$CountersMsg{$ThisOne}}) {
          print "\t" .$ThatOne . "\t: " . $CountersMsg{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -630,9 +647,9 @@
 
 if (keys %Configured) {
    print "\nDevice configured by :\n";
-   foreach $ThisOne (keys %Configured) {
+   foreach $ThisOne (sort keys %Configured) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Configured{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Configured{$ThisOne}}) {
          print "\t" .$ThatOne . "\t: " . $Configured{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -640,16 +657,16 @@
 
 if (keys %ConfigChange) {
    print "\nDevice config changes :\n";
-   foreach $ThisOne (keys %ConfigChange) {
+   foreach $ThisOne (sort keys %ConfigChange) {
       print "   " . $ThisOne . ": " . $ConfigChange{$ThisOne} . " Time(s)\n";
    }
 }
 
 if (keys %LoginFail) {
    print "\nLogin failed on device :\n";
-   foreach $ThisOne (keys %LoginFail) {
+   foreach $ThisOne (sort keys %LoginFail) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$LoginFail{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$LoginFail{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $LoginFail{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -657,31 +674,29 @@
 
 if (keys %RSHELLFail) {
    print "\nRemote Shell Login failed on device :\n";
-   foreach $ThisOne (keys %RSHELLFail) {
+   foreach $ThisOne (sort keys %RSHELLFail) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$RSHELLFail{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$RSHELLFail{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $RSHELLFail{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-
 if (keys %DHCPConflict) {
    print "\nDHCP Conflict on device :\n";
-   foreach $ThisOne (keys %DHCPConflict) {
+   foreach $ThisOne (sort keys %DHCPConflict) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$DHCPConflict{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$DHCPConflict{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $DHCPConflict{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-
 if (keys %DHCPPingConflict) {
    print "\nDHCP Address Conflict on device :\n";
-   foreach $ThisOne (keys %DHCPPingConflict) {
+   foreach $ThisOne (sort keys %DHCPPingConflict) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$DHCPPingConflict{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$DHCPPingConflict{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $DHCPPingConflict{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -689,9 +704,9 @@
 
 if (keys %AAAServerUndef) {
    print "\nAAA Server Undefined on device :\n";
-   foreach $ThisOne (keys %AAAServerUndef) {
+   foreach $ThisOne (sort keys %AAAServerUndef) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$AAAServerUndef{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$AAAServerUndef{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $AAAServerUndef{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -699,9 +714,9 @@
 
 if (keys %AAABadReg) {
    print "\nAAA Bad Register on device :\n";
-   foreach $ThisOne (keys %AAABadReg) {
+   foreach $ThisOne (sort keys %AAABadReg) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$AAABadReg{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$AAABadReg{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $AAABadReg{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -709,9 +724,9 @@
 
 if (keys %RUNCFGEnabled) {
    print "\nHigh-Availability Redundancy Feature is enabled on device :\n";
-   foreach $ThisOne (keys %RUNCFGEnabled) {
+   foreach $ThisOne (sort keys %RUNCFGEnabled) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$RUNCFGEnabled{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$RUNCFGEnabled{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $RUNCFGEnabled{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -719,9 +734,9 @@
 
 if (keys %RSPSlaveUp) {
    print "\nHigh-Availability Redundancy Feature, Card is manually reset, Slave is up  on device :\n";
-   foreach $ThisOne (keys %RSPSlaveUp) {
+   foreach $ThisOne (sort keys %RSPSlaveUp) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$RSPSlaveUp{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$RSPSlaveUp{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $RSPSlaveUp{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -729,9 +744,9 @@
 
 if (keys %RSPSlaveDown) {
    print "\nHigh-Availability Redundancy Feature, Card is manually reset, Slave is down  on device :\n";
-   foreach $ThisOne (keys %RSPSlaveDown) {
+   foreach $ThisOne (sort keys %RSPSlaveDown) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$RSPSlaveDown{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$RSPSlaveDown{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $RSPSlaveDown{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -739,9 +754,9 @@
 
 if (keys %RSPSlaveChange) {
    print "\nHigh-Availability Redundancy Feature, Card is manually reset, Slave is changinf state on device :\n";
-   foreach $ThisOne (keys %RSPSlaveChange) {
+   foreach $ThisOne (sort keys %RSPSlaveChange) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$RSPSlaveChange{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$RSPSlaveChange{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $RSPSlaveChange{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -749,9 +764,9 @@
 
 if (keys %MLSFlowmaskChanged) {
    print "\nFlow Mask Changed on device :\n";
-   foreach $ThisOne (keys %MLSFlowmaskChanged) {
+   foreach $ThisOne (sort keys %MLSFlowmaskChanged) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$MLSFlowmaskChanged{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$MLSFlowmaskChanged{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $MLSFlowmaskChanged{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -759,21 +774,19 @@
 
 if (keys %MLSMcastStatus) {
    print "\nIP Multicast status on device :\n";
-   foreach $ThisOne (keys %MLSMcastStatus) {
+   foreach $ThisOne (sort keys %MLSMcastStatus) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$MLSMcastStatus{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$MLSMcastStatus{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $MLSMcastStatus{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-
-
 if (keys %MLSMultiLayerEnabled) {
    print "\nIP Multilayer switching enabled on device :\n";
-   foreach $ThisOne (keys %MLSMultiLayerEnabled) {
+   foreach $ThisOne (sort keys %MLSMultiLayerEnabled) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$MLSMultiLayerEnabled{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$MLSMultiLayerEnabled{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $MLSMultiLayerEnabled{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -781,9 +794,9 @@
 
 if (keys %MLSMultiLayerDisabled) {
    print "\nIP Multilayer switching disabled on device :\n";
-   foreach $ThisOne (keys %MLSMultiLayerDisabled) {
+   foreach $ThisOne (sort keys %MLSMultiLayerDisabled) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$MLSMultiLayerDisabled{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$MLSMultiLayerDisabled{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $MLSMultiLayerDisabled{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -791,9 +804,9 @@
 
 if (keys %MLSNetflowEnabled) {
    print "\nNetflow enabled on device :\n";
-   foreach $ThisOne (keys %MLSNetflowEnabled) {
+   foreach $ThisOne (sort keys %MLSNetflowEnabled) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$MLSNetflowEnabled{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$MLSNetflowEnabled{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $MLSNetflowEnabled{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -801,9 +814,9 @@
 
 if (keys %MLSNetflowDisabled) {
    print "\nNetflow disabled on device :\n";
-   foreach $ThisOne (keys %MLSNetflowDisabled) {
+   foreach $ThisOne (sort keys %MLSNetflowDisabled) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$MLSNetflowDisabled{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$MLSNetflowDisabled{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $MLSNetflowDisabled{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -811,9 +824,9 @@
 
 if (keys %MgmtResetMindown) {
    print "\nReset mindown on device :\n";
-   foreach $ThisOne (keys %MgmtResetMindown) {
+   foreach $ThisOne (sort keys %MgmtResetMindown) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$MgmtResetMindown{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$MgmtResetMindown{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $MgmtResetMindown{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -821,9 +834,9 @@
 
 if (keys %SYSWarn) {
    print "\nModule timeout on device :\n";
-   foreach $ThisOne (keys %SYSWarn) {
+   foreach $ThisOne (sort keys %SYSWarn) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSWarn{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSWarn{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SYSWarn{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -831,9 +844,9 @@
 
 if (keys %SYSCpuHog) {
    print "\nCpu Hog on device :\n";
-   foreach $ThisOne (keys %SYSCpuHog) {
+   foreach $ThisOne (sort keys %SYSCpuHog) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSCpuHog{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSCpuHog{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SYSCpuHog{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -841,9 +854,9 @@
 
 if (keys %SYSModulePowerSupplyUp) {
    print "\nModule power supply up on device :\n";
-   foreach $ThisOne (keys %SYSModulePowerSupplyUp) {
+   foreach $ThisOne (sort keys %SYSModulePowerSupplyUp) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSModulePowerSupplyUp{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSModulePowerSupplyUp{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SYSModulePowerSupplyUp{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -851,9 +864,9 @@
 
 if (keys %SYSModulePowerOn) {
    print "\nModule power up on device :\n";
-   foreach $ThisOne (keys %SYSModulePowerOn) {
+   foreach $ThisOne (sort keys %SYSModulePowerOn) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSModulePowerOn{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSModulePowerOn{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SYSModulePowerOn{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -861,9 +874,9 @@
 
 if (keys %SYSModuleOk) {
    print "\nModule online on device :\n";
-   foreach $ThisOne (keys %SYSModuleOk) {
+   foreach $ThisOne (sort keys %SYSModuleOk) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSModuleOk{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSModuleOk{$ThisOne}}) {
          print "\t Module " .$ThatOne . "\t: " . $SYSModuleOk{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -871,9 +884,9 @@
 
 if (keys %SYSModuleInserted) {
    print "\nModule inserted on device :\n";
-   foreach $ThisOne (keys %SYSModuleInserted) {
+   foreach $ThisOne (sort keys %SYSModuleInserted) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSModuleInserted{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSModuleInserted{$ThisOne}}) {
          print "\t Module " .$ThatOne . "\t: " . $SYSModuleInserted{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -881,9 +894,9 @@
 
 if (keys %SYSModuleMinorFail) {
    print "\nModule minor failure on device :\n";
-   foreach $ThisOne (keys %SYSModuleMinorFail) {
+   foreach $ThisOne (sort keys %SYSModuleMinorFail) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSModuleMinorFail{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSModuleMinorFail{$ThisOne}}) {
          print "\t Module " .$ThatOne . "\t: " . $SYSModuleMinorFail{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -891,9 +904,9 @@
 
 if (keys %SYSModuleReset) {
    print "\nModule reset on device :\n";
-   foreach $ThisOne (keys %SYSModuleReset) {
+   foreach $ThisOne (sort keys %SYSModuleReset) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSModuleReset{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSModuleReset{$ThisOne}}) {
          print "\t Module " .$ThatOne . "\t: " . $SYSModuleReset{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -901,20 +914,19 @@
 
 if (keys %SYSWaitOnline) {
    print "\nSupervisor engine in the process on beeing online on device :\n";
-   foreach $ThisOne (keys %SYSWaitOnline) {
+   foreach $ThisOne (sort keys %SYSWaitOnline) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSWaitOnline{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSWaitOnline{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SYSWaitOnline{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-
 if (keys %SYSModuleStandby) {
    print "\nModule standby on device :\n";
-   foreach $ThisOne (keys %SYSModuleStandby) {
+   foreach $ThisOne (sort keys %SYSModuleStandby) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSModuleStandby{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSModuleStandby{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SYSModuleStandby{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -922,9 +934,9 @@
 
 if (keys %SYSSupervisorEngineReset) {
    print "\nSupervisor engine reset on device :\n";
-   foreach $ThisOne (keys %SYSSupervisorEngineReset) {
+   foreach $ThisOne (sort keys %SYSSupervisorEngineReset) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSSupervisorEngineReset{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSSupervisorEngineReset{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SYSSupervisorEngineReset{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -932,9 +944,9 @@
 
 if (keys %SYSImgSyncStart) {
    print "\nSwitch of supervisor engine started :\n";
-   foreach $ThisOne (keys %SYSImgSyncStart) {
+   foreach $ThisOne (sort keys %SYSImgSyncStart) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSImgSyncStart{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSImgSyncStart{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SYSImgSyncStart{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -942,9 +954,9 @@
 
 if (keys %SYSSupervisorErr) {
    print "\nForwarding engine IP error :\n";
-   foreach $ThisOne (keys %SYSSupervisorErr) {
+   foreach $ThisOne (sort keys %SYSSupervisorErr) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSSupervisorErr{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSSupervisorErr{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SYSSupervisorErr{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -952,9 +964,9 @@
 
 if (keys %SYSImgSyncFinished) {
    print "\nSwitch of supervisor engine finished :\n";
-   foreach $ThisOne (keys %SYSImgSyncFinished) {
+   foreach $ThisOne (sort keys %SYSImgSyncFinished) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SYSImgSyncFinished{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SYSImgSyncFinished{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SYSImgSyncFinished{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -962,49 +974,39 @@
 
 if (keys %SNMPColdStart) {
    print "\nSNMP Cold (Re)start on device :\n";
-   foreach $ThisOne (keys %SNMPColdStart) {
+   foreach $ThisOne (sort keys %SNMPColdStart) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$SNMPColdStart{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$SNMPColdStart{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $SNMPColdStart{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-if (( $Detail >= 5 ) and (keys %InterfaceState)) {
-   print "\nPort/Interface state change :\n";
-   foreach $ThisOne (keys %InterfaceState) {
-      print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$InterfaceState{$ThisOne}}) {
-         print "\tPort or Interface " .$ThatOne . "\t: " . $InterfaceState{$ThisOne}{$ThatOne} . " Time(s)\n";
-      }
-   }
-}
-
 if (keys %Dot11Retrys) {
    print "\nAccess Point Dot11 Max retries on device :\n";
-   foreach $ThisOne (keys %Dot11Retrys) {
+   foreach $ThisOne (sort keys %Dot11Retrys) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Dot11Retrys{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Dot11Retrys{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $Dot11Retrys{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-if (keys %Dot11Assoc) {
-   print "\nAccess Point Dot11 associated on device :\n";
-   foreach $ThisOne (keys %Dot11Assoc) {
+if ($Detail >= 5 && keys %Dot11Assoc) {
+   print "\nAccess Point Dot11 associated with device :\n";
+   foreach $ThisOne (sort keys %Dot11Assoc) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Dot11Assoc{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Dot11Assoc{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $Dot11Assoc{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
-if (keys %Dot11Disassoc) {
+if ($Detail >= 5 && keys %Dot11Disassoc) {
    print "\nAccess Point Dot11 disassociated with device :\n";
-   foreach $ThisOne (keys %Dot11Disassoc) {
+   foreach $ThisOne (sort keys %Dot11Disassoc) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Dot11Disassoc{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Dot11Disassoc{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $Dot11Disassoc{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -1012,19 +1014,19 @@
 
 if (keys %Dot11Roamed) {
    print "\nAccess Point Dot11 roaming with device :\n";
-   foreach $ThisOne (keys %Dot11Roamed) {
+   foreach $ThisOne (sort keys %Dot11Roamed) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Dot11Roamed{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Dot11Roamed{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $Dot11Roamed{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
 }
 
 if (keys %Dot11NoSSID) {
-   print "\nAccess Point Dot11 no ssid with device :\n";
-   foreach $ThisOne (keys %Dot11NoSSID) {
+   print "\nAccess Point Dot11 no SSID with device :\n";
+   foreach $ThisOne (sort keys %Dot11NoSSID) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Dot11NoSSID{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Dot11NoSSID{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $Dot11NoSSID{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -1032,9 +1034,9 @@
 
 if (keys %Dot11FreqUsed) {
    print "\nAccess Point Dot11 Frequency selected with device :\n";
-   foreach $ThisOne (keys %Dot11FreqUsed) {
+   foreach $ThisOne (sort keys %Dot11FreqUsed) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Dot11FreqUsed{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Dot11FreqUsed{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $Dot11FreqUsed{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -1042,9 +1044,9 @@
 
 if (keys %Dot11LoadingRadio) {
    print "\nAccess Point Dot11 Loading Radio firmware with device :\n";
-   foreach $ThisOne (keys %Dot11LoadingRadio) {
+   foreach $ThisOne (sort keys %Dot11LoadingRadio) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$Dot11LoadingRadio{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$Dot11LoadingRadio{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $Dot11LoadingRadio{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -1052,9 +1054,9 @@
 
 if (keys %ICMP_Echo_Req) {
    print "\nICMP Echo Request on device :\n";
-   foreach $ThisOne (keys %ICMP_Echo_Req) {
+   foreach $ThisOne (sort keys %ICMP_Echo_Req) {
    	print "   " . $ThisOne . ":\n";
-   	foreach $ThatOne (keys %{$ICMP_Echo_Req{$ThisOne}}) {
+   	foreach $ThatOne (sort keys %{$ICMP_Echo_Req{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $ICMP_Echo_Req{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
   }
@@ -1062,9 +1064,9 @@
 
 if (keys %ICMP_Echo_Rep) {
    print "\nICMP Echo Reply on device :\n";
-   foreach $ThisOne (keys %ICMP_Echo_Rep) {
+   foreach $ThisOne (sort keys %ICMP_Echo_Rep) {
       print "   " . $ThisOne . ":\n";
-      foreach $ThatOne (keys %{$ICMP_Echo_Rep{$ThisOne}}) {
+      foreach $ThatOne (sort keys %{$ICMP_Echo_Rep{$ThisOne}}) {
          print "\t " .$ThatOne . "\t: " . $ICMP_Echo_Rep{$ThisOne}{$ThatOne} . " Time(s)\n";
       }
    }
@@ -1124,15 +1126,22 @@
    print "   Total : " . $SSH_packets . " Hit(s)\n";
 }
 
-if (( $Detail >= 50 ) and (keys %InterfaceState)) {
-
 if (keys %OtherList) {
 	print "\n**Unmatched Entries**\n";
-	foreach $line (sort {$OtherList{$b}<=>$OtherList{$a} } keys %OtherList) {
-	print "   $line: $OtherList{$line} Time(s)\n";
-    }
-}
-
+   $lines = 0;
+   $count = 0;
+	foreach $line (sort keys %OtherList) {
+      if ($OtherList{$line} > 1 || $Detail >= 5) {
+         print "   $line: $OtherList{$line} Time(s)\n";
+      }
+      else {
+         $lines++;
+         $count += $OtherList{$line};
+      }
+   }
+   if ($lines) {
+      print "    $count messages from $lines lines suppressed\n";
+   }
 }
 
 exit(0);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.