NetXMS Support Forum

English Support => General Support => Topic started by: wuwei on January 21, 2021, 03:02:00 PM

Title: bind filter
Post by: wuwei on January 21, 2021, 03:02:00 PM
Hello,
how can I make an automatic bind rule for a container that filters windows agents in which software inventory contains a specific program?

Thank you.
Title: Re: bind filter
Post by: Egert143 on January 21, 2021, 03:25:02 PM
if (!$node->isAgent)
return false;


if ( $node->platformName ~= "windows")
{
table = AgentReadTable($node, "System.InstalledProducts");
if ( table == null ) return null;
colName = table->getColumnIndex("NAME");
for (currentRow = 0; currentRow < table->rowCount; currentRow++)
{
if ( table->get(currentRow, colName) ~= "Program name" ) return true;
}
}
return false;
Title: Re: bind filter
Post by: wuwei on January 21, 2021, 03:46:25 PM
Thank you!  :)