How to clean up old audit information from the audits table inside the foreman database on Red Hat Satellite 6?
Environment
- Red Hat Satellite 6.x
Issue
- Using the script attached to Postgresql database is growing and disk space utilization of /var/lib/pgsql is increasing in Red Hat Satellite 6, the
auditstable inside theforemandatabase was identified as one of the largest tables.
Resolution
The old audit information from the audits table inside the foreman database can be cleaned up using either of the following commands based on the user's choice:
-
To cleanup/expire all audits older than 90 days:
# foreman-rake audits:expire --trace --verbose -
To cleanup/expire all audits older than 30 days:
# foreman-rake audits:expire days=30 --trace --verbose
For more KB articles/solutions related to Red Hat Satellite 6.x PostgreSQL-related Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x PostgreSQL-related Issues
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.