Forum: Ruby undefined method `Gauge' for SNMPSET:Class (NoMethodError)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
62ad59948dc76c7215de8fd9a2021af3?d=identicon&s=25 Chandra Sekhar (chandrasekhar29)
on 2013-03-19 13:18
Hi,

Does anybody have an idea how to SET a snmp gauge OID? My code sample is
as follows

host = '192.168.10.10'
community = 'tenant'

userID_OID = '1.3.6.1.4.1.9344.100.107.13.1.0'
password_OID = '1.3.6.1.4.1.9344.100.107.13.2.0'

SNMP::Manager.open( :Host => hpbsmiIP,
                    :Community => community) do |manager|
                userID = VarBind.new(userID_OID,
OctetString.new('admin'))
                manager.set(userID)
                pass = VarBind.new(password_OID,
OctetString.new('admin@333'))
                manager.set(pass)
              end


manager = Manager.new(:Host => hpbsmiIP, :Community => community)
varbind = VarBind.new("1.3.6.1.4.1.9344.100.107.1.4.0", Gauge('1'))
manager.set(varbind)


Thanks in advance
This topic is locked and can not be replied to.