Force DCI poll from NXSL?

Started by pvo, December 11, 2020, 09:59:08 AM

Previous topic - Next topic

pvo

Is it possible to force DCI poll from a NXSL script?

I collect DCI values every 15 minutes because they change rarely and have NSXL script object commands which change the monitored state (for example on/off a display screen or input source).
It would be useful to check/change the state of DCI immediately after the command execution and not to wait 15 minutes for the next polling cycle or force the DCI poll manually.

Alex Kirhenshtein

You can call forcePoll() method on the DCI (https://www.netxms.org/documentation/nxsl-latest/#_instance_methods_5)


dciId = FindDCIByName($node, "My.Custom.DCI");
if (dciId > 0) {
  dci = GetDCIObject($node, dciId);
  if (dci != null) {
    dci->forcePoll();
  }
}

pvo

Thank you.
I was probably blind that I didn't find it.