Bug 1655508 - Search filters not working as expected on Satellite Dashboard.
Summary: Search filters not working as expected on Satellite Dashboard.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Dashboard
Version: 6.4
Hardware: All
OS: Linux
unspecified
medium vote
Target Milestone: 6.6.0
Assignee: satellite6-bugs
QA Contact: Radovan Drazny
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-03 10:35 UTC by maneesh verma
Modified: 2019-11-04 13:34 UTC (History)
8 users (show)

Fixed In Version: foreman-1.22.0-0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 19:48:10 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3728781 None None None 2018-12-18 02:49:47 UTC

Description maneesh verma 2018-12-03 10:35:09 UTC
Description of problem:

The two reports in Host COnfiguration status widget of Dashboard are not working fine.

1- Last seen reports.
2- Hosts with Alert disabled

How reproducible:

Every time we click on Host COnfiguration Status for Puppet and Ansible Widget.

Report names- Host with no reports and Hosts with alerts disabled.

Steps to Reproduce:
1. Click on the widget shows Hosts with No reports.

It will search with Query- origin = Puppet and last_report > "35 minutes ago" and not has last_report and status.enabled = true

2. Click on the Widget Hosts with alert disabled.

it will search with query - last_report > "30 minutes ago" and status.enabled = false


Actual results:

The query fails to get the proper results and shows no hostnames.

If we remote the time interval the search works fine.


Expected results:

The search should show the correct result.




Additional info:

Impacted code.

/usr/share/foreman/app/helpers/dashboard_helper.rb:
  def search_filter_with_origin(filter, origin, within_interval = false)
    interval_setting = report_origin_interval_setting(origin)
    additional_filters = []
    additional_filters << "origin = #{origin}" if origin
    additional_filters << "last_report #{within_interval ? '<' : '>'} \"#{interval_setting} minutes ago\"" if out_of_sync_enabled?(origin)
    (additional_filters + [filter]).join(' and ')
  end

Comment 8 Radovan Drazny 2019-07-17 11:23:04 UTC
Verified on Sat 6.6 Snap 11. Dasboard widgets for Ansible, Puppet and All Hosts contain following queries:

Ansible
Hosts with no reports: origin = Ansible and not has last_report and status.enabled = true
Hosts with alerts disabled: origin = Ansible and status.enabled = false

Puppet
Hosts with no reports: origin = Puppet and not has last_report and status.enabled = true
Hosts with alerts disabled: origin = Puppet and status.enabled = false

All
Hosts with no reports: not has last_report and status.enabled = true
Hosts with alerts disabled: status.enabled = false

Comment 9 Bryan Kearney 2019-10-22 19:48:10 UTC
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/RHSA-2019:3172


Note You need to log in before you can comment on or make changes to this bug.