Mysql/icinga2 data

Hi,

I reconize a fast growth in my mysqldb of Icinga Web 2.

Unbenannt

Is there a command or best practise to purge the database?
I found a possible solution, but I want your opinion/ experience first.

the link you posted is the most reasonable solution to this problem
but be aware that this could take rather long or fail with no manual intervention if you go beyond a certain size

1 Like

Hi,

the *checks tables are not enabled by default for this very reason - every check result is dumped into the database, bloating this over time. The IDO database is not meant for time series as there is no aggregation involved.

In case you’ve enabled such for a Grafana import source addon, I strongly advise against this.

Cheers,
Michael

1 Like

Thank you Michael!

I found my mistake, but I can’t remember why we enabled the categories:

object IdoMysqlConnection "ido-mysql" {
  user = "icinga2",
  password = "icinga2password",
  host = "111.1.1.1",
  database = "icinga2",
//  categories = [ "DbCatConfig", "DbCatState", "DbCatAcknowledgement", "DbCatComment", "DbCatDowntime", "DbCatEventHandler", "DbCatFlapping", "DbCatCheck", "DbCatNotification", "DbCatProgram                                          Status", "DbCatRetention", "DbCatStateHistory" ],
  enable_ha = true
}

I cleaned the icinga_servicechecks.ibd and icinga_hostchecks.ibd, categories commented out and I think everything is fine.
Is there any important backround for the categories?

The default categories are tuned for Icinga Web 2 and various addons. We sure have implemented additional events for those wanting full 1.x compatibility. Turns out, it wasn’t the best idea.

Cheers,
Michael

2 Likes