NetXMS Support Forum

English Support => General Support => Topic started by: clifford on February 21, 2019, 02:32:21 PM

Title: Disable Configuration Poll for All Nodes or Nodes in a container
Post by: clifford on February 21, 2019, 02:32:21 PM
Hi

Need to force configuration poll on all devices and then Disable Configuration poll on all devices, is that possible via a template or script, if yes then can someone please share me the howto

Regards
Clifford Dsouza
Title: Re: Disable Configuration Poll for All Nodes or Nodes in a container
Post by: Victor Kirhenshtein on February 21, 2019, 03:29:30 PM
Hi,

You can do this with nxshell script, like this:


for node in [o for o in session.getAllObjects() if isinstance(o, objects.Node)]:
  print 'Processing ', node.getObjectName()
  session.pollNode(node.getObjectId(), NodePollType.CONFIGURATION_NORMAL, None)
  md = NXCObjectModificationData(node.getObjectId())
  md.setObjectFlags(node.getFlags() | Node.NF_DISABLE_CONF_POLL)
  session.modifyObject(md)


You can do mass enable of configuration poll like this:


for node in [o for o in session.getAllObjects() if isinstance(o, objects.Node)]:
  print 'Processing ', node.getObjectName()
  md = NXCObjectModificationData(node.getObjectId())
  md.setObjectFlags(node.getFlags() & ~Node.NF_DISABLE_CONF_POLL)
  session.modifyObject(md)


Best regards,
Victor
Title: Re: Disable Configuration Poll for All Nodes or Nodes in a container
Post by: clifford on February 26, 2019, 05:49:16 AM
Thanks Victor

The code worked!

Could it be possible that the things that can be done with executing nxshell script be done via the management interface, it would be great for people like me who get dizzy when we see all that code, makes me wonder how you programmers can retain all that stuff in your heads. :)

This is you 8) and this is me  :o :-[ :'( when i see codes and scripts

Thanks

Clifford


Title: Re: Disable Configuration Poll for All Nodes or Nodes in a container
Post by: Hamit on December 22, 2021, 03:02:26 PM
Hi!
Why doesn't it work?
>>> md.setObjectFlags(node.getFlags() | Node.NF_DISABLE_CONF_POLL)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'org.netxms.client.objects.Node' has no attribute 'NF_DISABLE_CONF_POLL'


Or is any way to get 'Poll/Configuration full' via script?
Title: Re: Disable Configuration Poll for All Nodes or Nodes in a container
Post by: Filipp Sudanov on December 25, 2021, 11:36:26 AM
Try DCF_DISABLE_CONF_POLL  instead