Skip to main content
Question

Log Retention

  • February 18, 2025
  • 4 replies
  • 36 views

Forum|alt.badge.img+1

Hello,

 

using the Log Retention with a value 365 or even 31 the Cronjob /usr/share/centreon/cron/centstorage_purge.php doesn’t clean (all) old comments.

I’ve got comments from 2017.

 

 

Responsible SQL Query to cleanup:

DELETE FROM comments WHERE (deletion_time is not null and deletion_time ' .
            '< __RETENTION__) OR (expire_time < __RETENTION__ AND expire_time <> 0)

Value for __RETENTION__ is the value from the config, in my case 365. The table field expire_time is always 0, so the second part of the query is never matching.

The field deletion_time is on many entrys NULL (currently 100174 entrys) and on 3287090 entrys not null. 

 

I’m not sure about the fields deletion_time and expire_time what are they for. But comments from 2017 shouldn’t be there in Year 2025 with retention period of 365 days. 

 

Manually checking the filter:

SELECT * FROM centreon_storage.comments WHERE (deletion_time is not null and deletion_time < 1708297200 ) OR (expire_time < 1708297200  AND expire_time <> 0)

Returns 0 results.

 

SELECT COUNT(*) FROM centreon_storage.comments WHERE entry_time < 1708297200 

Returns 89889.

 

There are also 89889 comments older then retention.

 

Should i build my own clean job filtering on entry_time? What are the deletion_time and expire_time for?

 

4 replies

Laurent
Centreonian
Forum|alt.badge.img+20
  • Centreonian
  • 967 replies
  • March 19, 2025

Forum|alt.badge.img+1
  • Author
  • Steward *
  • 2 replies
  • March 19, 2025

Hi ​@Laurent,

 

I made the modification and it worked as expected. Do you plan to implement the change in the next releases?


Laurent
Centreonian
Forum|alt.badge.img+20
  • Centreonian
  • 967 replies
  • March 19, 2025

Thank you for the feedback, i’ll check with team how to prioritize this fix.


Forum|alt.badge.img+1
  • Author
  • Steward *
  • 2 replies
  • March 19, 2025

Thanks.

 

@mkanzler ​@THuerter FYI


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings