NetXMS Support Forum

English Support => General Support => Topic started by: blingblouw on October 16, 2019, 05:29:16 PM

Title: NetXMS 3 automatic apply rules
Post by: blingblouw on October 16, 2019, 05:29:16 PM
Hi.

Since upgrading to NetXMS v3 my template automatic apply rules don't work. They are pretty simple, could this be due to the regex change?

This is my one below. Any ideas?

return $node->sysDescription ~= "CSS";
Title: Re: NetXMS 3 automatic apply rules
Post by: blingblouw on October 16, 2019, 06:33:18 PM
this seems to work

return $node->sysDescription like "*CSS*";
Title: Re: NetXMS 3 automatic apply rules
Post by: Victor Kirhenshtein on October 16, 2019, 06:40:10 PM
Hi,

this is because ~= operation now returns array of capture groups instead of boolean value. It works as expected in "if" statement and other places where logical expression is expected, but "return" statement just returns array, which is ignored by poller code. This is bug in a poller which we will fix. As a workaround you can use expression like this:

return ($node->sysDescription ~= "CSS") ? true : false;

Best regards,
Victor