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. Trusted Nodes

Trusted Nodes

Scheduled Pinned Locked Moved Support
9 Posts 3 Posters 54.1k 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.
  • M
    M
    MarcusH
    wrote on last edited by
    #1

    Hi,

    Are there any ways to manage trusted nodes in bulk or do you need to righ click every single node and add trusted node?

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

      First of all, you can turn checking of trusted nodes on server level by changing CheckTrustedNodes server configuration parameter.

      Mass changins of node properties is only possible with nxshell - you'd need to create a script using jithon. nxshell communicates with the same api as management client, so everything that could be done via client can be done in nxshell.
      API documentation is here: https://www.netxms.org/documentation/javadoc/latest/index.html
      Some information about nxshell is here: https://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations

      1 Reply Last reply
      0
      • M
        M
        MarcusH
        wrote on last edited by
        #3

        Perfect thanks alot, i have had trusted nodes active for a long time just first time i need to add a trusted node on a lot of nodes.

        1 Reply Last reply
        0
        • M
          M
          MarcusH
          wrote on last edited by
          #4

          Got a script working that loops all nodes in a container but i cannot get setTrustedNodes to work, i think i have it down to NXCObjectModificationData not working in my case, happy for any pointers 🙂

          Tried this simple code for verification and it does not work only get NoneType from data.

          print node.getObjectId()
          data = NXCObjectModificationData(node.getObjectId())
          print data.getName()

          1 Reply Last reply
          0
          • M
            M
            MarcusH
            wrote on last edited by
            #5

            Here is the entire code i am trying to get working, i get TypeError: setTrustedNodes(): 1st arg can't be coerced to java.lang.Long[]

            # Add trusted nodes to list
            trustednodes = [session.findObjectById(objectID)]

            # Container to add trusted nodes to
            container = session.findObjectById(objectID)

            # Loop nodes in container
            for node in container.getAllChildren(objects.GenericObject.OBJECT_NODE):
             print node.getObjectName()
             data = NXCObjectModificationData(node.getObjectId())
             data.setTrustedNodes(trustednodes)
             session.modifyObject(data)

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

              Argument for setTrustedNodes is array of object identifiers, not array of objects, so probably something like this will work:
               data.setTrustedNodes([trustedNodeId])
              where trustedNodeId is an ID of node to be set as trusted.

              Best regards,
              Victor

              1 Reply Last reply
              0
              • M
                M
                MarcusH
                wrote on last edited by
                #7

                Ah i got it working with trustednodes = [session.findObjectById(objectID).getObjectId()] but data.setTrustedNodes([trustedNodeId]) is cleaner

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

                  session.findObjectById(objectID).getObjectId() is kind of pointless - you already know object ID, but you use it to find object by that ID, only to get that same ID from object...

                  1 Reply Last reply
                  0
                  • M
                    M
                    MarcusH
                    wrote on last edited by
                    #9

                    Indeed i was deep in loops of trial and error to get it to work and i just tested it and it worked and just as i saw your reply i got how simple it was and how unnecessary advanced i made it 🙂

                    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