Object Filter in Layer3-Maps

Started by Dani@M3T, July 06, 2015, 05:31:20 PM

Previous topic - Next topic

Victor Kirhenshtein

I probably understand it - nodes on L3 map re connected via subnet objects, not directly - and you filtered out subnet objects. You should change your filter to allow subnets or add relevant subnet objects to your container.

Best regards,
Victor

Dani@M3T

Hi Victor

When I add the subnets to the containers, I got the connectors in Layer3 map. But that's not very elegant. The other solution seems to be better.
How can I change my filter to allow the necessary subnet objects?

My current filter script is this:
parents = GetObjectParents($object);
//if (parents == null) return false;
foreach(p : parents)
{
   if ((p->type == 5) && (p->name == "containerA" || p->name == "ContainerB")) return true;
}
return false;

Victor Kirhenshtein

Hi,

it could be like this:


if ($object->type == 1)
   return true;  // allow all subnets

parents = GetObjectParents($object);
//if (parents == null) return false;
foreach(p : parents)
{
   if ((p->type == 5) && (p->name == "containerA" || p->name == "ContainerB")) return true;
}
return false;


You can also add additional contraints on subnet names as usual using $object->name.

Best regards,
Victor

Dani@M3T

All my subnets has names like '10.1.17.0/24 (SiteA)' and all Containers are named like 'SiteA'. So I can filter like this:
// only Subnets with 'SiteA' oder 'SiteB' in name
if (($object->type == 1) && (($object->name ~= ".*(SiteA.*)") || ($object->name ~= ".*(SiteB.*)")))
   return true;


Now the filtered map looks ok! But...

...only one new problem. Cluster nodes:
I tried to make an extention of the filtering script to handle clusters. But I found with a test script that cluster nodes has no node parents.

parents = GetObjectParents($object);
foreach(p : parents)
   println("Type: " . p->type . " Name: " . p->name);

Is this by design? With 'GetObjectParents' function I get neither the cluster-object nor the container as parent object. So all clusters nodes are missing on filtered maps.