Clear unprocessed temporary files in the backend; disk space is nearly full
search cancel

Clear unprocessed temporary files in the backend; disk space is nearly full

book

Article ID: 333153

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Steps to clear unprocessed temporary files in the backend.

Disk space is full due to the *.atf and *.mysql files.

Environment

Watch4Net/M&R - 7.x

Cause

When the backend hangs or is busy due to multiple simultaneous database tasks, the temporary file count will accumulate.

Resolution

  • Files in the /opt/APG/Backends/APG-Backend/<INSTANCE>/tmp/ folder (.atf or .mysql) are normally processed quickly without accumulating.
  • However in some cases, when the backend hangs or is busy due to multiple simultaneous database tasks, the temporary file count will accumulate.
  • This can lead to a significant reduction in disk space that can exacerbate the file processing issue. 

Steps to force the backend to process temporary files that have not been cleared.

  1. Run the following command to determine which 10 directories in Watch4net are using the allocated disk space:

du -h /opt/APG  |sort -k1nr |head -n 10

  1. Once it's determined which backend database is using the disk space, navigate to the backend /tmp folder and determine how many files are in the directory. 
ls -1 | wc -l
 
Note: .mysql and .atf files contain the time series data for Watch4net reports and thus should not be deleted.
  1. Navigate to /opt/APG/bin/ and attempt to stop the backend in question. If the backend fails to stop, kill the process:
  • Find the PID of the backend process in the following file: /opt/APG/Backends/APG-Backend/<INSTANCE>/logs/apg-backend-<INSTANCE>.pid
  • Execute: kill -9 <PID> 
  1. Stop the MySQL database service using the same method as step 3. 
  2. Start the MySQL database, and then the backend process:
  • /opt/APG/bin/manage-modules.sh service start mysql Default
  • /opt/APG/bin/manage-modules.sh service start backend <INSTANCE>
  1. Verify that the temporary file count under the /opt/APG/Backends/APG-Backend/<INSTANCE>/tmp/ directory is actively reducing: ls -1 | wc -l
  2. Confirm that the import-properties task is completing successfully and without errors on the frontend host. 
  3. After a few hours (depending of the number of files) the files will be processed and the filesystem utilization should reduce. 
  4. If there are errors in the Webservice gateway logs (/opt/APG/Tools/Webservice-Gateway/Default/logs/gateway-*-*.log) pertaining to the backend service that was restarted. Delete the .webservice file and restart the backend service:
  • Delete the .webservice file under /opt/APG/Backends/APG-Backend/<INSTANCE>/ (Note: This file may be hidden; please use the ls -la command to check for it's existence). 
  • Restart the backend service: /opt/APG/bin/manage-modules.sh service restart backend <INSTANCE>
  • After the temporary files have been processed, the .webservice file will be regenerated by the backend service.

Additional Information