set more accurate port type defaults
authorgithub138 <m.ehinger@ltur.de>
Thu, 9 Apr 2015 07:58:38 +0000 (09:58 +0200)
committergithub138 <m.ehinger@ltur.de>
Fri, 17 Jul 2015 12:47:54 +0000 (14:47 +0200)
snmpgeneric.php

index be7c12e..b498072 100644 (file)
@@ -2037,6 +2037,22 @@ function guessRToif_id($ifType,$ifDescr = NULL) {
 
        /* try to identify outer and inner interface type from ifDescr */
 
+       switch(true)
+       {
+               case preg_match('/fast.?ethernet/i',$ifDescr,$matches):
+                       // Fast Ethernet
+                       $retval = 19;
+                       break;
+               case preg_match('/10.?gigabit.?ethernet/i',$ifDescr,$matches):
+                       // 10-Gigabit Ethernet
+                       $retval = 1642;
+                       break;
+               case preg_match('/gigabit.?ethernet/i',$ifDescr,$matches):
+                       // Gigabit Ethernet
+                       $retval = 24;
+                       break;
+       }
+
        /**********************
         * ifDescr samples
         *