diff --git a/app/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/stream.rb b/app/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/stream.rb index 9694967e3e..1e803a3c17 100755 --- a/app/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/stream.rb +++ b/app/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/stream.rb @@ -1,4 +1,5 @@ class ManageIQ::Providers::Lenovo::PhysicalInfraManager::EventCatcher::Stream + require 'json' # Creates an event monitor # def initialize(ems) @@ -29,10 +30,18 @@ def event_monitor_handle private + def filter_fields + [ + { :operation => 'GT', :field => 'cn', :value => get_last_cnn_from_events(@ems.id).to_s }, + { :operation => 'NOT', :field => 'eventClass', :value => '200' }, + { :operation => 'NOT', :field => 'eventClass', :value => '800' } + ] + end + def events - expression = '{"filterType":"FIELDNOTREGEXAND","fields":["operation":"GT","field":"cn","value":"' + get_last_cnn_from_events(@ems.id).to_s + '"]}' + expression = { :filterType => 'FIELDNOTREGEXAND', :fields => filter_fields } - opts = {'filterWith' => expression} + opts = {'filterWith' => expression.to_json} @event_monitor_handle.fetch_events opts end