Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-964

Q-BRIDGE-MIB vlan mapping code calculates ports incorrectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • None
    • None

    Description

      I noticed almost all of my devices had wrong vlan mappings since upgrading to pro version of observium (didn't really check if it was an issue before with community version). Tracked it down to an issue I reported in OBSERVIUM-963, but also found that even with that fix things weren't right. Turns out Observium is parsing results from polling oid dot1qVlanStaticUntaggedPorts in Q-BRIDGE-MIB incorrectly.

      According to my devices the output should be hexadecimal, however observium is using decbin to convert it to binary instead of converting hex to binary for determining ports for each vlan.

      This is the output we get from dot1qVlanStaticUntaggedPorts oid:

      $ /usr/bin/snmpbulkwalk -t '2' -v2c -c 'COMMUNITYHERE' -OQUs -m Q-BRIDGE-MIB -M /opt/mt/observium/mibs/rfc:/opt/mt/observium/mibs/net-snmp 'udp':'myswitcheshostname.someorg.com':'161' dot1qVlanStaticUntaggedPorts
      dot1qVlanStaticUntaggedPorts.1 = "02 00 00 00 00 87 00 00 00 "
      dot1qVlanStaticUntaggedPorts.157 = "00 00 00 00 00 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.159 = "00 00 80 00 00 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.161 = "00 00 60 00 00 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.162 = "00 00 00 00 00 08 00 00 00 "
      dot1qVlanStaticUntaggedPorts.163 = "00 00 02 10 04 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.167 = "24 00 00 00 00 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.169 = "00 6A 00 02 00 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.171 = "00 00 00 00 10 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.172 = "10 00 15 01 00 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.173 = "08 00 00 00 00 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.174 = "00 04 00 00 00 30 00 00 00 "
      dot1qVlanStaticUntaggedPorts.175 = "00 11 08 4C E0 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.177 = "00 00 00 20 00 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.178 = "00 00 00 00 00 40 00 00 00 "
      dot1qVlanStaticUntaggedPorts.180 = "00 00 00 00 01 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.184 = "00 00 00 00 02 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.186 = "00 00 00 00 08 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.188 = "01 80 00 00 00 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.189 = "00 00 00 80 00 00 00 00 00 "
      dot1qVlanStaticUntaggedPorts.4091 = "00 00 00 00 00 00 00 00 00 "
      

      As you can see it's hexadecimal output.

      From the MIB definition itself (excerpts taken here):

      dot1qVlanStaticUntaggedPorts OBJECT-TYPE
          SYNTAX      PortList
          MAX-ACCESS  read-create
          STATUS      current
          DESCRIPTION
              "The set of ports that should transmit egress packets
              for this VLAN as untagged.  The default value of this
              object for the default VLAN (dot1qVlanIndex = 1) is a string
              of appropriate length including all ports.  There is no
              specified default for other VLANs.  If a device agent cannot
              support the set of ports being set, then it will reject the
              set operation with an error.  For example, a
              manager might attempt to set more than one VLAN to be untagged
              on egress where the device does not support this IEEE 802.1Q
              option."
          REFERENCE
              "IEEE 802.1Q/D11 Section 12.10.2.1"
          ::= { dot1qVlanStaticEntry 4 }
       
      PortList ::= TEXTUAL-CONVENTION
          STATUS      current
          DESCRIPTION
              "Each octet within this value specifies a set of eight
              ports, with the first octet specifying ports 1 through
              8, the second octet specifying ports 9 through 16, etc.
              Within each octet, the most significant bit represents
              the lowest numbered port, and the least significant bit
              represents the highest numbered port.  Thus, each port
              of the bridge is represented by a single bit within the
              value of this object.  If that bit has a value of '1',
              then that port is included in the set of ports; the port
              is not included if its bit has a value of '0'."
          SYNTAX      OCTET STRING
      

      Attachments

        Activity

          People

            landy Mike Stupalov
            cheethoe Michael Hsu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: