Disable Configuration Poll for All Nodes or Nodes in a container

Started by clifford, February 21, 2019, 02:32:21 PM

Previous topic - Next topic

clifford

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

Victor Kirhenshtein

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

clifford

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



Hamit

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?

Filipp Sudanov