5 Replies Latest reply on Jun 5, 2018 1:16 AM by raiff

    obtain connectx interface ifSpeed via SNMP



      I try to obtain via SNMP the speed of an interface of type infiniband


      Here is what I've done:

      snmpget -v 2c -c public t26 ifDescr.9 ifType.9 ifSpeed.9

      IF-MIB::ifDescr.9 = STRING: ib0

      IF-MIB::ifType.9 = INTEGER: infiniband(199)

      IF-MIB::ifSpeed.9 = Gauge32: 0


      ifSpeed is not correct.


      ibstat or ibstatus give me the right value :

      ssh t28 ibstatus | grep rate

              rate:            100 Gb/sec (4X EDR)


      Is there a private MIB to get the right value ?


        • Re: obtain connectx interface ifSpeed via SNMP

          Precision : ifHighSpeed give the same zero value (100000 expected for EDRX4).

            • Re: obtain connectx interface ifSpeed via SNMP

              Is the SNMP query directed at a host or managed switch ? What is the SNMP agent being used on the host or the managed switch ?

                • Re: obtain connectx interface ifSpeed via SNMP

                  Query is directed at host where the  MELLANOX HCA is installed. Host runs linux centos 7 net-snmp agent. I can obtain ifDescr (ib0) or ifType (infiniband) but ifSpeed and ifXHighSpeed are returned as zero.

                  Host is direct connected with another one (no switch)


                    • Re: obtain connectx interface ifSpeed via SNMP

                      speed is not currently populated in agent. Look at net-snmp / Code /  [40c09d]  /agent/mibgroup/if-mib/data_access/interface_linux.c


                      You can see there's routine netsnmp_linux_interface_get_if_speed which is conditionally compiled depending on ethtool but it's only called for ifTypes of IANAIFTYPE_ETHERNETCSMACD.

                      Currently, it looks like it calls netsnmp_access_interface_entry_guess_speed which is in interface.c which is:


                      netsnmp_access_interface_entry_guess_speed(netsnmp_interface_entry *entry)


                          if (entry->type == IANAIFTYPE_ETHERNETCSMACD)

                              entry->speed = 10000000;

                          else if (entry->type == IANAIFTYPE_SOFTWARELOOPBACK)

                              entry->speed = 10000000;

                          else if (entry->type == IANAIFTYPE_ISO88025TOKENRING)

                              entry->speed = 4000000;


                              entry->speed = 0;

                          entry->speed_high = entry->speed / 1000000LL;


                      so speed is 0.


                      Are you building your own agent ? If so, I'll dig a little deeper on this.


                        • Re: obtain connectx interface ifSpeed via SNMP

                          Thanks for your response and suggestion

                          My need is integration in supervision platform (Nagios).

                          I've done it (read and display connection speed) by Nagios NRPE + ibstat commands.

                          But I would like to implement by the standard SNMP way.

                          I was surprised to see SNMP agent  does not return the correct value, as ethtool (or ibstat) do.

                          Tests :


                          [root@t25 ~]# snmpget -c public -v 2c localhost ifType.9

                          IF-MIB::ifType.9 = INTEGER: infiniband(199)

                          [root@t25 ~]# snmpget -c public -v 2c localhost ifDescr.9

                          IF-MIB::ifDescr.9 = STRING: ib0

                          [root@t25 ~]# snmpget -c public -v 2c localhost ifHighSpeed.9

                          IF-MIB::ifHighSpeed.9 = Gauge32: 0


                          [root@t25 ~]# ethtool ib0 | grep Speed

                                  Speed: 100000Mb/s


                          Shouldn't agent procedure netsnmp_linux_interface_get_if_speed_mii(..) in net-snmp / Code / [21b005] /agent/mibgroup/if-mib/data_access/interface_linux.c  return the correct value ?

                          Unfortunately, I don't have the necessary skills or experience to modify the code of the agent...