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.

Instance discovery.

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 40.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.
  • E
    E
    Egert143
    wrote on last edited by
    #1

    Hello

    Could use help with dci instance discovery.

    I have 2 Mikrotik wifi devices where i would like to poll ssid name. On one device it reports with .1.3.6.1.4.1.14988.1.1.1.3.1.4.1 on another one with .1.3.6.1.4.1.14988.1.1.1.3.1.4.2. The end number is changing. How can i discover that dynamicaly?

    Egert

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      Pls see DCI configuration in the attached images. It will perform SNMP walk starting from specified OID and create DCIs for all OIDs encountered in this walk. {instance} macro will contain last part of OID, {instance-name} - value from that OID.

      My Mikrotik device has two items there:
      .1.3.6.1.4.1.14988.1.1.1.3.1.4.1
      .1.3.6.1.4.1.14988.1.1.1.3.1.4.2
      so two DCIs would been created.

      The other approach is to make a script DCI, perform SNMP walk from the script and may be join results into one DCI. I can prepare example of this if needed.


      Screenshot at 2022-09-16 07-18-15.png

      Screenshot at 2022-09-16 07-18-40.png

      1 Reply Last reply
      0
      • E
        E
        Egert143
        wrote on last edited by
        #3

        Hello

        i Did exactly as in picture, but for me i dont see any dci discoveries for some reason.

        Edit:
        When i move the dci directly to node then it works, but under template it doesn't. Maybe it needs longer time?

        Edit:
        After waitng for hour and no dci-s from template appeared. i deleted template and made it again, this time dci-s started apearing and it seems to work.

        Second question. I have script to filter what nodes get applied to template. How can i improve on it to match different oid endings and not manualy add them?

        if( $node->isSNMP ) {
        
            if( $node->sysDescription like "*RouterOS *" && ($node->name like "*[Ap] *") ) {
        
                transport = CreateSNMPTransport($node);
                if ( transport == null ) return NULL;
        
                ssid = SNMPGetValue(transport,".1.3.6.1.4.1.14988.1.1.1.3.1.4.1");
                freq = SNMPGetValue(transport,".1.3.6.1.4.1.14988.1.1.1.3.1.7.1");
        
                ssidB = SNMPGetValue(transport,".1.3.6.1.4.1.14988.1.1.1.3.1.4.2");
                freqB = SNMPGetValue(transport,".1.3.6.1.4.1.14988.1.1.1.3.1.7.2");
        
                if(ssid != null && freq != null) {
                    return true;
                }else if(ssidB != null && freqB != null) {
                    return true;
                }
            }
        }
        
        
        return false;
        
        1 Reply Last reply
        0
        • F
          F
          Filipp Sudanov
          wrote on last edited by
          #4

          Yes, you can use snmpwalk from nxsl script, e.g.

          transport = CreateSNMPTransport($node);
          if (transport != null) {
              oid = ".1.2.840.10036.1.1.1.7";
              vars = SNMPWalk(transport, oid);
              if (vars != null) {
                foreach (v: vars) {
                    println(v->name." = ".v->value);
                }
              }
          }
          

          Then you just need some logic how to parse the results returned by SNMPWalk

          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