Skip to main content

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?

 

 

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?


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.
 


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)? 


Hello,

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

 

 


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) ?


No, I have no information

 


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

Waiting for your answer 👍🏻

Regards


Having the same problem but with hosts


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
 


Hello @Adrien Morais-Mestre,

here are the results pastebin.

Is this fine?

Thank you


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


@Adrien Morais-Mestre 

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


@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


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!


@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


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?


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).


ok i m on 24.04.4, i upgrade


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 ?


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


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


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.


Reply