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. Instance Discovery Filter Script adding "{alias}"

Instance Discovery Filter Script adding "{alias}"

Scheduled Pinned Locked Moved Support
5 Posts 3 Posters 40.6k 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.
  • A
    A
    anw
    wrote on last edited by
    #1

    Hey

    if found this solution for automation and filtering of dcis for my switches:
    Description: Traffic, IN {instance-name}
    Instance Discovery
    Snmpwalk OID
    Base OID
    .1.3.6.1.2.1.31.1.1.1.1
    filtering script
    snmp = CreateSNMPTransport($node);
    /* nur wenn PortSpeed > 0 */
    x = SNMPGetValue(snmp, ".1.3.6.1.2.1.2.2.1.5.".$1);
    y = SNMPGetValue(snmp, ".1.3.6.1.2.1.31.1.1.1.17.".$1);
    if (x>0 && y!=2) return 1;
    else return 0;

    I would like to integrate the alias/port description in the description part
    so the ouput would be

    Description: Traffic {alias}, IN {instance-name}

    how could i do this ?

    regards

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

      Hi,

      you cannot add another placeholder, but you can concatenate anything you need into {instance-name} in filter script. For example, to add prefix "instance" to every instance name return from script as following:

      return %(true, $1, "instance: " . $1);

      first element is acceptance indicator, second is instance ({instance} will be replaced by it), third is instance name. There should be examples on the forum for filtering scripts used to return meaningful interface names in {instance-name}.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • A
        A
        anw
        wrote on last edited by
        #3

        ok thanks, but i wouldnt like to add a prefix - i would like to add the port description. not sure how to do it

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

          You can read it from interface object (you can find one using GetInterfaceObject function), or directly from device via SNMP or agent (there are functions for direct SNMP or agent access).

          Best regards,
          Victor

          1 Reply Last reply
          0
          • W
            W
            Whiteotlc
            wrote on last edited by
            #5

            @victor said in Instance Discovery Filter Script adding "{alias}":

            Hi,

            you cannot add another placeholder, but you can concatenate anything you need into {instance-name} in filter script. For example, to add prefix "instance" to every instance name return from script as following:

            return %(true, $1, "instance: " . $1);

            first element is acceptance indicator, second is instance ({instance} will be replaced by it), third is instance name. There should be examples on the forum for filtering scripts used to return meaningful interface names in {instance-name}.

            Best regards,
            Victor

            thank you so much for very helpful post. i will definitely take a note on everything you say because for sure it will resolve my problem as well in filter script adding. thanks!

            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