[racktables-users] Patch for snmp-port-finding HP switch 2848

  • From: Frank Altpeter <frank-racktables@xxxxxxxxxxx>
  • To: racktables-users <racktables-users@xxxxxxxxxxxxx>
  • Date: Wed, 8 Jul 2009 18:39:10 +0200

Hi,

We recently got some new switches and for making the work easier, we
modified the code a bit to have the ports added by the snmp port finder.

The patch is included, please consider adding it to the core :-)


 
Le deagh dhùraghd,

        Frank Altpeter

-- 
FA-RIPE || http://www.altpeter.de/
Viva la evolution
|   Parting is such sweet sorrow. -William Shakespeare

--- snmp.php.org        2009-07-08 17:43:36.000000000 +0200
+++ snmp.php    2009-07-08 18:37:17.000000000 +0200
@@ -52,6 +52,7 @@
                // used at a latter point to avoid value clashes.
                36 => 'HP J8164A (24 Ethernet 10/100 ports and 2 100/1000 
uplinks)',
                35 => 'HP J8165A (48  Ethernet 10/100 ports and 2 100/1000 
uplinks)',
+               32 => 'HP J4904A (48  Ethernet 100/1000 ports/4 LWL)',
        );
        // Cisco sysObjectID to Dictionary dict_key map
        $hwtype = array
@@ -89,6 +90,7 @@
                719 => 960,
                36 => 865,
                35 => 867,
+               32 => 871,
        );
        // Cisco portType to Dictionary dict_key map
        $porttype = array
@@ -559,6 +561,15 @@
                        break;
                case '719':
                        break;
+               case '32':
+                       $n1000 = 48;
+                       for ($i = 1; $i <= $n1000; $i++)
+                               if ('' == ($error = commitAddPort ($object_id, 
$i, 24, $i, $ifList2[$i]['phyad'])))
+                                       $newports++;
+                               else
+                                       $log[] = array ('code' => 'error', 
'message' => "Failed to add port ${i}: " . $error);
+
+                       break;
                case '35':
                        $n100 = 48;
                        // fall through

Other related posts: