FindNodeObject

FindNodeObject(currentNode, key): Node

Look up Node object by either name or object id, will return null if object not found or not accessible. This function search for nodes only.

If trusted node validation is enforced, currentNode should point to execution context object (instance of NetObj, $node in most cases). If trusted nodes are disabled (default server configuration), currentNode can be set to null.

Table 1. Parameters

currentNode

Lookup context or null if trusted nodes validation is disabled.

key

Object name of id.

Return

Instance of Node object or null if not found or not accessible.

>>> FindNodeObject($node, "server.netxms.org")
object
>>> FindNodeObject(null, 12)
object
>>> FindNodeObject($node, "bad_node_name")
NULL