Class: NewRelic::Security::Agent::Control::EventSubscriber
- Inherits:
-
Object
- Object
- NewRelic::Security::Agent::Control::EventSubscriber
- Defined in:
- lib/newrelic_security/agent/control/event_subscriber.rb
Instance Method Summary collapse
-
#initialize ⇒ EventSubscriber
constructor
A new instance of EventSubscriber.
Constructor Details
#initialize ⇒ EventSubscriber
Returns a new instance of EventSubscriber.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/newrelic_security/agent/control/event_subscriber.rb', line 5 def initialize ::NewRelic::Agent.instance.events.subscribe(:server_source_configuration_added) { NewRelic::Security::Agent.logger.info "NewRelic server_source_configuration_added for pid : #{Process.pid}, Parent Pid : #{Process.ppid}" NewRelic::Security::Agent.init_logger.info "NewRelic server_source_configuration_added for pid : #{Process.pid}, Parent Pid : #{Process.ppid}" NewRelic::Security::Agent.config.update_server_config if NewRelic::Security::Agent.config[:'security.enabled'] && !NewRelic::Security::Agent.config[:high_security] NewRelic::Security::Agent.agent.event_processor&.event_dequeue_threads&.each { |t| t&.kill } NewRelic::Security::Agent.agent.event_processor = nil @csec_agent_main_thread&.kill @csec_agent_main_thread = nil @csec_agent_main_thread = Thread.new { NewRelic::Security::Agent.agent.scan_scheduler.init_via_scan_scheduler } else NewRelic::Security::Agent.logger.info "New Relic Security is disabled by one of the user provided config `security.enabled` or `high_security`." NewRelic::Security::Agent.init_logger.info "New Relic Security is disabled by one of the user provided config `security.enabled` or `high_security`." end } end |