Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix icingadb db queries #123

Merged
merged 3 commits into from Jan 18, 2024

Conversation

sukhwinder33445
Copy link
Collaborator

No description provided.

@gbin2265
Copy link

gbin2265 commented Jan 16, 2024

Hello @sukhwinder33445

I will continue to correspond with you here, because the other pulls are closed.

I think I know why there is an endless loop.
It does the endless loop on host without services.
If you see the result in the SQL, you will see that the service fields are all set to NULL for host without services.

If I set this filter to require that at least one service exists for the host (remove lines with NULL), it works.
$hostQuery->Filter(IplFilter::equal('service.state.is_problem', 'n'));

is this a possible solution?


           if (!is_null($row->service->state->is_problem)) {
              $service = $this->populateObjectColumnsToArray($row->service);
              $this->points['hosts'][$hostname]['services'][$row->service->display_name] = $service;
            }


regards,
Geert

@sukhwinder33445
Copy link
Collaborator Author

Hello @gbin2265,

Your solution is also fine, but it is also suffice if you just check the $row->service->id !== null. I have added the change. It should now work as expected.

regards
Sukhwinder

@gbin2265
Copy link

Hello,

I tested the latest version and everything works.

I tested with my 6k hosts and 200k services, and that takes 8 minutes. I'm going to have to give some more power to the vm. :)

But the change that one SQL statement is now made has greatly reduced the pressure on the database. (dba team is happy).

Thank you for all your work in making the effort to improve the map module in conjunction with icingadb.

regards,
Geert

@nbuchwitz nbuchwitz self-requested a review January 18, 2024 13:32
@nbuchwitz nbuchwitz merged commit 4155e03 into nbuchwitz:master Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants