dcsimg

Best practices for maintaining a Webtrends installation

Products

Webtrends Analytics 9.x
Webtrends Analytics 8.x

Cause

There are many files, folders, and database tables in Webtrends that grow to large sizes during normal operation. Usually Webtrends will clean up its temporary folders and files on its own, but there are situations in which this doesn’t happen. Analysis failures, crashes, and unexpected system restarts are just a few of the situations that can result in left over data that doesn’t get properly cleaned up. This document details what files are safe to delete, and what database tables can be safely truncated to clean up your Webtrends installation. Deleting files and database information is an inherently risky operation, and as such, you should always make a backup before attempting the steps below. If you have any questions, please call Webtrends Technical Support at 503-223-3023 for more information.

Resolution

I. Log files and temporary file caches

The files in the following directories should not be removed while any of the Webtrends services are running, however they can be deleted once the services are stopped. For more information regarding the order to stop and start the Webtrends services, please see Order to stop and start the Webtrends services by version. In all cases, the directory structure must be maintained, but the files within them can be removed. Note that you may not have all of the folders below.

The following folders contain log files:

\Webtrends\storage\analysis\wtm_wtx\datfiles\statuslogs
(\Webtrends\storage\config\wtm_wtx\datfiles\statuslogs\ in versions prior to 8.7d)
\Webtrends\logs\
\Webtrends\common\jakarta-tomcat\logs\
\Webtrends\common\apache\logs\ (only applies to 8.0x – 8.1x)

Any computer (including distributed nodes) that is running an analysis engine will have the following directories that can be cleaned out:

\Webtrends\modules\analysis\engine[version number]\wtm_wtx\datfiles\statuslogs\
\Webtrends\modules\analysis\engine[version number]\wtm_wtx\datfiles\databases\
\Webtrends\modules\analysis\engine[version number]\wtm_wtx\datfiles\ehost_logs\
\Webtrends\modules\analysis\engine[version number]\wtm_wtx\datfiles\reports\

The following directories contain cached files from compressed archives and FTP transfers:

\Webtrends\modules\analysis\engine[version number]\wtm_wtx\datfiles\ftp
\Webtrends\modules\analysis\engine[version number]\wtm_wtx\datfiles\zipcache

If you are making backups, on any machine that contains a UI go to and delete any files files in the following directory that do not contain today’s date:

\Webtrends\modules\tools\temp

If you are running MySQL, you may have a large error log. Check for the following file. If it has grown to ten megabytes or larger, delete it:

\Webtrends\common\database\mysql\data*.err

    II. Reducing backup storage

    To reduce the size of the ‘backup’ files, simply reduce the retention time of the profile backups in the interface (Administration -> Application Settings -> System Management -> Backup/Restore -> Options -> Backup Options -> “Configuration File Backups” and “Analysis Data Backups”).

    III. Database Clean-up

    Several tables in the database can grow to unusual size and should be truncated when they grow large.

    For MS SQL execute the following SQL statements in a front-end tool such as MS SQL Server Management Studio Express:

    In wtmaster, truncate:

    DELETE FROM wtmaster.dbo.wt_analysissummary;
    DELETE FROM wtmaster.dbo.wt_servicestatus;

    In wt_sched, truncate:

    DELETE FROM wt_sched.dbo.wt_analysistime;
    DELETE FROM wt_sched.dbo.wt_eventstatus;
    DELETE FROM wt_sched.dbo.wt_hostmetrichistory;
    DELETE FROM wt_sched.dbo.wt_hoststatus;
    DELETE FROM wt_sched.dbo.wt_taskstatus;
    DELETE FROM wt_sched.dbo.wt_taskchronicle;
    DELETE FROM wt_sched.dbo.WT_MonitorResultAction;
    DELETE FROM wt_sched.dbo.WT_MonitorAlertResolveHistory;
    DELETE FROM wt_sched.dbo.WT_MonitorResult;

    For MySQL, open a command line on the Webtrends server running MySQL and cd to the following directory:

    \Webtrends\common\database\mysql\bin\

    Type the following command:

    mysql -u -p

    When prompted, enter your MySQL password.

    Change to the database that contains the table you want to truncate with one of the following commands:

    use wtmaster
    use wt_sched

    To delete the contents of a table, use the following command:

    delete from;

    Below is a list of the tables that can be safely truncated under the database in which they can be found.

    In wtmaster, truncate:

    wt_analysissummary
    wt_servicestatus

    In wt_sched, truncate:

    wt_analysistime
    wt_eventstatus
    wt_hostmetrichistory
    wt_hoststatus
    wt_taskstatus
    wt_taskchronicle

    Once you are finished truncating tables, run the following two commands:

    mysqlcheck.exe -r –databases wt_sched -u-p
    mysqlcheck.exe -r –databases wtmaster -u-p

    Both should finish with “OK” for all tables. If one of them displays something other than OK as it runs, run it a second time.

    IIII. Insight Clean-up

    If you have an Insight server installed, there are several locations on the Insight server where log files can accumulate.

    \Webtrends\logs
    \Webtrends\Twister\App_Data\elmah
    \Webtrends\Twister\App_Data\logs