#!/bin/sh # # A crude ascii reporting tool, convert pmie to column output # # The pmie rules need to be of the form: # load_1 = kernel.all.load #'1 minute'; # idle = kernel.all.cpu.idle; # column_name=some other expression; # ... # # Each pmie expression has to produce a singular value. # # With timestamps (pmie -e or pmie output from a PCP archive), lines look like # metric (Tue Feb 13 05:01:19 2001): value # load_1 (Tue Dec 23 12:20:45 2003): 0.24 # the first sed step in the filter sorts this out. # # First e-mailed to Patrick Aland and pcp@oss.sgi.com # on Wed, 24 Jan 2001. # # Get standard environment . $PCP_DIR/etc/pcp.env tmp=`mktemp -d /tmp/pcp.XXXXXXXXX` || exit 1 status=1 trap "rm -rf $tmp; exit \$status" 0 1 2 3 15 prog=`basename $0` # For interactive use, works better with line buffered output from sed(1) # and awk(1). # case "$PCP_PLATFORM" in linux|mingw|kfreebsd|gnu) SED="sed -u" ;; freebsd|darwin) SED="sed -l" ;; *) SED=sed ;; esac echo > $tmp/usage cat >> $tmp/usage <