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.
164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/cfnguardian/models/event.rb', line 164 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
176 177 178 179 180 181 182 183 |
# File 'lib/cfnguardian/models/event.rb', line 176 def payload return { 'host' => @host, 'environment' => @environment, 'region' => @region, 'cmd' => @command }.to_json end |