Icinga2 Postgresql database is filling up disk space

Hi Team,

We have been noticing that Icinga PostgreSQL DB getting filled up regularly and we have increased the dataspace 1TB but already to 850GB.

Do you have any cleaning mechanism in the ido-pgsql.conf?
àns: No, I didn’t find the ido-conf details
For how long do you have data stored in the DB?
àns: 1month stored data
Were you able to check what is consuming so much space?
àns: Output of files consuming more than 500MB

###$$$$###:/srv/postgresql/data/icinga/base # du -h

7.6M ./1

7.6M ./13623

7.6M ./13624

551G ./16384

8.0M ./17802

7.6M ./38216

551G .

Need your suggestion on purging the data.

Hi & welcome,

there are options for automatic clean up - look here Object Types - Icinga 2

we are doing this for our MariaDB-database. This works fine

In addition to Stevie’s recommendation I’d like to know why your database is filling up. Do you have millions of checks? Or do you have e.g. DbCatCheck enabled as described here?

To get an idea you can use e.g.

SELECT TABLE_NAME AS “Table”, ROUND(data_length / 1024 / 1024, 2) AS “Data MB”, ROUND(index_length / 1024 / 1024, 2) AS “Index MB”, ROUND((data_length + index_length) / 1024 / 1024, 2) AS “Total MB” FROM information_schema.TABLES WHERE TABLE_SCHEMA=‘icinga’;