require 'win32ole' # Unbrowse SNMP Scripting Interface Demo # # # snpoll.rb - demonstrates polling (ruby version) # arguments snpoll.rb # --> You need to create an agent ahead of time # via the Unbrowse UI or scripting # # --------------------------------------------------------------- raise "USAGE: ruby #{$0} " unless ARGV.size == 2 agent_name = ARGV[0] get_this_oid = ARGV[1] agent_mgr = WIN32OLE.new("UnbrowseSNMP.AgentManager") getter = WIN32OLE.new("AtSnNovo.Snut") agent_mgr.Init getter.SetAgent(agent_mgr.FindAgent(agent_name)) 10.times do || p "Value is now " + getter.GetObjectValue(get_this_oid) sleep(2) end