DX Application Performance Management

 View Only

TEC609741: Smartstortools Help 

May 26, 2016 05:04 PM

Document ID:  TEC609741
Last Modified Date:  4/18/2014

Author: chris.milazzo

 

  • Products
    • CA Application Performance Management
  • Components
    • INTROSCOPE

 

Description:Best practices and examples for Smartstortools usage.Solution:Smartstortools HelpImportant Notes and FAQ:

  • Backup. Backup. Backup. This is important data we are working with. Always take a backup of the data directory just in case.
  • Smartstortools does not have an option or argument to delete data for a specific range of time.
  • Smartstortools commands work against the metadata files. You will not see any change in data files or size until midnight when Smartstor tasks kick off on the EM.
  • You cannot use both remove_metrics and remove_agents at the same time.
  • Smartstortools is located and needs to be run from the tools directory.
  • -src directory is never altered. -dest directory is typically the contents of the -src directory minus the removed metrics, agents and or data.
  • Expressions used in the Smartstortools command are case sensitive even in Windows.
  • Use the prune command to find agents that have no historical data in Smartstor and remove them.

 

Steps for Smartstortools usage

    1. Shut down the Enterprise Manager.

    2. The tool writes the altered Smartstor to a destination directory, so you will need to create a temporary directory for the destination. Let's call this directory "dataNEW". We will refer to it by this name in the examples and later steps. It should be noted that the -src directory specified is never touched and only read.

    3. As a test you can use the following commands to see what data exists and what you would like to remove.

      • Print all the metrics
        • ./SmartstorTools.sh test_regex -metrics ".*|.*|.*" -src /APM/data
      • Print the agents
        • ./SmartstorTools.sh test_regex -agents ".*|.*|.*" -src /APM/data
      • Print filtered metrics
        UNIX TIP: If you are using a UNIX system, the command below will give you a better view of the metrics:
        ./SmartstorTools.sh test_regex -metrics ".*|.*|.*" -src /APM/data | grep '|'.* | awk -F'|' '{print $1}' | sort | uniq -c

        WINDOWS TIP: If you are using Windows, export the data to a text file to get a better view of the metrics.
        SmartstorTools.bat test_regex -metrics ".*|.*|.*" -src C:/APM/data > data.txt

        Load data.txt into Excel
        Use "|" as a separator
        add an empty row at the top
        apply sort against the 1st column
        apply a grouping to get the count based on column A
        • ./SmartstorTools.sh test_regex -metrics ".*Socket.*" -src /APM/data
        • ./SmartstorTools.sh test_regex -metrics ".*SQL.*" -src /APM/data
        • ./SmartstorTools.sh test_regex -metrics ".*EJB.*" -src /APM/data
    4. Select metrics from specific agents to be removed using regex or use regex to match metrics themselves as below. Sockets, SQL and JMX are often the largest consumers of Smartstor space. You may need to run many commands to get all the data you would like to remove.

      • Example 1: Remove data for the specified agent name:
        ./SmartstorTools.sh remove_agents -agents "SuperDomain\\|Hostname\\|Agent\\|UnnamedAgent" -src /APM/data -dest /APM/dataNEW
      • Example 2: Remove Socket data using a metric name as a filter:
        ./SmartstorTools.sh remove_metrics -src /APM/data -metrics .*Socket.* -dest /APM/dataNEW
      • IMPORTANT! EACH time you run a command to remove metrics, agents and or data you will need to take the previous -dest directory and use it as the new -src directory. The new -dest should always be a blank directory.
      • Example 3: Removing many items in succession:
        • ./SmartstorTools.sh remove_metrics -src /APM/data -metrics .*Socket.* -dest /APM/dataNEW1
        • ./SmartstorTools.sh remove_metrics -src /APM/dataNEW1 -metrics .*JMX.* -dest /APM/dataNEW2
        • ./SmartstorTools.sh remove_metrics -src /APM/dataNEW2 -metrics .*SQL.* -dest /APM/dataNEW3
        • ./SmartstorTools.sh remove_metrics -src /APM/dataNEW3 -metrics .*EJB.* -dest /APM/dataNEW4
    5. To verify that data has been removed from the metric data files. Do a query against the latest Smartstor data directory destination folder, which in this example will be "dataNEW4".
      1. ./SmartstorTools.sh test_regex -agents ".*|.*|.*" -src /APM/dataNEW4
      2. ./SmartstorTools.sh test_regex -metrics ".*Socket.*" -src /APM/dataNEW4
    6. Perform a Smartstor prune:
        1. Create a new -dest directory "dataprune". Then utilize the most recently used -dest directory as the -src
        2. Here is an example:
          ./SmartstorTools.sh prune -src /APM/dataNEW4 -dest /APM/dataprune
    7. Important! Take the most recent -dest directory that you removed or pruned data from and make it your new "data" directory that the Enterprise Manager will use. In the steps above you would ultimately use "dataprune".
    8. Start the Introscope EM.

