Index: trunk/klask
===================================================================
--- trunk/klask	(revision 244)
+++ trunk/klask	(revision 245)
@@ -507,5 +507,5 @@
 
       my $swport_num = $result->{$research1};
-      my $swport_hr = get_human_readable_port($sw->{model}, snmp_get_switchport_num2hr($session, $swport_num));
+      my $swport_hr = snmp_get_switchport_num2hr($session, $swport_num);
 
       $session->close;
@@ -520,5 +520,5 @@
       for my $portignore (@{$sw->{portignore}}) {
          next LOOP_ON_SWITCH if $swport_hr eq $portignore;
-         my ($swport_hr_limited) = split /:/, $swport_hr; # Beginning of the swith port (Aggregator)
+         my ($swport_hr_limited) = split /|/, $swport_hr; # Beginning of the swith port (Aggregator)
          next LOOP_ON_SWITCH if $swport_hr_limited eq $portignore;
          }
@@ -563,5 +563,5 @@
       if (defined $result and $result->{$research1} ne 'noSuchInstance') {
          my $swport_num = $result->{$research1};
-         my $swport_hr = get_human_readable_port($sw->{model}, snmp_get_switchport_num2hr($session, $swport_num));
+         my $swport_hr = snmp_get_switchport_num2hr($session, $swport_num);
 
          SWITCH_PORT_IGNORE:
@@ -667,106 +667,4 @@
    return @res;
    }
-
-#---------------------------------------------------------------
-sub get_human_readable_port {
-   my $sw_model = shift;
-   my $sw_port  = shift;
-
-   # Not need anymore
-   # get port name by snmp
-   return $sw_port;
-   }
-
-#   if ($sw_model eq 'HP8000M') {
-#
-#      my $reste = (($sw_port - 1) % 8) + 1;
-#      my $major = int (($sw_port - 1) / 8);
-#      return "$INTERNAL_PORT_MAP{$major}$reste";
-#      }
-#
-#   if ($sw_model eq 'HP2424M') {
-#      if ($sw_port > 24) {
-#
-#         my $reste = $sw_port - 24;
-#         return "A$reste";
-#         }
-#      }
-#
-#   if ($sw_model eq 'HP1600M') {
-#      if ($sw_port > 16) {
-#
-#         my $reste = $sw_port - 16;
-#         return "A$reste";
-#         }
-#      }
-#
-#   if ($sw_model eq 'HP2810-48G' or $sw_model eq 'HP2810-24G') {
-#      if ($sw_port > 48) {
-#
-#         my $reste = $sw_port - 48;
-#         return "Trk$reste";
-#         }
-#      }
-#
-#   if ($sw_model eq 'HP3500-24G') {
-#      if ($sw_port > 289) {
-#
-#         my $reste = $sw_port - 289;
-#         return "Trk$reste";
-#         }
-#      }
-#
-#   return $sw_port;
-
-#sub get_numerical_port {
-#   my $sw_model = shift;
-#   my $sw_port  = shift;
-#
-#   if ($sw_model eq 'HP8000M') {
-#
-#      my $letter = substr $sw_port, 0, 1;
-#      my $reste =  substr $sw_port, 1;
-#
-#      return $INTERNAL_PORT_MAP_REV{$letter} * 8 + $reste;
-#      }
-#
-#   if ($sw_model eq 'HP2424M') {
-#      if ($sw_port =~ m/^A/xms ) {
-#
-#         my $reste =  substr $sw_port, 1;
-#
-#         return 24 + $reste;
-#         }
-#      }
-#
-#   if ($sw_model eq 'HP1600M') {
-#      if ($sw_port =~ m/^A/xms ) {
-#
-#         my $reste =  substr $sw_port, 1;
-#
-#         return 16 + $reste;
-#         }
-#      }
-#
-#   if ($sw_model eq 'HP2810-48G' or $sw_model eq 'HP2810-24G') {
-#      if ($sw_port =~ m/^Trk/xms ) {
-#
-#         my $reste =  substr $sw_port, 3;
-#
-#         return 48 + $reste;
-#         }
-#      }
-#
-#   if ($sw_model eq 'HP3500-24G') {
-#      if ($sw_port =~ m/^Trk/xms ) {
-#
-#         my $reste =  substr $sw_port, 3;
-#
-#         return 289 + $reste;
-#         }
-#      }
-#
-#   return $sw_port;
-#   }
 
 #---------------------------------------------------------------
