Hi!
The only possible initialization of array is like
monitornodes[1] = "system-1";
monitornodes[2] = "system-2";
monitornodes[2] = "system-3";
I like the idea of having array initializers, I will add it to NXSL. Also, your script has an error if for loop condition - it should be monitornodes[i] != NULL, not monitornodes != NULL. So, correct version of the script should looks like this:
array monitornodes;
monitornodes[1] = "system-1";
monitornodes[2] = "system-2";
monitornodes[2] = "system-3";
summary=0;
for (i=1; monitornodes[i] != NULL ; i++)
{
inode = FindNodeObject($node, monitornodes[i]);
ivalue = GetDCIValue(inode, FindDCIByDescription(inode, "TotalAuth"));
summary += ivalue;
}
return summary;
Best regards,
Victor