Hey sNsReal,
You could probably use the newly available creationTime attribute on the NetObj class (added sometime in v3) which is epoch of when the object was created.
So on the container that you want nodes to autobind to, you could enable "Automatically bind nodes selected by filter to this container", and disable the unbind option.
And your filtering script would be something like this:
This will bind nodes that have been created within the last hour. So long as the node performs a config poll within that time, then it should bind.
If it does not return true, then it will implicitly return null, and null means that it won't bind or unbind the node being processed.
If the object was created prior to the CreationTime being added to NetXMS, then CreationTime will be 0.
You could probably use the newly available creationTime attribute on the NetObj class (added sometime in v3) which is epoch of when the object was created.
So on the container that you want nodes to autobind to, you could enable "Automatically bind nodes selected by filter to this container", and disable the unbind option.
And your filtering script would be something like this:
Code Select
HOURS_IN_SECONDS = 3600;
if($node->creationTime != 0 && (time() - $node->creationTime) < HOURS_IN_SECONDS) return true;
This will bind nodes that have been created within the last hour. So long as the node performs a config poll within that time, then it should bind.
If it does not return true, then it will implicitly return null, and null means that it won't bind or unbind the node being processed.
If the object was created prior to the CreationTime being added to NetXMS, then CreationTime will be 0.