Backported to Hammer branch: commit eda8fff024370a0b9fc5893ee36109e50e820c76 Author: Nick Carboni <ncarboni> Date: Tue Jan 8 14:14:30 2019 -0500 Merge pull request #18340 from jrafanie/restore_app_log_usage_event Restore an event for the main app logs' disk usage (cherry picked from commit bc8fadc2ab4dae94b4f0016afb49a7a98db77faa) https://bugzilla.redhat.com/show_bug.cgi?id=1672698
Based on this comment: "hey @rspagnola, I'm going to restore the original event name, evm_server_log_disk_high_usage, so it's slightly different than what I put in your appliance The underlying description will match what's in the docs though" I am marking this as verified. Steps of verification: 1. Go to Control > Explorer > Alerts 2. Configuration > Add new alert 3. Based on = Server 4. What to evaluate = Expression (Custom) 5. Driving Event = "Appliance Operation: Server High /var/www/miq/vmdb/log Disk Usage" 6. Assign the alert to a Alert Profile 7. Assign the Alert Profile to the Server 8. In advanced config, changed: events: :disk_usage_gt_percent: 80 to: events: :disk_usage_gt_percent: 1 So that the alert would fire instantly. Verified that the Alert appeared in the logs, and the events were in the DB: [----] I, [2019-02-12T13:12:01.859665 #14284:47ef64] INFO -- : Q-task_id([log_status]) MIQ(MiqAeEngine.deliver) Delivering {:event_type=>"evm_server_var_log_disk_high_usage", :event_details=>"Filesystem: /dev/mapper/VG--CFME-lv_var_log (xfs) on /var/log is 5% full with 973 MB free.", "MiqEvent::miq_event"=>67, :miq_event_id=>67, "EventStream::event_stream"=>67, :event_stream_id=>67} for object [MiqServer.1] with state [] to Automate [----] I, [2019-02-12T13:12:02.054880 #14284:47ef64] INFO -- : Q-task_id([log_status]) MIQ(MiqEvent#process_evm_event) Event Raised [evm_server_var_log_disk_high_usage] [----] I, [2019-02-12T13:12:02.071233 #14284:47ef64] INFO -- : Q-task_id([log_status]) MIQ(MiqEvent#process_evm_event) Alert for Event [evm_server_var_log_disk_high_usage] [----] I, [2019-02-12T13:12:02.071398 #14284:47ef64] INFO -- : Q-task_id([log_status]) MIQ(MiqAlert.evaluate_alerts) [evm_server_var_log_disk_high_usage] Target: MiqServer Name: [EVM], Id: [1] I think a user might be confused by the fact that there are two Driving Events that will display the same event name (i.e. "Appliance Operation: Server High /var/log Disk Usage" and "Appliance Operation: Server /var/www/miq/vmdb/log Disk Usage"). Thoughts on this? Maybe on or the other could be disabled in the dropdown menu for "Driving Event".
Hi John, thanks for testing this. 1) evm_server_var_log_disk_high_usage "Server High /var/log Disk Usage" 2) evm_server_var_log_audit_disk_high_usage "Server High /var/log/audit Disk Usage" 3) evm_server_log_disk_high_usage "Server High /var/www/miq/vmdb/log Disk Usage" Those 3 events have similarly named but different descriptions and have different driving events. We have mount points at different locations that could be independently low on space: /var/log /var/log/audit /var/www/miq/vmdb/log
Thanks for the info Joe, if that is the case, then the event I'm seeing is not the correct one. I am seeing "evm_server_var_log_disk_high_usage" and not "evm_server_log_disk_high_usage". Let me test again to make sure.
Here's the relevant code that checks the mount point and raises the hopefully correct event: https://github.com/ManageIQ/manageiq/blob/d4e8a96410df1c508c9451e1588af4cff0bd4e77/app/models/miq_server/environment_management.rb#L107-L110
Marking as verified after copying a large enough file over to trigger the alert. The correct event: "evm_server_log_disk_high_usage" is seen in both the DB and logs. Paste from the log: : [], Data: [], Args: [{:object_type=>"MiqServer", :object_id=>1, :attrs=>{:event_type=>"evm_server_log_disk_high_usage", :event_details=>"Filesystem: /dev/mapper/VG--CFME-lv_log (xfs) on /var/www/miq/vmdb/log is 11% full with 8.94 GB free.", "MiqEvent::miq_event"=>162, :miq_event_id=>162, "EventStream::event_stream"=>162, :event_stream_id=>162}, :instance_name=>"Event", :user_id=>1, :miq_group_id=>2, :tenant_id=>1, :automate_message=>nil}] [----] I, [2019-02-12T14:32:20.443615 #14292:47ef64] INFO -- : MIQ(MiqPriorityWorker::Runner#get_message_via_drb) Message id: [1460], MiqWorker id: [21], Zone: [default], Role: [automate], Server: [], MiqTask id: [], Ident: [generic], Target id: [], Instance id: [], Task id: [], Command: [MiqAeEngine.deliver], Timeout: [3600], Priority: [20], State: [dequeue], Deliver On: [], Data: [], Args: [{:object_type=>"MiqServer", :object_id=>1, :attrs=>{:event_type=>"evm_server_log_disk_high_usage", :event_details=>"Filesystem: /dev/mapper/VG--CFME-lv_log (xfs) on /var/www/miq/vmdb/log is 11% full with 8.94 GB free.", "MiqEvent::miq_event"=>162, :miq_event_id=>162, "EventStream::event_stream"=>162, :event_stream_id=>162}, :instance_name=>"Event", :user_id=>1, :miq_group_id=>2, :tenant_id=>1, :automate_message=>nil}], Dequeued in: [5.023204822] seconds [----] I, [2019-02-12T14:32:20.448857 #14292:47ef64] INFO -- : Q-task_id([log_status]) MIQ(MiqAeEngine.deliver) Delivering {:event_type=>"evm_server_log_disk_high_usage", :event_details=>"Filesystem: /dev/mapper/VG--CFME-lv_log (xfs) on /var/www/miq/vmdb/log is 11% full with 8.94 GB free.", "MiqEvent::miq_event"=>162, :miq_event_id=>162, "EventStream::event_stream"=>162, :event_stream_id=>162} for object [MiqServer.1] with state [] to Automate [----] I, [2019-02-12T14:32:20.662108 #14292:47ef64] INFO -- : Q-task_id([log_status]) MIQ(MiqEvent#process_evm_event) Event Raised [evm_server_log_disk_high_usage] [----] I, [2019-02-12T14:32:20.675646 #14292:47ef64] INFO -- : Q-task_id([log_status]) MIQ(MiqEvent#process_evm_event) Alert for Event [evm_server_log_disk_high_usage] [----] I, [2019-02-12T14:32:20.675761 #14292:47ef64] INFO -- : Q-task_id([log_status]) MIQ(MiqAlert.evaluate_alerts) [evm_server_log_disk_high_usage] Target: MiqServer Name: [EVM], Id: [1] [----] I, [2019-02-12T14:32:20.701998 #14292:47ef64] INFO -- : Q-task_id([log_status]) MIQ(MiqAlert.evaluate_alerts) [evm_server_log_disk_high_usage] Target: MiqServer Name: [EVM], Id: [1] Queuing evaluation of Alert: [test BZ 1672698] [----] I, [2019-02-12T14:32:20.725869 #14292:47ef64] INFO -- : Q-task_id([log_status]) MIQ(MiqQueue.put) Message id: [1461], id: [], Zone: [default], Role: [], Server: [], MiqTask id: [], Ident: [generic], Target id: [], Instance id: [30], Task id: [], Command: [MiqAlert.evaluate], Timeout: [600], Priority: [100], State: [ready], Deliver On: [], Data: [], Args: [["MiqServer", 1], {:type=>"MiqServer", :triggering_type=>"evm_server_log_disk_high_usage", :triggering_data=>nil}] [----] I, [2019-02-12T14:32:26.682033 #14275:47ef64] INFO -- : MIQ(MiqGenericWorker::Runner#get_message_via_drb) Message id: [1461], MiqWorker id: [19], Zone: [default], Role: [], Server: [], MiqTask id: [], Ident: [generic], Target id: [], Instance id: [30], Task id: [], Command: [MiqAlert.evaluate], Timeout: [600], Priority: [100], State: [dequeue], Deliver On: [], Data: [], Args: [["MiqServer", 1], {:type=>"MiqServer", :triggering_type=>"evm_server_log_disk_high_usage", :triggering_data=>nil}], Dequeued in: [5.972952346] seconds
New commit detected on ManageIQ/manageiq/hammer: https://github.com/ManageIQ/manageiq/commit/eda8fff024370a0b9fc5893ee36109e50e820c76 commit eda8fff024370a0b9fc5893ee36109e50e820c76 Author: Nick Carboni <ncarboni> AuthorDate: Tue Jan 8 14:14:30 2019 -0500 Commit: Nick Carboni <ncarboni> CommitDate: Tue Jan 8 14:14:30 2019 -0500 Merge pull request #18340 from jrafanie/restore_app_log_usage_event Restore an event for the main app logs' disk usage (cherry picked from commit bc8fadc2ab4dae94b4f0016afb49a7a98db77faa) https://bugzilla.redhat.com/show_bug.cgi?id=1672698 app/models/miq_server/environment_management.rb | 19 +- db/fixtures/miq_event_definitions.csv | 1 + spec/models/miq_server/environment_manager_spec.rb | 30 +- 3 files changed, 34 insertions(+), 16 deletions(-)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0453