Skip to main content

I ran this command to remove old metrics

find /var/lib/centreon/metrics -type f -name '*.rrd' -mtime +90 -delete

and I would like to know if is safe to perform this query directly 

DELETE FROM data_bin WHERE id_metric NOT IN (SELECT metric_id FROM metrics)

 

I ran this command to remove old metrics

find /var/lib/centreon/metrics -type f -name '*.rrd' -mtime +90 -delete

and I would like to know if is safe to perform this query directly 

DELETE FROM data_bin WHERE id_metric NOT IN (SELECT metric_id FROM metrics)

 

did you run the cleanup on the DB?

I also want to know if it's possible


I ran this query 

UPDATE `metrics` SET to_delete = 1 WHERE index_id NOT IN (SELECT id FROM index_data)

but I still not sure if this is the best way to do so

I also ran these ones in order to clear duplicated hosts and services

DELETE FROM `index_data` WHERE `host_name` LIKE '%\_1'
DELETE FROM `index_data` WHERE `service_description` LIKE '%\_1' and service_description != 'meta_1'
DELETE FROM `services` WHERE description LIKE '%\_1' AND description != 'meta_1'

 


Hi Guys

 

Which is the best solution to clean the centreon database ?

I want to reduce the size of it 


Hi @cesinhaleal  How can I run the cleanup on Centreon DB ?

Is there more detailed documentation regarding metrics cleanup  from  filesystem and DB ?

 

Thank you very much

Costi


Hi @cesinhaleal  How can I run the cleanup on Centreon DB ?

Is there more detailed documentation regarding metrics cleanup  from  filesystem and DB ?

 

Thank you very much

Costi

There is no documentation, I didn't follow the friend's solution above.


FTR Internal MON-17389


Reply