dependency script based on infrastructure
-
Hi Victor,
I was wondering if someone can maybe help me with the script issue I am having.I have the following script to only trigger and alarm email when the device is offline for longer that the specified time configured in the Thresholds:
return ($node->runtimeFlags & 0x0004) ? 1 : 0;The problem I am having is that I get about 100+ emails when a site goes down for power failure or something. I was looking at another thread where there was a script used for filtering alarms.
https://www.netxms.org/forum/configuration/dependency-script-based-on-infrastructure/
Code used:
nparents = GetNodeParents($node); // get parent objects of tested node foreach(i : nparents) { if (i->type == 5) // if it is infrastructure object (container)... { oparents = GetObjectParents(i); //... get parents of the object too... foreach(j : oparents) { if (j->type == 5) //... and if it is infrastructure object (container) again... { children = GetObjectChildren(j); //... get object children... foreach(k : children) { if ((k->status == 4) && (classof(k)!="NetObj")) return 0; //... and if the status of any of the children objects is "critical" (bypassing non-node objects) do not take action. } } } } } return 1; // else allow actionI have been trying to make this work but have no luck, I think the problem is my layout in NetXMS structure for sites. Attached image is my structure.
I have them this way as it makes it easier to view on Status Map.Any assistance would be greatly appreciated.

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login