I can get a node's traffic value by writing a simple script, but when I add this script to the data collection configuration section of the node to track it as data, it gives an error (Unsupported) and stops collecting data.
What would be the reason ? 
script.JPG
data-collection-setup.JPG
However, after waiting for a while, it crashes into passive mode with an error.
Status of DCI 0x00001861 (Script: t) changed to UNSUPPORTED
			
			
			
				Today netxms version was updated to 4.2.433-1 and the mentioned faulty sensors started to work.
			
			
			
				Something like this may happen right after server start, if you are taking values from a DCI that has quite frequent collection interval. In this case server is not getting last collected value from database, but awaits it from agent. 
You can check if GetDCIRawValue returns null and handle this situation in the script.