Question about discovery w/ filter
-
Hello,
I am new to writing scripts for discovery and have that down ok... but I am looking for a way to also filter the interfaces if they are not active.
In this case, I have a sonicwall I wish to monitor, but I don't need to see all the ports not in use. They all show UP because they use PortShields which connect all the ports in an UP fashion, so I wanted to filter on MTU which in SNMP shows zero on all the ports I wish to ignore.
My SNMP DCI looks like this:
Param: .1.3.6.1.2.1.31.1.1.1.10.{instance}
Discovery (OID): .1.3.6.1.2.1.2.2.1.1Discovery Filter:
transport = CreateSNMPTransport($node); if (transport == null) return false; // get the interface name to return as instance-name vb = SNMPGet(transport, ".1.3.6.1.2.1.31.1.1.1.1." . $1); if (vb == null) return false; // filter out loopback if (vb->value == "lo") return false; return %(true, $1, vb->value);I know MTU is pulled in and stored with the interfaces, but not sure how to filter in the discovery script I have so far.
Like I said, pretty new at this and just getting my hands dirty.... so any help would be greatly appreciated!
-
Hi,
knowing interface index you can use function GetInterfaceObject($node, index) to get interface object, and then read it's property "mtu". Alternative approach could be to send SNMP request for .1.3.6.1.2.1.2.2.1.4.{instance} as you do for interface name.
Best regards,
Victor -
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