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

Add SFP status for MikroTik devices (SwitchOS)

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • None
    • Professional Edition
    • Default
    • None

    Description

      It's possible to add SFP status for MikroTik devices running on SwitchOS?
      On device config page this data is visible and some of it propagates to snmp.

      # snmpwalk -v2c -c *** -OeQUs -Ih -m MIKROTIK-MIB mt mtxrOpticalTableEntry
      mtxrOpticalName.6 = "P6 LINK DC"
      mtxrOpticalWavelength.6 = 155000
      mtxrOpticalTemperature.6 = 36
      mtxrOpticalSupplyVoltage.6 = 3260
      mtxrOpticalTxBiasCurrent.6 = 20

      Attachments

        1. Firefox - Observium - swos.avatar.observium.dev 2021-11-04 13.12.40.png
          Firefox - Observium - swos.avatar.observium.dev 2021-11-04 13.12.40.png
          78 kB
        2. mikrotik.inc.php.diff
          3 kB
        3. mt_port-sensors-poller_trunk.txt
          59 kB
        4. mt_port-sensors-poller.txt
          60 kB
        5. mt-discovery.txt
          67 kB
        6. mt-poller.txt
          80 kB
        7. mt-swos_after.png
          mt-swos_after.png
          129 kB
        8. mt-swos_before.png
          mt-swos_before.png
          93 kB
        9. Zrzut ekranu 2021-11-03 09.56.17.png
          Zrzut ekranu 2021-11-03 09.56.17.png
          17 kB
        10. Zrzut ekranu 2021-11-04 10.09.42.png
          Zrzut ekranu 2021-11-04 10.09.42.png
          16 kB
        11. Zrzut ekranu 2021-11-04 14.04.41.png
          Zrzut ekranu 2021-11-04 14.04.41.png
          13 kB

        Activity

          [OBS-3930] Add SFP status for MikroTik devices (SwitchOS)
          bot Observium Bot made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

          Ok. I change port names in meantime.
          Sorry for that

          prezeskk Krzysztof Kulesza added a comment - Ok. I change port names in meantime. Sorry for that
          landy Mike Stupalov added a comment - - edited

          Port associated by mtxrOpticalName -> ifDescr.
          As I see in your snmpdump, port have ifdescr 'P6 LINK DC', that why used such transform:

          IF-MIB::ifDescr.6 = STRING: P6 LINK DC
          IF-MIB::ifName.6 = STRING: P6 LINK DC
          MIKROTIK-MIB::mtxrOpticalName.6 = STRING: P6 LINK DC-5960
          

          landy Mike Stupalov added a comment - - edited Port associated by mtxrOpticalName -> ifDescr. As I see in your snmpdump, port have ifdescr 'P6 LINK DC', that why used such transform: IF-MIB::ifDescr.6 = STRING: P6 LINK DC IF-MIB::ifName.6 = STRING: P6 LINK DC MIKROTIK-MIB::mtxrOpticalName.6 = STRING: P6 LINK DC-5960

          I attache patch that working as expected
          mikrotik.inc.php.diff

          prezeskk Krzysztof Kulesza added a comment - I attache patch that working as expected mikrotik.inc.php.diff
          prezeskk Krzysztof Kulesza made changes -
          Attachment New: mikrotik.inc.php.diff [ 19337 ]

          I update observium to trunk r11715 and nothing happend.
          After rename port name from DC-5960 to DC5960 (remove - delimiter) is working as expected.

          In discovery debug log (diff)
          Store in cache Table OID: MIKROTIK-MIB::mtxrOpticalTable
          -  String 'P6 LINK DC-5960' transformed by action [explode] to: 'P6 LINK DC'
          +  String 'P6 LINK DC5960' transformed by action [explode] to: 'P6 LINK DC5960'

          prezeskk Krzysztof Kulesza added a comment - I update observium to trunk r11715 and nothing happend. After rename port name from DC-5960 to DC5960 (remove - delimiter) is working as expected. In discovery debug log (diff) Store in cache Table OID: MIKROTIK-MIB::mtxrOpticalTable -  String 'P6 LINK DC-5960' transformed by action [explode] to: 'P6 LINK DC' +  String 'P6 LINK DC5960' transformed by action [explode] to: 'P6 LINK DC5960'
          prezeskk Krzysztof Kulesza made changes -
          Attachment New: Zrzut ekranu 2021-11-04 14.04.41.png [ 19336 ]
          prezeskk Krzysztof Kulesza made changes -
          Attachment New: mt_port-sensors-poller_trunk.txt [ 19335 ]
          prezeskk Krzysztof Kulesza made changes -
          Attachment New: mt_port-sensors-poller.txt [ 19334 ]

          I only copy changed files in r11715 to working copy of observium r11575.
          I update to latest version and check.
          Thanks for reply

           

          r11715 | mike | 2021-11-04 09:33:15 +0100 (Thu, 04 Nov 2021) | 2 lines
          Changed paths:
             M /observium/trunk/includes/definitions/mibs/mikrotik.inc.php
             M /observium/trunk/includes/definitions/os/mikrotik.inc.php

          prezeskk Krzysztof Kulesza added a comment - I only copy changed files in r11715 to working copy of observium r11575. I update to latest version and check. Thanks for reply   r11715 | mike | 2021-11-04 09:33:15 +0100 (Thu, 04 Nov 2021) | 2 lines Changed paths:    M /observium/trunk/includes/definitions/mibs/mikrotik.inc.php    M /observium/trunk/includes/definitions/os/mikrotik.inc.php

          People

            landy Mike Stupalov
            prezeskk Krzysztof Kulesza
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: