#!/bin/sh # # pmlogger "plugin" for pmcheck # . $PCP_DIR/etc/pcp.env || exit 1 . $PCP_SHARE_DIR/lib/checkproc.sh _do_args "$@" if $sflag then if [ -f "$PCP_RUN_DIR/pmlogger.pid" ] then pid=`cat "$PCP_RUN_DIR/pmlogger.pid"` if [ -n "$pid" ] then found=`$PCP_PS_PROG $PCP_PS_ALL_FLAGS | $PCP_AWK_PROG '$2 == '"$pid"' { print "found"; exit }'` if [ -n "$found" ] then # primary pmlogger is alive and well # [ "$verbose" -gt 0 ] && echo "PID $pid" exit fi fi fi # not running, but provided there is a pmlogger executable, we could # be activated # if which pmlogger >/dev/null then status=1 else status=2 [ "$verbose" -gt 0 ] && echo "no pmlogger executable" fi elif $lflag then [ "$verbose" -gt 0 ] && echo "Archive logger - record performance data for subsequent replay" elif $aflag then _ctl_svc activate pmlogger || status=1 elif $dflag then _ctl_svc deactivate pmlogger || status=1 else [ $verbose -gt 0 ] && echo "botch sflag=$sflag aflag=$aflag dflag=$dflag show_me=$show_me verbose=$verbose" status=99 fi exit