Index: /trunk/klask
===================================================================
--- /trunk/klask	(revision 120)
+++ /trunk/klask	(revision 121)
@@ -97,5 +97,5 @@
    J4903A => { model => 'HP2824',     match => 'J4903A.+?Switch 2824,'           },
    J4110A => { model => 'HP8000M',    match => 'HP J4110A ProCurve Switch 8000M' },
-   JD374A => { model => 'HP5500-24F', match => 'HP Comware.+?A5500-24G-SFP EI'   },
+   JD374A => { model => 'HP5500-24F', match => 'HP Comware.+?A5500-24G-SFP EI',    mibflag => 2  },
    BS350T => { model => 'BS350T',     match => 'BayStack 350T HW'                },
    N3483G => { model => 'NA3483-6G',  match => 'GigaSwitch V3 TP SFP-I 48V ES3'  },
@@ -107,5 +107,6 @@
    sysContact      => '1.3.6.1.2.1.1.4.0',
    sysLocation     => '1.3.6.1.2.1.1.6.0',
-   searchPort      => '1.3.6.1.2.1.17.4.3.1.2',
+   searchPort1     => '1.3.6.1.2.1.17.4.3.1.2',
+   searchPort2     => '1.3.6.1.2.1.17.7.1.2.2.1.2.1',
    );
 
@@ -338,5 +339,6 @@
       }
 
-   my $research = $OID_NUMBER{searchPort} . mac_address_hex_to_dec($mac_address);
+   my $research1 = $OID_NUMBER{searchPort1} . mac_address_hex_to_dec($mac_address);
+   my $research2 = $OID_NUMBER{searchPort2} . mac_address_hex_to_dec($mac_address);
 
    LOOP_ON_SWITCH:
@@ -346,12 +348,13 @@
 
       my $result = $session->get_request(
-         -varbindlist => [$research]
+         -varbindlist => [$research1, $research2]
          );
-      if (not defined $result or $result->{$research} eq 'noSuchInstance') {
+      if (not defined $result or $result->{$research1} eq 'noSuchInstance' or $result->{$research2} eq 'noSuchInstance') {
          $session->close;
          next LOOP_ON_SWITCH;
          }
 
-         my $swport = $result->{$research};
+         my $swport = $result->{$research1};
+         $swport = $result->{$research2} if $result->{$research1} eq 'noSuchInstance';
          $session->close;
 
@@ -398,5 +401,6 @@
 #      }
 
-   my $research = $OID_NUMBER{searchPort} . mac_address_hex_to_dec($mac_address);
+   my $research1 = $OID_NUMBER{searchPort1} . mac_address_hex_to_dec($mac_address);
+   my $research2 = $OID_NUMBER{searchPort2} . mac_address_hex_to_dec($mac_address);
    LOOP_ON_ALL_SWITCH:
    for my $sw (@SWITCH) {
@@ -405,9 +409,10 @@
 
       my $result = $session->get_request(
-         -varbindlist => [$research]
+         -varbindlist => [$research1, $research2]
          );
 
-      if(defined $result and $result->{$research} ne 'noSuchInstance'){
-         my $swport = $result->{$research};
+      if(defined $result and ($result->{$research1} ne 'noSuchInstance' or $result->{$research2} ne 'noSuchInstance')){
+         my $swport = $result->{$research1};
+         $swport = $result->{$research2} if $result->{$research1} eq 'noSuchInstance';
 
          $ret->{$sw->{hostname}} = {};
@@ -1510,6 +1515,7 @@
          }
 
-      my $research = $OID_NUMBER{searchPort} . mac_address_hex_to_dec($mac_address);
-      print "Klask search OID $research on switch $sw_name\n";
+      my $research1 = $OID_NUMBER{searchPort1} . mac_address_hex_to_dec($mac_address);
+      my $research2 = $OID_NUMBER{searchPort2} . mac_address_hex_to_dec($mac_address);
+      print "Klask search OID $research1 on switch $sw_name\n";
 
       my ($session, $error) = Net::SNMP->session( %session );
@@ -1517,13 +1523,14 @@
 
       my $result = $session->get_request(
-         -varbindlist => [$research]
+         -varbindlist => [$research1, $research2]
          );
 
-      if (not defined $result or $result->{$research} eq 'noSuchInstance') {
+      if (not defined $result or $result->{$research1} eq 'noSuchInstance' or $result->{$research2} eq 'noSuchInstance') {
          print "Klask do not find MAC $mac_address on switch $sw_name\n";
          $session->close;
          }
 
-      my $swport = $result->{$research};
+      my $swport = $result->{$research1};
+      $swport = $result->{$research2} if $result->{$research1} eq 'noSuchInstance';
       $session->close;
 
