Community discussions

MikroTik App
 
tobcon
just joined
Topic Author
Posts: 12
Joined: Sun Mar 06, 2022 6:57 pm

REST API SFP Temperature / SFP RX Loss parameters

Tue Sep 05, 2023 4:00 pm

Hello

I'm trying to query the SFP Parameters which are available via CLI with a command like this:
> /interface/ethernet monitor sfp-sfpplus1
                    name: sfp-sfpplus1
                  status: no-link
        auto-negotiation: disabled
      sfp-module-present: yes
             sfp-rx-loss: yes
            sfp-tx-fault: no
                sfp-type: SFP/SFP+/SFP28
      sfp-connector-type: LC
      sfp-link-length-sm: 10km
         sfp-vendor-name: FLEXOPTIX
  sfp-vendor-part-number: P.B1696.10.AD
     sfp-vendor-revision: A
       sfp-vendor-serial: 1234
  sfp-manufacturing-date: 22-09-09
          sfp-wavelength: 1270nm
         sfp-temperature: 48C
      sfp-supply-voltage: 3.286V
     sfp-tx-bias-current: 40mA
            sfp-tx-power: -2.35dBm

I place a GET request to http://172.16.50.1/rest/interface/ethernet/sfp-sfpplus1 and receive this:
{
    ".id": "*1",
    "arp": "enabled",
    "arp-timeout": "auto",
    "auto-negotiation": "false",
    "bandwidth": "unlimited/unlimited",
    "default-name": "sfp-sfpplus1",
    "disabled": "false",
    "driver-rx-byte": "0",
    "driver-rx-packet": "0",
    "driver-tx-byte": "0",
    "driver-tx-packet": "0",
    "full-duplex": "true",
    "l2mtu": "1580",
    "loop-protect": "default",
    "loop-protect-disable-time": "5m",
    "loop-protect-send-interval": "5s",
    "loop-protect-status": "off",
    "mac-address": "4C:5E:0C:XX:XX:XX",
    "mtu": "1500",
    "name": "sfp-sfpplus1",
    "orig-mac-address": "4C:5E:0C:XX:XX:XX",
    "running": "false",
    "rx-1024-1518": "0",
    "rx-128-255": "0",
    "rx-1519-max": "0",
    "rx-256-511": "0",
    "rx-512-1023": "0",
    "rx-64": "0",
    "rx-65-127": "0",
    "rx-align-error": "0",
    "rx-broadcast": "0",
    "rx-bytes": "0",
    "rx-code-error": "0",
    "rx-fcs-error": "0",
    "rx-flow-control": "off",
    "rx-ip-header-checksum-error": "0",
    "rx-jabber": "0",
    "rx-length-error": "0",
    "rx-multicast": "0",
    "rx-overflow": "0",
    "rx-packet": "0",
    "rx-pause": "0",
    "rx-tcp-checksum-error": "0",
    "rx-too-long": "0",
    "rx-too-short": "0",
    "rx-udp-checksum-error": "0",
    "sfp-rate-select": "high",
    "sfp-shutdown-temperature": "95",
    "speed": "1Gbps",
    "tx-1024-1518": "0",
    "tx-128-255": "0",
    "tx-1519-max": "0",
    "tx-256-511": "0",
    "tx-512-1023": "0",
    "tx-64": "0",
    "tx-65-127": "0",
    "tx-broadcast": "0",
    "tx-bytes": "0",
    "tx-carrier-sense-error": "0",
    "tx-deferred": "0",
    "tx-excessive-collision": "0",
    "tx-fcs-error": "0",
    "tx-flow-control": "off",
    "tx-late-collision": "0",
    "tx-multicast": "0",
    "tx-multiple-collision": "0",
    "tx-packet": "0",
    "tx-pause": "0",
    "tx-single-collision": "0",
    "tx-underrun": "0"
}

The SFP related parameters are mostly missing. Any idea how to place a GET request returning something similar like monitor on the CLI?
 
JDF
just joined
Posts: 12
Joined: Wed Aug 16, 2023 1:40 pm

Re: REST API SFP Temperature / SFP RX Loss parameters  [SOLVED]

Tue Sep 05, 2023 6:56 pm

Hey,

I got it working with POST /rest/interface/ethernet/monitor
post data for sfp4 in my case { "numbers":"*5","duration":"1"}
This way I got the temperatures and voltages too. Without the duration it responds with code 200 in about 1minute but without data. This is why I added the 1 sec duration.
 
tobcon
just joined
Topic Author
Posts: 12
Joined: Sun Mar 06, 2022 6:57 pm

Re: REST API SFP Temperature / SFP RX Loss parameters

Tue Sep 05, 2023 10:43 pm

Nice, thank you!

Who is online

Users browsing this forum: infabo and 10 guests