Example run through

  • Run a query to see data and verify regex syntax
    SmartstorTools.bat test_regex -metrics "Sockets\|Server.*" -src C:\APM\data Debug options: file:/C:/tmp/.options not found Mar 19, 2014 11:46:36 AM org.springframework.osgi.extender.internal.activator.ContextLoaderListener start INFO: Starting [org.springframework.osgi.extender] bundle v.[1.2.1] Mar 19, 2014 11:46:36 AM org.springframework.osgi.extender.internal.support.ExtenderConfiguration  INFO: No custom extender configuration detected; using defaults... Mar 19, 2014 11:46:36 AM org.springframework.scheduling.timer.TimerTaskExecutorafterPropertiesSet INFO: Initializing Timer Sockets|Server|Port 7001:Concurrent Readers Sockets|Server|Port 7001:Accepts Per Interval Sockets|Server|Port 7001:Closes Per Interval Sockets|Server|Port 7001:Output Bandwidth (Bytes Per Second) Sockets|Server|Port 7001:Concurrent Writers Sockets|Server|Port 7001:Input Bandwidth (Bytes Per Second) Sockets|Server|Port 8080:Accepts Per Interval Sockets|Server|Port 8080:Concurrent Writers Sockets|Server|Port 8080:Input Bandwidth (Bytes Per Second) Sockets|Server|Port 8080:Concurrent Readers

 

 

  • create a directory called data1.

  • Use the remove_metric option
    C:\Introscope\tools>SmartstorTools.bat remove_metrics -src C:\APM\data -metrics "Sockets\|Server.*" -dest c:\APM\data1 startdir is C:\APM\tools INFO: Starting [org.springframework.osgi.extender] bundle v.[1.2.1] Mar 19, 2014 11:57:07 AM org.springframework.osgi.extender.internal.support.ExtenderConfiguration  INFO: No custom extender configuration detected; using defaults... Mar 19, 2014 11:57:07 AM org.springframework.scheduling.timer.TimerTaskExecutorafterPropertiesSet INFO: Initializing Timer 3/19/14 11:57:07 AM EDT [INFO] [Manager] Copying C:\APM\data\1393477215000.data to c:\APM\data1\1393477215000.data 3/19/14 11:57:07 AM EDT [INFO] [Manager] Copying C:\APM\data\1393480815000.data to c:\APM\data1\1393480815000.data 3/19/14 11:57:07 AM EDT [INFO] [Manager] Copying C:\APM\data\1393484415000.data to c:\APM\data1\1393484415000.data 3/19/14 11:57:07 AM EDT [INFO] [Manager] Copying C:\APM\data\1393488015000.data to c:\APM\data1\1393488015000.data 3/19/14 11:57:07 AM EDT [INFO] [Manager] Copying C:\APM\data\archive\1361941200000.data to c:\APM\data1\archive\1361941200000.data 3/19/14 11:57:07 AM EDT [INFO] [Manager] Copying C:\APM\data\archive\1362027600000.data to c:\APM\data1\archive\1362027600000.data 3/19/14 11:57:08 AM EDT [INFO] [Manager] Copying C:\APM\data\archive\1362373200000.data to c:\APM\data1\archive\1362373200000.data 3/19/14 11:57:08 AM EDT [INFO] [Manager] Copying C:\APM\data\archive\1362459600000.data to c:\APM\data1\archive\1362459600000.data 3/19/14 11:57:08 AM EDT [INFO] [Manager] Copying C:\APM\data\archive\1362546000000.data to c:\APM\data1\archive\1362546000000.data 3/19/14 11:57:13 AM EDT [INFO] [Manager] Loading metadata file: C:\APM\data\metrics.metadata 3/19/14 11:57:13 AM EDT [INFO] [Manager] Pruning metric named Sockets|Server|Port 7001:Accepts Per Interval 3/19/14 11:57:13 AM EDT [INFO] [Manager] Pruning metric named Sockets|Server|Port 7001:Closes Per Interval 3/19/14 11:57:13 AM EDT [INFO] [Manager] Pruning metric named Sockets|Server|Port 7001:Concurrent Readers 3/19/14 11:57:13 AM EDT [INFO] [Manager] Pruning metric named Sockets|Server|Port 7001:Concurrent Writers 3/19/14 11:57:13 AM EDT [INFO] [Manager] Pruning metric named Sockets|Server|Port 7001:Output Bandwidth (Bytes Per Second) 3/19/14 11:57:13 AM EDT [INFO] [Manager] Pruning metric named Sockets|Server|Port 7001:Input Bandwidth (Bytes Per Second) 3/19/14 11:57:13 AM EDT [INFO] [Manager] Pruning metric named Sockets|Server|Port 8080:Accepts Per Interval 3/19/14 11:57:13 AM EDT [INFO] [Manager] Pruning metric named Sockets|Server|Port 8080:Concurrent Writers 3/19/14 11:57:13 AM EDT [INFO] [Manager] Pruning metric named Sockets|Server|Port 8080:Input Bandwidth (Bytes Per Second) 3/19/14 11:57:13 AM EDT [INFO] [Manager] Pruning metric named Sockets|Server|Port 8080:Concurrent Readers
  • run a query to verify that data has been removed from -dest directory.
    SmartstorTools.bat test_regex -metrics "Sockets\|Server.*" -src C:\APM\data1 startdir is C:\APM\tools Debug options: file:/C:/tmp/.options not found Mar 19, 2014 12:06:58 PM org.springframework.osgi.extender.internal.activator.ContextLoaderListener start INFO: Starting [org.springframework.osgi.extender] bundle v.[1.2.1] Mar 19, 2014 12:06:58 PM org.springframework.osgi.extender.internal.support.ExtenderConfiguration  INFO: No custom extender configuration detected; using defaults... Mar 19, 2014 12:06:58 PM org.springframework.scheduling.timer.TimerTaskExecutorafterPropertiesSet INFO: Initializing Timer No Matching Metrics are found in Smartstor
  • create a new destination directory called dataprune.

  • Run the prune option (actual logging output has been truncated).
    SmartstorTools.bat prune -src ../data1 -dest ../dataprune Debug options: file:/C:/tmp/.options not found Mar 19, 2014 12:06:58 PM org.springframework.osgi.extender.internal.activator.ContextLoaderListener start INFO: Starting [org.springframework.osgi.extender] bundle v.[1.2.1] Mar 19, 2014 12:06:58 PM org.springframework.osgi.extender.internal.support.ExtenderConfiguration  INFO: No custom extender configuration detected; using defaults... Mar 19, 2014 12:06:58 PM org.springframework.scheduling.timer.TimerTaskExecutorafterPropertiesSet INFO: Initializing Timer 3/25/14 01:42:06 PM EDT [INFO] [Manager] Copying ..\data1\1395752415000.data to ..\dataprune\1395752415000.data 3/25/14 01:42:06 PM EDT [INFO] [Manager] Copying ..\data1\1395756015000.data to ..\dataprune\1395756015000.data 3/25/14 01:42:06 PM EDT [INFO] [Manager] Copying ..\data1\1395759615000.data to ..\dataprune\1395759615000.data 3/25/14 01:42:06 PM EDT [INFO] [Manager] Copying ..\data1\1395763215000.data to ..\dataprune\1395763215000.data 3/25/14 01:42:06 PM EDT [INFO] [Manager] Copying ..\data1\archive\1364184000000.data to ..\dataprune\archive\1364184000000.data 3/25/14 01:42:06 PM EDT [INFO] [Manager] Copying ..\data1\archive\1364270400000.data to ..\dataprune\archive\1364270400000.data 3/25/14 01:42:06 PM EDT [INFO] [Manager] Copying ..\data1\archive\1364356800000.data to ..\dataprune\archive\1364356800000.data 3/25/14 01:42:06 PM EDT [INFO] [Manager] Copying ..\data1\archive\1364443200000.data to ..\dataprune\archive\1364443200000.data 3/25/14 01:42:07 PM EDT [INFO] [Manager] Reading Smartstor Metadata 3/25/14 01:42:07 PM EDT [INFO] [Manager] Loading metadata file: ..\data1\metrics.metadata 3/25/14 01:42:10 PM EDT [INFO] [Manager] Finished reading Smartstor Metadata 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning agent named SuperDomain|OLDHOST|WebSphere|WAS2 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning agent named SuperDomain|OLDHOST|WebSphere|WAS1 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS1:ConnectionStatus 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named EM Host 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named EM Port 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS1:Metric Count 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS1:Historical Metric Count 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS1:Raw Metric Count 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS1:Is Clamped 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS1:ErrorSnapshot Events Per Interval 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS2:Transaction Tracing Events Per Interval 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS2:ErrorSnapshot Events Per Interval 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS2:Transaction Tracing Events Limit Exceeded 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS2:ErrorSnapshot Events Limit Exceeded 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS1:ErrorSnapshot Events Limit Exceeded 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS1:Transaction Tracing Events Per Interval 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS2:ConnectionStatus 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS1:Transaction Tracing Events Limit Exceeded 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS2:Historical Metric Count 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS2:Metric Count 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS2:Is Clamped 3/25/14 01:42:10 PM EDT [INFO] [Manager] Pruning metric named Agents|OLDHOST|WebSphere|WAS2:Raw Metric Count
  • To complete the process and have the latest -dest directory (dataprune in this case) become the new Smartstor repository for the Enterprise Manager, rename the original data directory then rename dataprune to data.

  • Restart the Enterprise Manager.

 

 

Search the Entire CA APM Knowledge Base

 

search-kb.jpg

 

Statistics
0 Favorited
1 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.