@@ -848,5 +746,5 @@
 
          my $current_port_name = snmp_get_switchport_index2hr($snmp_session, $current_port_index);
-         $swport_hr .= ":$current_port_name";
+         $swport_hr .= "|$current_port_name"; # Join with | (: is already use)
          }
       }
@@ -860,5 +758,6 @@
 
    # Split for Aggregator port
-   ($swport_hr) = split /:/, $swport_hr;
+   # Keep only the Aggregator part
+   ($swport_hr) = split /|/, $swport_hr;
 
    my $swport_num = $swport_hr;
@@ -1137,5 +1036,5 @@
    my %db_switch_chained_port = ();
    for my $swport (keys %db_switch_connected_on_port) {
-      my ($sw_connect,$port_connect) = split m/ : /xms, $swport;
+      my ($sw_connect,$port_connect) = split m/ : /xms, $swport, 2;
       $db_switch_chained_port{$sw_connect} .= "$port_connect:";
       }
@@ -1651,5 +1550,5 @@
 
    for my $swport (sort keys %db_switch_connected_on_port) {
-      my ($sw_connect,$port_connect) = split m/ : /xms, $swport;
+      my ($sw_connect,$port_connect) = split m/ : /xms, $swport, 2;
       for my $sw (keys %{$db_switch_connected_on_port{$swport}}) {
 
@@ -2485,5 +2384,5 @@
       if (defined $result and $result->{$research1} ne 'noSuchInstance') {
          my $swport_num = $result->{$research1};
-         my $swport_hr = get_human_readable_port($sw->{model}, snmp_get_switchport_num2hr($session, $swport_num));
+         my $swport_hr = snmp_get_switchport_num2hr($session, $swport_num);
          print "Klask find MAC $mac_address on switch $sw_name port $swport_hr\n";
          }
@@ -2642,5 +2541,5 @@
          $maybe_more_than_one_switch_connected = 'yes';
 
-         my ($sw_connect,$port_connect) = split m/ : /xms, $swport;
+         my ($sw_connect,$port_connect) = split m/ : /xms, $swport, 2;
          my @sw_on_same_port = keys %{$db_switch_connected_on_port{$swport}};
          print "VERBOSE_10: $swport -- ".$#sw_on_same_port." -- @sw_on_same_port\n" if $verbose;
@@ -2694,5 +2593,5 @@
    print "------------------------------------------------\n";
    for my $swport (sort keys %db_switch_connected_on_port) {
-      my ($sw_connect,$port_connect) = split m/ : /xms, $swport;
+      my ($sw_connect,$port_connect) = split m/ : /xms, $swport, 2;
       for my $sw (keys %{$db_switch_connected_on_port{$swport}}) {
          if (exists $db_switch_output_port{$sw}) {
@@ -2766,5 +2665,5 @@
    print "------------------------------------------------\n";
    for my $swport (sort keys %db_switch_connected_on_port) {
-      my ($sw_connect,$port_connect) = split m/ : /xms, $swport;
+      my ($sw_connect,$port_connect) = split m/ : /xms, $swport, 2;
       for my $sw (keys %{$db_switch_connected_on_port{$swport}}) {
          my $arrow ='<--';
@@ -2842,5 +2741,5 @@
 
             for my $swport (keys %db_switch_connected_on_port) {
-               my ($sw_connect,$port_connect) = split m/ : /xms, $swport;
+               my ($sw_connect,$port_connect) = split m/ : /xms, $swport, 2;
                next if not $sw_connect eq $sw;
                next if $port_connect eq $db_switch_output_port{$sw};
@@ -2867,5 +2766,5 @@
 #   print "------------------------------------------------\n";
    for my $swport (sort keys %db_switch_connected_on_port) {
-      my ($sw_connect,$port_connect) = split m/ : /xms, $swport;
+      my ($sw_connect,$port_connect) = split m/ : /xms, $swport, 2;
       for my $sw (keys %{$db_switch_connected_on_port{$swport}}) {
          if (exists $db_switch_output_port{$sw}) {
