NetXMS Support Forum

English Support => General Support => Topic started by: Watchman on October 19, 2015, 02:40:55 AM

Title: Function GetDCIValueByDescription returns (once) an empty string
Post by: Watchman on October 19, 2015, 02:40:55 AM
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.
Title: Re: Function GetDCIValueByDescription returns (once) an empty string
Post by: Victor Kirhenshtein on October 19, 2015, 11:23:25 AM
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
Title: Re: Function GetDCIValueByDescription returns (once) an empty string
Post by: tomaskir on October 19, 2015, 06:24:59 PM
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)
Title: Re: Function GetDCIValueByDescription returns (once) an empty string
Post by: Watchman on October 19, 2015, 11:32:13 PM
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.