SYNOPSIS/opt/hp/colplot/genplotfiles.pl -outdir [-switches]
This utility is not intended to meet all plot file creation needs, but quite frankly should meet most. Features not provided with this utility are best realized by running collectl directly in playback mode (see collectl -p). It is therefore important to understand what this utility will and will not do for you before building an automation strategy around it.
The algorithm used is fairly simple - genplotfiles examines each collectl raw file to see it it falls within the data ranges (if specified) and contains a matching hostname (if specified). If a plot file already exists, the timestamps are compared and the raw file skipped if its newer than the plotfile.
Any raw files that pass all these tests are then passed to collectl with their timestamp wildcarded. The result is all raw files for that host/date will be processed. This means if you copy over collectl raw files multiple times over the course of the day using rsync, you can immediately genererate up-to-date plots for them using genplotfiles. Furthermore, you won`t even need any date parameters if the older plot files are alreay up to date.
For an example of what a cron job that aggregates multiple collectl logs onto a single system for plotting purposes, see crontab.sh in the same directory as this script.
All switches are optional with the exception of -outdir:
- This points to collectl and is only necessary if /usr/sbin is not in your path or you`ve chosen to install collectl in a non-standard directory.
- Primarily for development, will provide intermediate processing information based on its value. See souce for details.
- Always generate plot files even in there is an existing one that is newer than the latest raw file. This will be necessary if you want to rerun this script and just change the value of -subsys.
- Print a summary of available switches.
- Only process files that contain this string in their hostname portion of the filename.
- Directory where to look for collectl logs. The default is /var/log/collectl and is therefore only necessary if your logs are in a non-standard location.
- Directory into which to write the plottable files. This field is required.
- Ignore files with a datestamp in their name less that this value. The default is 20050101 and so defaults to all files. The value of `yesterday` is also recognized to simplify scripts that call this.
- Ignore files with a datestamp in their name with a datestamp greater than this value. The default is the current day and one can also specify a value of `yesterday`.
Instead of using the default subsystems for which data was collected, generate
output files based on this set. There are basically two reasons for doing
this. The first is that you may want to reduce the size of the plot files,
though with compression there is rarely much point in this. The second is if
you`ve asked collectl to collect summary data but want to plot detail data.
See the colplot FAQ for more information.
AUTHORThis program was written by Mark Seger ([email protected]).
Copyright 2005 Hewlett-Packard Development Company, L.P.