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