' -------------------------------------------------- ' snpoll - Demonstrates polling using the Unbrowse SNMP ' scripting interface ' ' arguments = agent-name, oid ' ' You have to create the agent first via the ' Unbrowse user interface and set all security ' parameters there ' ' -------------------------------------------------- Set Sout = WScript.StdOut ' -------------------------------------------------- ' Check usage & arguments ' -------------------------------------------------- if WScript.Arguments.Count <> 2 then Sout.WriteLine "Usage: sng " Sout.WriteLine "Example: cscript sng.vbs MyAgent .1.3.6.1.2.1.1.3.0 " WScript.Quit end if AgentName = WScript.Arguments.Item(0) GetThisOID = WScript.Arguments.Item(1) Set AgentMgr = CreateObject("UnbrowseSNMP.AgentManager") Set Getter = CreateObject("AtSnNovo.Snut") AgentMgr.Init Set Agent = AgentMgr.FindAgent(AgentName) Sout.WriteLine "Agent = " & Agent.IPAddress Getter.SetAgent Agent For I = 0 To 10 oval = Getter.GetObjectValue(GetThisOID) Sout.WriteLine "Value = " & oval WScript.Sleep(1000) Next