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. Netxms 3.1.261 and device discovery

Netxms 3.1.261 and device discovery

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 12.2k 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.
  • J
    J
    jermudgeon
    wrote on last edited by
    #1

    I have a large class of devices (perhaps mostly Cisco?) that are failing discovery in an odd way.

    1. Devices are detected with isSNMP=Yes, GENERIC driver, and added to db
    2. Manual inspection shows that devices were added with SNMP 'public' community
    3. Devices respond to a snmpwalk using 'public' with the following:
      iso.3.6.1.2.1 = No more variables left in this MIB View (It is past the end of the MIB tree)
      Note that this is a different response than with an invalid string; with an invalid string, queries just time out. With this (ACLed) string, 'public' simply has no allowed views.
    4. Devices (and discovery) are configured with a *different* SNMP string which does actually work via a walk, but not via discovery.

    Is there a way to change discovery behavior to try 'public' *last*? There doesn't appear to be an order in the SNMP Configuration that's relevant.

    Is there a way to batch change configured SNMP communities on nodes? Batch 'properties' change doesn't seem to exist in the UI. Better yet, can I do this with NXSL? I'm not seeing an attribute that lets me check or set the SNMP community.

    Thanks

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

      Currently community strings are not sorted / prioritized. The value specified in node properties ('public' by default) is tried first, then server tries community strings from settings (in order in which the database returned the list).

      There is no way to change community string from NXSL.
      The only possible way for now is to use a Jython script launched by nxshell.

      1 Reply Last reply
      0
      • J
        J
        jermudgeon
        wrote on last edited by
        #3

        Thank you, Filipp. Has anyone written such a script yet that you know of?

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

          Here's an example of such script, that will change community string for all nodes, that have SNMP polling enabled

          newAuthName = 'public2'
          for node in [o for o in session.getAllObjects() if isinstance(o, objects.Node)]: # filter all objects for objects.Node
              if (node.getFlags() & Node.NF_DISABLE_SNMP) = 0: # SNMP polling is not disabled
                  if (node.getSnmpAuthName() != newAuthName):
                      print('Processing node %s: changing community string from %s to %s' % (node.objectName, node.getSnmpAuthName(), newAuthName))
                      md = NXCObjectModificationData(node.objectId)
                      md.setSnmpAuthName(newAuthName)
                      session.modifyObject(md)
          

          The script is launched like this:

          java -jar nxshell-3.1.241.jar script_name.py
          

          There are some examples of Jython scripts in netxms sources in src/client/nxshell/samples/
          Some examples are also here: https://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations
          Documentation of API calls is here: https://www.netxms.org/documentation/javadoc/latest/overview-summary.html

          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