class Fuey::Inspections::SNMPWalk

Attributes

agent[RW]
community[RW]
ip[RW]
oid[RW]
response[RW]
version[RW]

Public Class Methods

new(args) click to toggle source
Calls superclass method Fuey::ModelInitializer::new
# File lib/fuey_client/fuey/inspections/snmp_walk.rb, line 8
def initialize(args)
  super(args)
  @version ||= "v1"
  @community ||= "public"
  @status_message = ""
end

Public Instance Methods

_execute() click to toggle source
# 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() click to toggle source
# File lib/fuey_client/fuey/inspections/snmp_walk.rb, line 30
def settings
  snmp_walk_command || ""
end
status_message() click to toggle source
# File lib/fuey_client/fuey/inspections/snmp_walk.rb, line 25
def status_message
  return %(SNMPWalk #{state} #{snmp_walk_command}) if @response.nil? || passed?
  %(SNMPWalk #{state}. #{response})
end
to_s() click to toggle source
# File lib/fuey_client/fuey/inspections/snmp_walk.rb, line 34
def to_s
  snmp_walk_command
end

Private Instance Methods

snmp_walk_command() click to toggle source
# File lib/fuey_client/fuey/inspections/snmp_walk.rb, line 38
def snmp_walk_command
  %(snmpwalk -#{@version} -c #{@community} #{@agent} #{@oid})
end