NetXMS 3 automatic apply rules

Started by blingblouw, October 16, 2019, 05:29:16 PM

Previous topic - Next topic

blingblouw

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";

blingblouw

this seems to work

return $node->sysDescription like "*CSS*";

Victor Kirhenshtein

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