Cleanup IDO without loosing historical data

Hi,

I want to cleanup my IDO DB because it seems that there is a little inconsistence in it. The Cube module shows a wrong number of hosts for a group, but object attributes within icinga seems to be OK.
Before searching for a possible bug in Cube I want a clean state within IDO.

Is there a recommeded way to clean the IDO without loosing historical data like notifications?
I don’t want to truncate ALL tables…

Cheers,
Manfred

This will not work, either you have a fresh IDO DB or you leave it like it is.
Cube uses only custom variables to build “groups”, are yo usure all your hosts have the same custom variables configured to match a icinga group?

Regards,
Carsten

Hi,

you can truncate the config tables, specifically

| icinga_hostgroup_members               |
| icinga_hostgroups                      |
| icinga_hosts                           |

| icinga_servicegroup_members            |
| icinga_servicegroups                   |
| icinga_services                        |

and then reload Icinga. The config updates will populate these tables again.

Cheers,
Michael

3 Likes

learned something new again :slight_smile:

2 Likes

Hi,

thx, I’ll try it :smiley:

Cheers,
Manfred

Great, trunkating of tables mentioned above solved my problem.
Cube module shows now all groups correct :+1:

Manfred

No worries, this is something you’ll only do when a developer tells you so. Do not put that into an automated script or similar.