Hi all,
We've been looking at a simplified distribution framework for
SystemTap
scripts that :
1. packages a set of systemtap scripts and dependent
tapsets in a form that circumvents , as much as possible the need for
external dependencies(like kernel-debuginfo)
2. installs, runs the script, post processes the output and uninstalls
out of the box
We feel this would be especially useful in scenarios where support
admins wish to run a particular set of script(s) on a machine for
debug
or monitoring purposes. I'm attaching an rpm-based framework that does
the following:
1. Compiles a set of scripts into a set of kernel modules
on another machine of identical architecture that has SystemTap
installed and running
2. Creates an rpm on the fly that would consist of
i) kernel modules ii) staprun & stapio taken from the
systemtap-runtime
package in the machine that has SystemTap installed, iii) post
processing script to process the output(optional)
3. Bundles the above
rpm with an install script that has options to i) install the rpm ii)
run / stop iii) uninstall iv) all of the above.
4 . The rpm and the
install script are packaged into a self-extracting binary that would
extract itself and execute 1 of the four steps above.
The framework would mainly consist of
1. rpm-generating script
(rpm-generator.sh) that does all of the above
2. spec file template that
will be modified by the rpm-generator on the fly and used to build the
rpm
3. install script template that will be modified by the
rpm-generator and bundled with the rpm
4. Configuration file - that
would specify the location of the scripts/tapsets
The rpm is packaged as a self extracting binary for ease of use. When
the binary is executed it extracts the rpm package and based on the
parameters provided either installs/runs/uninstalls the rpm. Help
detailing the available options are also provided
USAGE: <package_name> [options] [parameters]
Options:
* --install -i Install the tapset rpm.
* --run -r Runs the scripts
for n minutes where n can be passed as a parameter. o The default
value
is 10 minutes. Post processing is performed after the script
completes.
* --start -s Invokes the script as a background process.
* --stop -x Stops the script and performs post processing.
* --uninstall -u Stops the script if running and uninstalls the rpm.
* --all Installs the rpm, runs the scrip, processes the output and
uninstalls the rpm.
* --help Displays this usage text.
Parameters:
* time=[x] x is in minutes. Runs the script for x minutes. valid for
--run(-r) o --start(-s) or --all(-a) options only
One disadvantage of the above framework is that the end binary that is
created is tied to a particular kernel version/architecture.
However the
users now need not install systemtap, debuginfo and need not even be
familiar with SystemTap. This should help users and admins who wish to
run a set of scripts to solve a specific problem(maybe on a customer's
machine).
Please comment,
Regards,
Anithra.