centreon-archived icon indicating copy to clipboard operation
centreon-archived copied to clipboard

fix(UI): Include host_id when selecting ServiceGroups on dashboard reports

Open vhsantos opened this issue 2 years ago • 4 comments

Description

Reporting > Dashboard > Service Groups show a wrong output if we have a service linked with more than one host. That is because the SQL are "grouping" all the services_ids ignoring if the host_id is different or not.

Type of change

  • [X] Patch fixing an issue (non-breaking change)
  • [ ] New functionality (non-breaking change)
  • [ ] Breaking change (patch or feature) that might cause side effects breaking part of the Software
  • [ ] Updating documentation (missing information, typo...)

Target serie

  • [ ] 21.04.x
  • [X] 21.10.x
  • [X] 22.04.x
  • [X] 22.10.x (master)

How this pull request can be tested ?

  1. Create 02 hosts
  2. Create a Service by host
  3. On the field "Linked with Hosts" select the 02 hosts that you have created.
  4. Create a Services Group and select the 02 services that you have created.
  5. Apply the changes
  6. Go to Reporting > Dashboard > Service Groups select the Service Group that you have created.

Actual SQL result

+---------+------------+--------+------+-----------+-----------+-----------+-----------+------------+------------+----------------+---------------+
| host_id | service_id | OK_T   | OK_A | WARNING_T | WARNING_A | UNKNOWN_T | UNKNOWN_A | CRITICAL_T | CRITICAL_A | UNDETERMINED_T | MAINTENANCE_T |
+---------+------------+--------+------+-----------+-----------+-----------+-----------+------------+------------+----------------+---------------+
|      89 |       1302 | 345600 |    0 |         0 |         0 |         0 |         0 |          0 |          0 |              0 |             0 |
+---------+------------+--------+------+-----------+-----------+-----------+-----------+------------+------------+----------------+---------------+

Expected SQL result

+---------+------------+-------+------+-----------+-----------+-----------+-----------+------------+------------+----------------+---------------+
| host_id | service_id | OK_T  | OK_A | WARNING_T | WARNING_A | UNKNOWN_T | UNKNOWN_A | CRITICAL_T | CRITICAL_A | UNDETERMINED_T | MAINTENANCE_T |
+---------+------------+-------+------+-----------+-----------+-----------+-----------+------------+------------+----------------+---------------+
|      70 |       1302 | 86400 |    0 |         0 |         0 |         0 |         0 |          0 |          0 |              0 |             0 |
|      84 |       1302 | 86400 |    0 |         0 |         0 |         0 |         0 |          0 |          0 |              0 |             0 |
|      88 |       1302 | 86400 |    0 |         0 |         0 |         0 |         0 |          0 |          0 |              0 |             0 |
|      89 |       1302 | 86400 |    0 |         0 |         0 |         0 |         0 |          0 |          0 |              0 |             0 |
+---------+------------+-------+------+-----------+-----------+-----------+-----------+------------+------------+----------------+---------------+

Checklist

  • [X] I have followed the coding style guidelines provided by Centreon
  • [ ] I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • [ ] I have commented my code, especially hard-to-understand areas of the PR.
  • [ ] I have made corresponding changes to the documentation.
  • [ ] I have rebased my development branch on the base branch (master, maintenance).

vhsantos avatar Apr 08 '22 11:04 vhsantos

Hello @TamazC @adr-mo ,

any possibility to merge this small PR ?

vhsantos avatar Apr 27 '22 09:04 vhsantos

Hello there @adr-mo and @TamazC ... any possibility to approve and merge this small PR ??

vhsantos avatar May 30 '22 18:05 vhsantos

Dear @vhsantos we added this in backlog (internal ticket MON-14325). Thank you!

lpinsivy avatar Jul 13 '22 14:07 lpinsivy

This PR is cloned in #11428 with is merged. So I'll close this PR

Thank you @vhsantos for contribution

TamazC avatar Sep 05 '22 07:09 TamazC