NetXMS Support Forum

English Support => General Support => Topic started by: charly on March 12, 2021, 04:12:27 PM

Title: Manage/Unmanage Node via nxshell
Post by: charly on March 12, 2021, 04:12:27 PM
I am using nxalarm to terminate alarms and it works perfect.

Now I would also like to manage/unmanage a node via nxshell.
Is there already an option to do that?

Thanks
charly
Title: Re: Manage/Unmanage Node via nxshell
Post by: johnnyva on March 16, 2021, 01:00:55 AM
Hey charly,

You can use setObjectManaged which is a method on the session object https://www.netxms.org/documentation/javadoc/latest/org/netxms/client/NXCSession.html#setObjectManaged-long-boolean-

You can do the following:

Manage a node

node = s.findObjectByName('testnode')
s.setObjectManaged(node.getObjectId(), True)


Unmanage a node

node = s.findObjectByName('testnode')
s.setObjectManaged(node.getObjectId(), False)
Title: Re: Manage/Unmanage Node via nxshell
Post by: charly on March 17, 2021, 01:07:56 PM
That works!
Thank you very much!

charly