Automatic bind on zoneID

Started by d-ray, May 08, 2015, 01:43:52 PM

Previous topic - Next topic

d-ray

Hi,

Can anyone help the for the syntax of a filter script
I want to filter all nodes with the same zoneID in one container.

sub main()
{
   if ($node->zoneID == 106)
   {
      return 1;
   }
}

Regards
Denis

jhuliagraziella

I hope this could help! :D

sub main()
{
   if (($node)->zoneId == 106)
   {
      return 1;
   }
   return 0;
}

Regards,

Jhúlia Graziella

d-ray


Victor Kirhenshtein

It also could be simplified to


return $node->zoneId == 106;


Best regards,
Victor

d-ray

is it possible to use the zonename in text?

jhuliagraziella

Quote from: d-ray on May 12, 2015, 12:06:57 PM
is it possible to use the zonename in text?

Have you tried using FindObject()?
That way you can search it by the name in text.

https://wiki.netxms.org/wiki/NXSL:FindObject