Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. dependency script based on infrastructure

dependency script based on infrastructure

Scheduled Pinned Locked Moved Support
1 Posts 1 Posters 19.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N
    N
    NicovdWalt
    wrote on last edited by
    #1

    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 action
    

    I 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. 🙂


    Capture.JPG

    1 Reply Last reply
    0

    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
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    Powered by NodeBB Contributors
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups