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 - and display name

Instance Discovery Filter Script - and display name

Scheduled Pinned Locked Moved Support
2 Posts 1 Posters 35.3k 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.
  • R
    R
    rhodri
    wrote on last edited by
    #1

    hi guys and girls,
    bit of a question I have about setting the display name based of another SNMP query the data is as follows 

    1.3.6.1.4.1.14988.1.1.19.1.1.2.11 [STRING] = sfp11
    1.3.6.1.4.1.14988.1.1.19.1.1.2.12 [STRING] = sfp12
    1.3.6.1.4.1.14988.1.1.19.1.1.3.11 [INTEGER] = 0
    1.3.6.1.4.1.14988.1.1.19.1.1.3.12 [INTEGER] = 1
    1.3.6.1.4.1.14988.1.1.19.1.1.4.11 [INTEGER] = 0
    1.3.6.1.4.1.14988.1.1.19.1.1.4.12 [INTEGER] = 0
    1.3.6.1.4.1.14988.1.1.19.1.1.5.11 [GAUGE32] = 131000
    1.3.6.1.4.1.14988.1.1.19.1.1.5.12 [GAUGE32] = 85000
    1.3.6.1.4.1.14988.1.1.19.1.1.6.11 [GAUGE32] = 30
    1.3.6.1.4.1.14988.1.1.19.1.1.6.12 [GAUGE32] = 41
    1.3.6.1.4.1.14988.1.1.19.1.1.7.11 [GAUGE32] = 3290
    1.3.6.1.4.1.14988.1.1.19.1.1.7.12 [GAUGE32] = 3256
    1.3.6.1.4.1.14988.1.1.19.1.1.8.11 [GAUGE32] = 17
    1.3.6.1.4.1.14988.1.1.19.1.1.8.12 [GAUGE32] = 4
    1.3.6.1.4.1.14988.1.1.19.1.1.9.11 [INTEGER] = -5468
    1.3.6.1.4.1.14988.1.1.19.1.1.9.12 [INTEGER] = -6800
    1.3.6.1.4.1.14988.1.1.19.1.1.10.11 [INTEGER] = -1407
    1.3.6.1.4.1.14988.1.1.19.1.1.10.12 [INTEGER] = 0
    

    I have tried this to get something but all I get is an error: Minor netxms1 SYS_SCRIPT_ERROR Script (DCI::TheDevice::8963::InstanceFilter) execution error: Error 15 in line 1: Unknown object's attribute 

    dd = $node.createSNMPTransport()?.getValue(".1.3.6.1.4.1.14988.1.1.19.1.1.2.".$1);
    if(dd!=NULL) {
    return [true, $1, dd];
    }
    
    return [true, $1, $1];
    

    if I try getting the data via a seperate script and replace $node with the device it works any help would be great im new to Netxms and Scripting.

    Thanks 
    Rhodri


    Screenshot 2024-12-29 102311.png

    Screenshot 2024-12-29 102404.png

    1 Reply Last reply
    0
    • R
      R
      rhodri
      wrote on last edited by
      #2

      right after a bit of digging and feeling like a total tit.. 

      It turns out I was missing a . from the Concatenation operator simple mistake so this now seems to work

      getoid = ".1.3.6.1.4.1.14988.1.1.19.1.1.2.";
      instance = $1;
      walk = $node.createSNMPTransport()?.getValue(getoid .. instance);
      if(walk == NULL) {
      walk = $1;
      }
      return [true, instance, walk];
      

      and this now effects the {instance-name} as intended.

      hope it helps someone in the future!

      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