NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: Disable Configuration Poll for All Nodes or Nodes in a container  (Read 210 times)

clifford

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Disable Configuration Poll for All Nodes or Nodes in a container
« 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
Logged

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6509
    • View Profile
Re: Disable Configuration Poll for All Nodes or Nodes in a container
« Reply #1 on: February 21, 2019, 03:29:30 pm »

Hi,

You can do this with nxshell script, like this:

Code: [Select]
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:

Code: [Select]
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
Logged

clifford

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Disable Configuration Poll for All Nodes or Nodes in a container
« Reply #2 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


Logged