The collect tool gathers a variety of information about a system for a short time. It is typically executed when the stalk tool detects a condition and wants to collect information to assist in diagnosis.
Command-Line Options and Environment Variables
This tool accepts the following command-line options, all of which are required and must be specified:
- -d DESTINATION
- The directory where the collected data should be stored. It must exist.
- -i INTERVAL
- How many seconds to collect data before quitting.
- "yes" or "no": whether to collect GDB stack traces.
- "yes" or "no": whether to collect oprofile data. This disables -s.
- -p PREFIX
- A timestamp to use as the prefix of all files; defaults to current timestamp.
- "yes" or "no": whether to collect strace data.
- "yes" or "no": whether to collect tcpdump data.
How it Works
This tool creates a lock to ensure that only one instance runs at a time, and then saves a variety of performance and status data into files in the configured directory. Files are named with a timestamp so they can be grouped together. The tool is MySQL-centric by default, and gathers quite a bit of diagnostic data that's useful for understanding the behavior of a MySQL database server.
To use this tool, simply execute it with the required options. It is usually executed by another tool, such as the stalk tool, instead of being called directly.