Class: Snmpjr::TargetV2C

Inherits:
Object
  • Object
show all
Defined in:
lib/snmpjr/target_v2c.rb

Instance Method Summary collapse

Instance Method Details

#create(configuration) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/snmpjr/target_v2c.rb', line 7

def create configuration
  target = Snmpjr::Wrappers::CommunityTarget.new
  target.community = Snmpjr::Wrappers::SMI::OctetString.new(configuration.community)
  target.address = Snmpjr::Wrappers::SMI::GenericAddress.parse("udp:#{configuration.host}/#{configuration.port}")
  target.version = Snmpjr::Version::V2C
  target.retries = configuration.retries
  target.timeout = configuration.timeout
  target
end