Solved

Display issue of service states in the Centreon Dashboard


Badge +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?

 

 

icon

Best answer by Adrien Morais-Mestre 11 June 2024, 11:40

View original

15 replies

Userlevel 5
Badge +17

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?

Badge +1

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.
 

Userlevel 5
Badge +17

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

Badge +1

Hello,

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

 

 

Userlevel 5
Badge +17

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

Badge +1

No, I have no information

 

Userlevel 2
Badge +5

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

Waiting for your answer 👍🏻

Regards

Badge +3

Having the same problem but with hosts

Userlevel 2
Badge +5

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
 

Badge +3

Hello @Adrien Morais-Mestre,

here are the results pastebin.

Is this fine?

Thank you

Userlevel 2
Badge +5

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

Badge +3

@Adrien Morais-Mestre 

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

Userlevel 2
Badge +5

@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

Badge +3

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!

Userlevel 2
Badge +5

@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

Reply