NetXMS Support Forum

English Support => General Support => Topic started by: d-ray on May 08, 2015, 01:43:52 PM

Title: Automatic bind on zoneID
Post by: d-ray on May 08, 2015, 01:43:52 PM
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
Title: Re: Automatic bind on zoneID
Post by: jhuliagraziella on May 08, 2015, 10:07:52 PM
I hope this could help! :D

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

Regards,

Jhúlia Graziella
Title: Re: Automatic bind on zoneID
Post by: d-ray on May 09, 2015, 02:05:26 PM
Thanks for the help
Title: Re: Automatic bind on zoneID
Post by: Victor Kirhenshtein on May 11, 2015, 09:57:37 AM
It also could be simplified to


return $node->zoneId == 106;


Best regards,
Victor
Title: Re: Automatic bind on zoneID
Post by: d-ray on May 12, 2015, 12:06:57 PM
is it possible to use the zonename in text?
Title: Re: Automatic bind on zoneID
Post by: jhuliagraziella on May 13, 2015, 04:32:07 PM
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