Class: CfnGuardian::Models::NrpeEvent

Inherits:
BaseEvent
  • Object
show all
Defined in:
lib/cfnguardian/models/event.rb

Instance Attribute Summary

Attributes inherited from BaseEvent

#cron, #enabled, #environment, #group, #hash, #name, #resource, #ssm_parameters, #target, #type

Instance Method Summary collapse

Constructor Details

#initialize(resource, environment, command) ⇒ NrpeEvent

Returns a new instance of NrpeEvent.



150
151
152
153
154
155
156
157
158
159
160
# File 'lib/cfnguardian/models/event.rb', line 150

def initialize(resource,environment,command)
  super(resource)
  @group = 'Nrpe'
  @name = 'NrpeEvent'
  @target = "NrpeCheckFunction#{environment}"
  @host = resource['Id']
  @environment = environment
  @region = resource.fetch('Region',"${AWS::Region}")
  @hash = Digest::MD5.hexdigest "#{resource['Id']}#{command}"
  @command = command
end

Instance Method Details

#payloadObject



162
163
164
165
166
167
168
169
# File 'lib/cfnguardian/models/event.rb', line 162

def payload
  return {
    'host' => @host,
    'environment' => @environment,
    'region' => @region,
    'cmd' => @command
  }.to_json
end