class Sloe::Common

Inherits from {rubydoc.info/gems/netconf/Netconf/SSH Netconf::SSH}

Attributes

logging[RW]
snmp[R]

Provides access to the SNMP object

Public Class Methods

new(args, &block) click to toggle source

Create Sloe::Common object. Accepts arguments for {rubydoc.info/gems/netconf/Netconf/SSH:initialize Netconf::SSH#new} {rubydoc.info/gems/snmp/SNMP/Manager:initialize SNMP::Manager#new}

Calls superclass method
# File lib/sloe/common.rb, line 15
def initialize(args, &block)
  @snmp_args = {
    host:        args[:target],
    mib_dir:     args[:mib_dir],
    mib_modules: args[:mib_modules],
    community:   args[:community],
    port:        args[:snmp_port]
  }
  @snmp = SNMP::Manager.new(@snmp_args)

  # logging of RPCs is optional. If arguments are provided then
  # they must be needed/enabled. This also requires extending
  # Netconf::RPC::Executor.method_missing(), which is done below
  self.logging = args[:logging]

  if block_given?
    super(args, &block)
    return
  else
    super(args)
    open
    self
  end
end