FindNodeBySysName

FindNodeBySysName(sysname, currentNode): Node

Look up Node object by SNMP sysName.

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 omitted or set to null.

Table 1. Parameters

sysname

String

SNMP sysName.

currentNode

NetObj

Lookup context or null if trusted nodes validation is disabled. Optional parameter.

Return

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

node = FindNodeBySysName("switch-main");
if (node != NULL) println(node.name); // Prints node name if node with given sysName is found