Sha256: d088e917093ab5ed15dce4cc604b3eac16e03cc2373a233f11fa1dd75425e017
Contents?: true
Size: 1.11 KB
Versions: 35
Compression:
Stored size: 1.11 KB
Contents
require 'digest/md5' require 'cfnguardian/string' module CfnGuardian::Resource class Nrpe < Base def initialize(resource) super(resource) @resource_list = resource['Hosts'] @environment = resource['Environment'] end def default_alarms() @resource_list.each do |host| host['Commands'].each do |command| alarm = CfnGuardian::Models::NrpeAlarm.new(host,@environment) alarm.name = "#{command.to_camelcase}Warning" alarm.metric_name = command @alarms.push(alarm) alarm = CfnGuardian::Models::NrpeAlarm.new(host,@environment) alarm.name = "#{command.to_camelcase}Critical" alarm.metric_name = command @alarms.push(alarm) end end end def default_events() @resource_list.each do |host| host['Commands'].each do |command| @events.push(CfnGuardian::Models::NrpeEvent.new(host,@environment,command)) end end end def default_checks() @checks.push(CfnGuardian::Models::NrpeCheck.new(@resource)) end end end
Version data entries
35 entries across 35 versions & 1 rubygems