Class: Fuey::Inspections::SNMPWalk
- Inherits:
-
Inspection
- Object
- Inspection
- Fuey::Inspections::SNMPWalk
- Defined in:
- lib/fuey_client/fuey/inspections/snmp_walk.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
Returns the value of attribute agent.
-
#community ⇒ Object
Returns the value of attribute community.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#oid ⇒ Object
Returns the value of attribute oid.
-
#response ⇒ Object
Returns the value of attribute response.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from Inspection
Instance Method Summary collapse
- #_execute ⇒ Object
-
#initialize(args) ⇒ SNMPWalk
constructor
A new instance of SNMPWalk.
- #settings ⇒ Object
- #status_message ⇒ Object
- #to_s ⇒ Object
Methods inherited from Inspection
#failed?, #notify, #passed?, #status
Constructor Details
#initialize(args) ⇒ SNMPWalk
Returns a new instance of SNMPWalk.
8 9 10 11 12 13 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 8 def initialize(args) super(args) @version ||= "v1" @community ||= "public" @status_message = "" end |
Instance Attribute Details
#agent ⇒ Object
Returns the value of attribute agent.
6 7 8 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 6 def agent @agent end |
#community ⇒ Object
Returns the value of attribute community.
6 7 8 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 6 def community @community end |
#ip ⇒ Object
Returns the value of attribute ip.
6 7 8 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 6 def ip @ip end |
#oid ⇒ Object
Returns the value of attribute oid.
6 7 8 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 6 def oid @oid end |
#response ⇒ Object
Returns the value of attribute response.
6 7 8 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 6 def response @response end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 6 def version @version end |
Instance Method Details
#_execute ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 15 def _execute @response = Support::ShellCommand.new(snmp_walk_command).execute result = (response =~ /#{ip}/) if result self.pass else self.fail end end |
#settings ⇒ Object
30 31 32 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 30 def settings snmp_walk_command || "" end |
#status_message ⇒ Object
25 26 27 28 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 25 def return %(SNMPWalk #{state} #{snmp_walk_command}) if @response.nil? || passed? %(SNMPWalk #{state}. #{response}) end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/fuey_client/fuey/inspections/snmp_walk.rb', line 34 def to_s snmp_walk_command end |