SmartStorTools and remove_metrics option

Document ID : KB000013261
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

Important Note: This knowledge document was written before APM 10.5 when this command option changed. If using APM 10.5 and later, first review TEC1663998 before reading this -- Does the Smartstor Tool remove_metric command behave differently in APM 10.5.x and later?) 

SmartStor Tool Command : remove_metrics

Removes metrics matching the given regular expression. Use this tool to clean up metrics leaks and explosions.
Warning! Use the remove_metrics tool with caution. Since this tool deletes data, take care that you do not accidentally delete important data.

Arguments:

    -dest -- Destination SmartStor directory.
    -help -- Prints a help message.
    -metrics -- Regular expression for metrics to remove.
    -src -- Source SmartStor directory.

Examples:

Windows

SmartStorTools.bat remove_metrics  -dest <destination directory> -metrics <metrics to be removed> -src <source directory>

For example:

<EM_Home>\tools\SmartStorTools.bat remove_metrics  -dest C:\SWDump\destination -metrics ".*Socket.*" -src <EM_Home>\data

When the command executes successfully, all the metrics except the socket metrics are present in the destination directory and the source directory has all the metrics intact.

UNIX

SmartStorTools.sh remove_metrics  -dest < destination directory> -metrics <metrics to be removed> -src <source directory>

Question:

 

 Why do the metrics remain the same in the original smartstor directory (-src, aka Source Directory) after running the remove_metrics command?

 

 

Environment:
APM 10.x Windows Linux
Answer:

 The SmartStorTools ‘remove_metric’ option will not make any changes to the –src (source) directory. Instead, after successful execution the -dest (destination) directory will have the updated Smartstor database, with all metrics removed which are covered by the –metrics option regex. 


As an Example:

<EM_Home>\tools\SmartStorTools.bat remove_metrics –dest C:\SWDump\Destination -metrics ".*Socket.*" -src <EM_Home>\data

 SmartStorTools ‘remove_metric’ option will not make any changes to the –src directory (<EM_Home>\data).
 After successful execution the -dest directory ( C:\SWDump\Destination) will not have the metrics which are mentioned for the –metrics option regex (Socket).

 The ‘C:\SWDump\destination’ will not have ‘Socket’ related metrics in it.

 
The “src” can now be the backup – merely rename to <EM_Home>\data_BKUP! Just in case.
Create the folder “data” in EM_HOME and copy [or move] the content of “SWDump\Destination” into “data”.

Note: The Enterprise Manager needs to stopped during this process.

Additional Information:

https://docops.ca.com/ca-apm/10-5/en/administrating/configure-enterprise-manager/configure-and-manage-smartstor-data -- Smartstor Commands

TEC1337681 -- How do I cleanup Smartstor data?

TEC609741 -- Smartstor Tools Help

TEC1208245 -- How to remove the metrics with a single command of SmartStorTools.