new nodes search function [SOLVED]

Started by sperlm, September 02, 2014, 02:11:03 PM

Previous topic - Next topic

sperlm

Hello,

   I have Infrastructure Services structure built up (for dependency script, info on hierarchy in messages and to help build up network maps). And I was wondering if there is anything I can do to check if there are new nodes that need to be "bound" to the structure.

I was thinking of building a script that gets node on a discovery poll and compares if it is somewhere in Infrastructure Services. If not, add it to some temporary folder in the infrastructure (so it is "found" on the next poll, and highlighted as "new").
Problems I can see are load it could make on every poll, but more importantly - I don't have idea how to check the infrastructure to compare it. The node can be anywhere deep in the infrastructure, how would you solve such check ?

Script that does it once per request might be even better and this has led me to another question - is there some kind of parameter in database that might say there is a link and the node has been "bound" somewhere ?
For start it would be sufficient to run a query against the DB to check if nodes are "not bound anywhere".
Have not found suitable parameter though.

With regards,

M.Sperl

tomaskir

#1
I have this solved like this: I have a Container in "Infrastructure Services" named "!Unassigned". This Container has an autobind script:

parents = GetNodeParents($node);

foreach(p : parents)
{
if ((p->type != 1) && (p->name != "!Unassigned"))
{
return false;
}
}

return true;


Please note you have to have "CheckTrustedNodes" set to 0 for this script to work.

For a further explanation of what this script does, see this thread:
https://www.netxms.org/forum/general-support/bound-unbound-nodes/

sperlm

Neat! Thanks for pointing that out for me.
This is perfect solution.

Have to apologize for not using the search button (really, when one does not use search it turns out to be really easy problem which has already been solved and well documented  :o).