Class: CfnGuardian::Models::NrpeEvent
- 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
-
#initialize(resource, environment, command) ⇒ NrpeEvent
constructor
A new instance of NrpeEvent.
- #payload ⇒ Object
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
#payload ⇒ Object
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 |