Skip to main content
Solved

Display issue of service states in the Centreon Dashboard

  • May 15, 2024
  • 22 replies
  • 495 views

Forum|alt.badge.img+1
  • Steward *
  • 3 replies

Hello,

I'm encountering some issues with the Centreon dashboard.

When I create a dashboard and choose the "status grid" widget type, I notice that some services are in "warning," "critical," or "unknown" states within the dashboard.

 

 

However, in Centreon, all services seem to be in an "up" state.

 

Could you help me resolve this issue?

 

 

Best answer by Adrien Morais-Mestre

@z123 Perfect thanks.

You can modify the following file on your platform to patch the issue for the hosts.

/usr/share/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php

Line 437

https://github.com/centreon/centreon/blob/2d8a821678d0baf100cb4223afab0cdec0691912/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php#L437 you will have to add a condition to the SQL request

Replace this line
resources.type=1 AND resources.name NOT LIKE "_Module_%"

By
resources.type=1 AND resources.enabled=1 AND resources.name NOT LIKE "_Module_%"

Line 545

The exact same patch needs to be applied on line 545 https://github.com/centreon/centreon/blob/2d8a821678d0baf100cb4223afab0cdec0691912/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php#L545

@z123 @vc0 

 You can modify the following file on your platform to patch the issue for the services.

/usr/share/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php

Line 491

https://github.com/centreon/centreon/blob/2d8a821678d0baf100cb4223afab0cdec0691912/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php#L491 you will have to add a condition to the SQL request

Replace this line
resources.type=0 AND resources.name NOT LIKE "_Module_%"

By
resources.type=0 AND resources.enabled=1 AND resources.name NOT LIKE "_Module_%"

Line 601

The exact same patch needs to be applied on line 601 https://github.com/centreon/centreon/blob/2d8a821678d0baf100cb4223afab0cdec0691912/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php#L601

 

And that's it that should do the trick. @z123 @vc0 let me know it this fixed your problems.

Regards

22 replies

rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • 1141 replies
  • May 29, 2024

I believe this might be because the dashboard widgets do not properly filter out resources that are aknowledged or in downtime. Can you confirm the state of your critical services by clicking the 4 Critical tile?


Forum|alt.badge.img+1
  • Author
  • Steward *
  • 3 replies
  • June 3, 2024

Hello,

When I click on 4 critical, it redirects to this page.
 

 

I don't see any service in a critical state, I don't understand.
 


rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • 1141 replies
  • June 3, 2024

Would you mind sharing your SERVICES widget settings (a screenshot with both Widget Properties and Dataset Selection would be helpful as I really don’t see why this inconsistency)? 


Forum|alt.badge.img+1
  • Author
  • Steward *
  • 3 replies
  • June 4, 2024

Hello,

Here are the parameters for my Widget Service (host group AAP)

 

 


rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • 1141 replies
  • June 4, 2024

Thanks. When you mouse over the “4 critical” tile you should see the list of services in a tooltip. Do you see anything suspect here ? (services that were disabled or acknowledged or in downtime etc) ?


Forum|alt.badge.img+1
  • Author
  • Steward *
  • 3 replies
  • June 4, 2024

No, I have no information

 


Adrien Morais-Mestre
Centreonian
Forum|alt.badge.img+8

Hi @vc0 I've sent you a private message to gather some data to understand the issue.

Waiting for your answer 👍🏻

Regards


Forum|alt.badge.img+3
  • Steward *
  • 8 replies
  • June 7, 2024

Having the same problem but with hosts


Adrien Morais-Mestre
Centreonian
Forum|alt.badge.img+8

Hi @z123,

Do you mind executing a SQL request on the server ?
Could you please connect to the centreon_storage database and execute the following SQL request

-- Seek for disabled resources on the realtime context
SELECT id, name, status FROM resources WHERE enabled = 0 AND type = 1;

-- Seek for acknowledged or in downtime resources
SELECT id, name, status, acknowledged, in_downtime FROM resources WHERE type = 1;

Thank you

Regards
 


