lib/inspec/resources/service.rb
def monitored_by?(monitoring_tool)
      # Currently supported monitoring tools are: monit & god
      # To add support for new monitoring tools, extend the case statement with additional monitoring tool and
      # add the definition and logic in a new class (inheriting the base class MonitoringTool: optional)
      case monitoring_tool
      when "monit"
        current_monitoring_tool = Monit.new(inspec, @service_name)
      when "god"
        current_monitoring_tool = God.new(inspec, @service_name)
      else
        puts "The monitoring tool #{monitoring_tool} is not yet supported by InSpec."
      end
      current_monitoring_tool.is_service_monitored?
    end
# matcher to check if the service is monitored by the given monitoring tool/software
matcher to check if the service is monitored by the given monitoring tool/software
matcher to check if the service is monitored by the given monitoring tool / software
def monitored_by?(monitoring_tool)
      case monitoring_tool
      when "monit"
        current_monitoring_tool = Monit.new(inspec, @service_name)
      when "god"
        current_monitoring_tool = God.new(inspec, @service_name)
      else
        puts "The monitoring tool #{monitoring_tool} is not yet supported by InSpec."
      end
      current_monitoring_tool.is_service_monitored?
    end
def monitored_by? ( monitoring_tool ) case monitoring_tool when "monit" current_monitoring_tool = Monit . new ( inspec , @service_name ) when "god" current_monitoring_tool = God . new ( inspec , @service_name ) else puts "The monitoring tool #{monitoring_tool} is not yet supported by InSpec." end current_monitoring_tool . is_service_monitored? end
matcher to check if the service is monitored by the given monitoring tool/software
matcher to check if the service is monitored by the given monitoring tool / software
# Currently supported monitoring tools are: monit & god # To add support for new monitoring tools, extend the case statement with additional monitoring tool and # add the definition and logic in a new class (inheriting the base class MonitoringTool: optional)
monitoring_tool