Hi!
"logical not" operation (!) has higher priority than "match" operation (~=). So your script actually does logical not on text string ($node->platformName) which causes runtime error. It only happens on nodes without agent. You should get match operation in brackets:
(!($node->platformName ~= "windows.*"))
Also, I suspect you have logical error here. You probably want to return false if there is no agent OR platform is not Windows - but current condition uses AND which is pointless - if node has no agent platform name will be empty anyway and won't match anyway.
Best regards,
Victor
"logical not" operation (!) has higher priority than "match" operation (~=). So your script actually does logical not on text string ($node->platformName) which causes runtime error. It only happens on nodes without agent. You should get match operation in brackets:
(!($node->platformName ~= "windows.*"))
Also, I suspect you have logical error here. You probably want to return false if there is no agent OR platform is not Windows - but current condition uses AND which is pointless - if node has no agent platform name will be empty anyway and won't match anyway.
Best regards,
Victor