Class: Sloe::Common
- Inherits:
-
Netconf::SSH
- Object
- Netconf::SSH
- Sloe::Common
- Defined in:
- lib/sloe/common.rb
Overview
Base class. Inherits from Netconf::SSH
Instance Attribute Summary collapse
-
#logging ⇒ Object
Returns the value of attribute logging.
-
#snmp ⇒ Object
readonly
Provides access to the SNMP object.
Instance Method Summary collapse
-
#initialize(args, &block) ⇒ Common
constructor
Create Sloe::Common object.
Constructor Details
#initialize(args, &block) ⇒ Common
Create Sloe::Common object. Accepts arguments for Netconf::SSH#new and SNMP::Manager#new
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sloe/common.rb', line 14 def initialize(args, &block) @snmp_args = { :host => args[:target], :mib_dir => args[:mib_dir], :mib_modules => args[:mib_modules], :community => args[:community] } @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) self.open self end end |
Instance Attribute Details
#logging ⇒ Object
Returns the value of attribute logging.
10 11 12 |
# File 'lib/sloe/common.rb', line 10 def logging @logging end |
#snmp ⇒ Object (readonly)
Provides access to the SNMP object
9 10 11 |
# File 'lib/sloe/common.rb', line 9 def snmp @snmp end |