Template autoapply rules
-
Dear community.
I'm trying to apply a template for ICMP monitoring to devices that are under specific containers and I'm having issues with the Automatic apply rule configuration
for (p : $node->parents) {
if (p->type == 5 && (p->id==109031 || p->id==42342))
return true;
}What would be the best way to apply a template if the device is under specific containers?
Has someone used the new function isDirectParent(object)?
Thank you

-
chances are that adding
else { return false; }will fix the issue.
In overall you can use
trace(0, "your debug");
PollerTrace("your debug");
to debug what's happeing. First one adds to server log, the latter - to the output of poll messages when you do e.g. Configuration poll from node's context menu. -
In addition to what Filipp stated the screenshot attached does not actually match the code in the message. You simply have return; and not return true;. I would probably not include the return false; in an else clause either, but simply as the last statement so that anything falling through gets tagged like this.
-
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login