Quote from: Sumit Pandya on December 06, 2010, 04:33:54 PM
Dear Victor, The script you shared did not worked. I tried to "Test" above transformation with Test value = 2(random), I get error "Error 14 in line 2: Left argument of -> must be a reference to object". I further added a check
if (node2 == null)
return 0; // No such node or access denied
and surprisingly I get this "0" returned. Please note that my nodes are part of cluster. Is that could be limitation?
Did you set trusted nodes as described here: https://www.netxms.org/forum/configuration/nxsl-and-dci/msg4633/#msg4633? Most likely it's an access control issue.
Quote from: Sumit Pandya on December 06, 2010, 04:33:54 PM
Using the approach you suggest, I may loose information of my one node. I just wonder if you can have some push method from scripting. Can I create a dummy node, define data collection with origion "Push Agent". Then define a schedule to run every minute "1 * * * *". Finally do something like below into Transformation?
node1 = FindNodeObject($node, "system-1");
value1 = GetDCIValue(node1, FindDCIByDescription(node1, "Auth-Req"));
node2 = FindNodeObject($node, "system-2");
value2 = GetDCIValue(node2, FindDCIByDescription(node2, "Auth-Req"));
return value1 + value2;
I'd even fine if database triger level of twick can be done as some very advance level.
You can create additional DCI with source "Internal" and name "Dummy" (of course description can be any). It will always have value of 0, and you can schedule it like any other DCI and use transformation script to get values from two "real" DCIs and sum them.
Best regards,
Victor