FindDCIById
Since 6.2.6
- FindDCIById(id, currentNode): DCI
-
Find DCI by its ID on any data collection target. Unlike GetDCIObject, the owner of the DCI does not have to be known in advance; it can be obtained from the owner attribute of the returned object.
Only objects accessible to the user on whose behalf the script is executed are searched.
If trusted node validation is enforced,
currentNodeshould point to execution context object (instance of NetObj,$nodein most cases) and only objects that have it in their trusted objects list are searched. WithoutcurrentNodenothing will be found. If trusted nodes are disabled (default server configuration),currentNodecan be omitted or set tonull.Table 1. Parameters id
Integer
DCI id
currentNode
Lookup context or
nullif trusted nodes validation is disabled. Optional parameter.ReturnDCI object or
nullif not found or not accessible.>>> dci = FindDCIById(144); >>> println(dci.name .. " on " .. dci.owner.name); Agent.Version on netxms-server >>> FindDCIById(999999) null