Forum|alt.badge.img+3
  • Steward *
  • 8 replies
  • June 11, 2024

Hello @Adrien Morais-Mestre,

here are the results pastebin.

Is this fine?

Thank you


Adrien Morais-Mestre
Centreonian
Forum|alt.badge.img+8

Hi @z123 thanks for the results.

That might confirm the diagnostic as I am looking a the code, disabled resources are not excluded from the computation for this widget.

What version are you currently running ? (I can provide a patch regarding the version used)

Regards


Forum|alt.badge.img+3
  • Steward *
  • 8 replies
  • June 11, 2024

@Adrien Morais-Mestre 

That would be great! Im running latest centreon 24.04.2 on el9


Adrien Morais-Mestre
Centreonian
Forum|alt.badge.img+8

@z123 Perfect thanks.

You can modify the following file on your platform to patch the issue for the hosts.

/usr/share/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php

Line 437

https://github.com/centreon/centreon/blob/2d8a821678d0baf100cb4223afab0cdec0691912/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php#L437 you will have to add a condition to the SQL request

Replace this line
resources.type=1 AND resources.name NOT LIKE "_Module_%"

By
resources.type=1 AND resources.enabled=1 AND resources.name NOT LIKE "_Module_%"

Line 545

The exact same patch needs to be applied on line 545 https://github.com/centreon/centreon/blob/2d8a821678d0baf100cb4223afab0cdec0691912/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php#L545

@z123 @vc0 

 You can modify the following file on your platform to patch the issue for the services.

/usr/share/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php

Line 491

https://github.com/centreon/centreon/blob/2d8a821678d0baf100cb4223afab0cdec0691912/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php#L491 you will have to add a condition to the SQL request

Replace this line
resources.type=0 AND resources.name NOT LIKE "_Module_%"

By
resources.type=0 AND resources.enabled=1 AND resources.name NOT LIKE "_Module_%"

Line 601

The exact same patch needs to be applied on line 601 https://github.com/centreon/centreon/blob/2d8a821678d0baf100cb4223afab0cdec0691912/centreon/src/Core/Resources/Infrastructure/Repository/DbReadResourceRepository.php#L601

 

And that's it that should do the trick. @z123 @vc0 let me know it this fixed your problems.

Regards


Forum|alt.badge.img+3
  • Steward *
  • 8 replies
  • June 13, 2024

Awesome @Adrien Morais-Mestre this really fixed the issue but I wonder is this a workaround which will be overwritten after next update or is it a patch which will be applied next version update?

Much appreciate your help, thank you!


Adrien Morais-Mestre
Centreonian
Forum|alt.badge.img+8

@z123 Hi,

You're welcome glad the patch worked for you as well !

This patch might not land on the next release. I have to check this with the release manager and let you know

Regards


Forum|alt.badge.img+7
  • Steward ***
  • 26 replies
  • August 2, 2024

Also the same problem. I am speechless, dashboards are meant to replace views. But on this most basic widget we are forced to modify code ... What is your QA doing?


rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • 1141 replies
  • August 2, 2024

I am confused why you have to modify code. As @Adrien Morais-Mestre said we did issue a patch for this (see https://docs.centreon.com/docs/releases/centreon-os/#24045).


Forum|alt.badge.img+7
  • Steward ***
  • 26 replies
  • August 2, 2024

ok i m on 24.04.4, i upgrade


Forum|alt.badge.img+7
  • Steward ***
  • 26 replies
  • August 30, 2024

This problem is resolved in 24.04.5 but subsiste an anomaly when trying to filter on host groups regardless of the type of widget used. Will it be fixed in 24.04.6 ?


rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • 1141 replies
  • September 2, 2024

Can you please describe the issue you are facing with host group filters?


Forum|alt.badge.img+7
  • Steward ***
  • 26 replies
  • September 2, 2024

No matter what restriction on a selected host group, it always shows me all the Hosts.


rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • 1141 replies
  • September 2, 2024

I don’t see this on my platform and that is not a known issue. Best is probably to create a ticket on the support portal so it can be investigated.