There are multiple ways of doing this. Below is auto bind script that illustrates one approach:
This script assumes that container is called "Site:RouterName", so it extracts name of the router object from own name. You can choose whatever method of router identification that suits you best. Then it checks all subnets this router belongs to, and binds all nodes from those subnets (including itself). For practical use you may have to add additional filters on what subnets to consider.
Best regards,
Victor
Code Select
if (not ($container->name match "^Site:(.*)"))
return false;
router = FindObject($1);
if (router == null)
return false;
for(rp : router->parents)
{
if (classof(rp) == "Subnet")
{
for(np : $node->parents)
if (np->id == rp->id) // Same object
return true;
}
}
return false;
This script assumes that container is called "Site:RouterName", so it extracts name of the router object from own name. You can choose whatever method of router identification that suits you best. Then it checks all subnets this router belongs to, and binds all nodes from those subnets (including itself). For practical use you may have to add additional filters on what subnets to consider.
Best regards,
Victor