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

Sync icingadb from redis to DB #897

Closed
gbin2265 opened this issue Sep 28, 2023 · 1 comment
Closed

Sync icingadb from redis to DB #897

gbin2265 opened this issue Sep 28, 2023 · 1 comment

Comments

@gbin2265
Copy link

Hello,

I have more and more situations where I find differences between the DB and the output on the screen.
In the DB it says that the services is NOT handled and in the SOURCE tab it is handled.

I think there are many times that icingadb passes the info to the REDIS, but does not also write it to the DB

Is there a command to tell icingadb to push the info from the REDIS to the DB?

See an example of a problem here :

Describe the bug

I am looking for the differences between the DB and what you see in the icingadb-web.

To Reproduce

I put this filter in the icingadb-web

http://site.com/icingaweb2/icingadb/services?service.state.soft_state=2&service.state.is_handled=n&service.state.is_reachable=y&host.vars.xxx=1&service.name=yyy

format=sql

select
.... all the fields
from
service
inner join service_state on
service_state.service_id = service.id
left join comment service_state_last_comment on
service_state_last_comment.id = service_state.last_comment_id
left join host service_host on
service_host.id = service.host_id
left join host_state service_host_state on
service_host_state.host_id = service_host.id
left join icon_image service_icon_image on
service_icon_image.id = service.icon_image_id
where
(service_state.soft_state = '2')
and (service_state.is_handled = 'n')
and (service_state.is_reachable = 'y')
and (service.id in ((
select
sub_customvar_flat_host_service.id as sub_customvar_flat_host_service_id
from
customvar_flat sub_customvar_flat
inner join host_customvar sub_customvar_flat_host_customvar on
sub_customvar_flat_host_customvar.customvar_id = sub_customvar_flat.customvar_id
inner join host sub_customvar_flat_host on
sub_customvar_flat_host.id = sub_customvar_flat_host_customvar.host_id
left join service sub_customvar_flat_host_service on
sub_customvar_flat_host_service.host_id = sub_customvar_flat_host.id
where
(sub_customvar_flat.flatname = 'xxx')
and (sub_customvar_flat.flatvalue = '1'))))
and (service.name = 'yyy')
order by
service.display_name
limit 50

List result

I get this as a result
filter

DB sql result

Service Result

service_state

Host Result

service_host_state

API/SOURCE

When I look at the SOURCE tab(also via the API) I get this info

source

Question

Why are there differences between the DB and the source data?

In the query I have that the is_handled = n,
in the source page the is_handled = true
Same with the is_acknowledged.

Or is this the same problem as Icinga/ipl-orm#119

Your Environment

icinga-cube-web.noarch 1.3.2-1.el7
icinga-cube.noarch 1.3.2-1.el7
icinga-l10n.noarch 1.3.0-1.el7
icinga-php-common.noarch 1.0.0165655404400000000-0.20220630.0154.el7.icinga
icinga-php-library.noarch 0.13.0-1.el7
icinga-php-thirdparty.noarch 0.12.0-1.el7
icinga2-bin.x86_64 2.14.0-1.el7
icinga2-common.x86_64 2.14.0-1.el7
icinga2-ido-pgsql.x86_64 2.14.0-1.el7
icingacli.noarch 2.12.0-1.el7
icingadb-web.noarch 1.0.2+243.gde96826-1694819007.el7
icingaweb2-common.noarch 2.12.0-1.el7
icingaweb2.noarch 2.12.0-1.el7
php-icinga.noarch 2.12.0-1.el7

@gbin2265 gbin2265 changed the title Sync icingaweb from redis to DB Sync icingadb from redis to DB Sep 28, 2023
@gbin2265
Copy link
Author

I'm going to close the case because after further analysis I think there were problems with the comment/shutdown records during the migration.

Luckily I still have information from the old database to restore everything one by one.

Is there a problem with the migration tool, I cannot confirm this.

Just strange that I have a lot of comments that are in the database as no comment,
but in Redis as a comment (source page), but without the comment that was there.

I delete the comment and create it again and then everything is back in sync at DB and REDIS level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant