This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds audit log purge log
allows people to configure data retention for audit logs
This adds a new field in the form in administration -> parameters -> options at the bottom of the page. Field that allows people to configure the retention duration for their audit log. It also displays logs from CLAPI actions
Type of change
Target serie
How this pull request can be tested ?
-head over the administration -> parameters -> options and set a value for your audit log retention duration.
-create a backup of your database so you'll be able to repeat the next step as much as you want
-mysqldump -u centreon -p centreon_storage log_action log_action_modification > /tmp/backup_audit_log_tables.sql
In my exemple, I have the following logs
https://user-images.githubusercontent.com/7352865/56137468-38d8aa00-5f95-11e9-8b80-61f221df8fed.png
I configure my audit logs retention to 3 days so most of my past actions are going to be purged
https://user-images.githubusercontent.com/7352865/56137519-586fd280-5f95-11e9-86b9-a6df66013c2a.png
if you've done your backup, you're now ready to use the purge
write the following command on your central server
/opt/rh/rh-php71/root/usr/bin/php /usr/share/centreon/cron/centstorage_purge.php
go back to your log menu and find out that there're no data older than 3 days ago
https://user-images.githubusercontent.com/7352865/56137808-e350cd00-5f95-11e9-9cf7-550262423726.png
Checklist
Community contributors & Centreon team
Centreon team only