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. Question about discovery w/ filter

Question about discovery w/ filter

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 26.7k 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.
  • S
    S
    sjudy
    wrote on last edited by
    #1

    Hello,

    I am new to writing scripts for discovery and have that down ok... but I am looking for a way to also filter the interfaces if they are not active.

    In this case, I have a sonicwall I wish to monitor, but I don't need to see all the ports not in use.  They all show UP because they use PortShields which connect all the ports in an UP fashion, so I wanted to filter on MTU which in SNMP shows zero on all the ports I wish to ignore.

    My SNMP DCI looks like this:

    Param: .1.3.6.1.2.1.31.1.1.1.10.{instance}
    Discovery (OID): .1.3.6.1.2.1.2.2.1.1

    Discovery Filter:

    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)
    	return false;
    
    // filter out loopback
    if (vb->value == "lo")
    	return false;
    
    return %(true, $1, vb->value);
    

    I know MTU is pulled in and stored with the interfaces, but not sure how to filter in the discovery script I have so far.

    Like I said, pretty new at this and just getting my hands dirty.... so any help would be greatly appreciated!

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi,

      knowing interface index you can use function GetInterfaceObject($node, index) to get interface object, and then read it's property "mtu". Alternative approach could be to send SNMP request for .1.3.6.1.2.1.2.2.1.4.{instance} as you do for interface name.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • S
        S
        sjudy
        wrote on last edited by
        #3

        Sorry for my delay... I thought I responded.  Thank you! Worked perfectly!

        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