Get node object in the Discovery Filter Script
-
I'm trying to filter out specific ip from network discovery using the filter script, but i can't get the ipaddress of the DiscoveryNode object.
Did i miss something?tracelevel=0; trace(tracelevel, "======= Filter::NetworkDiscovery =========="); trace(tracelevel,$1->ipAddress); trace(tracelevel,$node->ipAddress); trace(tracelevel,$1.ipAddress); trace(tracelevel,$node.ipAddress); trace(tracelevel,$1->ipAddr); trace(tracelevel,$node->ipAddr); trace(tracelevel,$1.ipAddr); trace(tracelevel,$node.ipAddr); //trace(tracelevel,$1->snmpOID); if ($1->ipAddress.address ~= "^172\.2\d\.1\.1") { trace(tracelevel, "== Filtered out from discovery =="); trace(tracelevel, $1->ipAddr); return false; }Output:
2025.03.26 08:51:13.767 *I* [nxsl.trace ] ======= Filter::NetworkDiscovery ========== 2025.03.26 08:51:13.772 *I* [nxsl.trace ] UNSPEC 2025.03.26 08:51:13.772 *I* [nxsl.trace ] UNSPEC 2025.03.26 08:51:13.772 *I* [nxsl.trace ] UNSPEC 2025.03.26 08:51:13.772 *I* [nxsl.trace ] UNSPEC 2025.03.26 08:51:13.772 *I* [nxsl.trace ] UNSPEC 2025.03.26 08:51:13.772 *I* [nxsl.trace ] UNSPEC 2025.03.26 08:51:13.772 *I* [nxsl.trace ] UNSPEC 2025.03.26 08:51:13.772 *I* [nxsl.trace ] UNSPEC -
That's a bug, fix will be in v. 5.2 which should be out quite soon
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