Function GetDCIValueByDescription returns (once) an empty string

Started by Watchman, October 19, 2015, 02:40:55 AM

Previous topic - Next topic

Watchman

I set up an DCI with: origin-script, data type-string, polling intervall-300
The script returns possible node problems as string - amongst other things using the function GetDCIValueByDescription.
While NetXMS is constantly running, I get the last value (not empty as expected).
If the Core Server has been restarted, the function GetDCIValueByDescription returns (once) an empty string.  :-\
I checked in the history that the last value was not empty.

I would call it a bug ::) , observed in version 2.0-RC1 and 2.0-RC2.

Best Regards.

Victor Kirhenshtein

Hi,

GetDCIValueByDescription reads last value from cache. It can happen that it was called faster then cache for queried DCI was populated (either by poll or from database). I'll think what I can do with that.

Best regards,
Victor

tomaskir

I dont think this is a bug, its normal to get no value if the value has not been read from the node yet (due to server just starting up).

Simply code around it in your script... either return error, or something similiar.
(we do it like that in all our scripts)

Watchman

Many thanks for your answers.

Quote from: Victor Kirhenshtein on October 19, 2015, 11:23:25 AM
..
GetDCIValueByDescription reads last value from cache. It can happen that it was called faster then cache for queried DCI was populated (either by poll or from database). I'll think what I can do with that.
..

It would be nice if the behavior could be changed. :)
(Although a restart is a special situation ..)

Best Regards.