' ' ptrapinfo - Prints details about all trap/notification ' objects in a MIB module ' ' Usage : ptrapinfo MODULE-NAME ' -------------------------------------------------- ' Check usage & arguments ' -------------------------------------------------- Set Sout = WScript.StdOut if WScript.Arguments.Count <> 1 then Sout.WriteLine "Usage: ptrapinfo MODULE-NAME" Sout.WriteLine "Example: ptrapinfo CISCO-VISM-TRAPS-MIB " WScript.Quit end if Modname = WScript.Arguments.Item(0) ' -------------------------------------------------- ' Create and load repository ' -------------------------------------------------- Set RepMgr = CreateObject("UnbrowseSNMP.RepositoryManager") RepMgr.LoadRepositoryReadOnly Set ModuleInfo = RepMgr.GetGlobalRepEntry(Modname) Sout.WriteLine "Found Module in " & ModuleInfo.PathURI ' -------------------------------------------------- ' Load this module into a MIB browser object ' -------------------------------------------------- Set MIBBrowser = CreateObject("UnbrowseSNMP.MIBBrowser") Set MIBModule = MIBBrowser.Open(ModuleInfo.PathURI) ' Print all nodes of type NOTIFICATION (5) For Each Child in MIBModule.ChildNodes If Child.NodeType = 5 Then PrintNode(Child) End If Next MIBBrowser = Nil RepMgr=Nil '---------------------------------------------------- ' Print Node - many details about the node '---------------------------------------------------- Sub PrintNode ( Node ) Sout.WriteLine "OID = " & Node.OID Sout.WriteLine "Name = " & Node.Name Sout.WriteLine "OIDName = " & Node.OIDName Sout.WriteLine "Type = " & Node.NodeType Sout.WriteLine "Access = " & Node.Access Sout.WriteLine "Status = " & Node.Status Set nt = Node.Type If Not nt Is Nothing Then Sout.WriteLine "----Type------" Sout.WriteLine "Type = " & nt.Name End If Sout.WriteLine "----Description------" Sout.WriteLine Node.Description End Sub