Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Port Negotiation Template

Port Negotiation Template

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 53.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    T
    twparker
    wrote on last edited by
    #1

    Hello,

    I'm trying to setup a template that collects port negotiation rates on Mikrotik devices. I get the info that I want on physical ports, but I get 0 results on virtual interfaces. I would like to filter out virtual interfaces so DCIs are not being created.

    transport = CreateSNMPTransport($node);
    if (transport == null)
     return false;
    // get the interface name to return as instance-name
    vb = SNMPGet(transport, ".1.3.6.1.2.1.31.1.1.1.1." .. $1);
    if (vb == null) or (vb == 0)
     return false;
    // filter out loopback
    if (vb.value == "lo")
     return false;
    return %(true, $1, vb.value);

    I've tried using contains(vb.value, "vlan") on the bottom statement, but that just breaks the script.

    1 Reply Last reply
    0
    • T
      T
      tolimanjo
      wrote on last edited by
      #2

      Could try using the interface type - RouterOS appears to use type 6 (ethernetCsmacd) exclusively for physical interfaces:

      interface = $node?.getInterfaceByIndex($1);
      if (interface != null) {
          if (interface.ifType == 6)
              return [true, $1, interface.name];
      }
      
      1 Reply Last reply
      0
      • T
        T
        twparker
        wrote on last edited by
        #3

        Thanks tolimanjo. That limited it, but it seems that I can't call the variable interface.name for the display name.

        1 Reply Last reply
        0
        • T
          T
          tolimanjo
          wrote on last edited by
          #4

          Not sure about the absent interface.name - possibly a version issue?

          I've attached screenshots of an example similar to your approach. It worked for me on server version 5.2.x (Debian) against a 6-port MikroTik.


          Port speed template - 1 - General.png

          Port speed template - 2 - Instance Discovery.png

          Port speed template - 3 - Data Collection.png

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups