Running a trace

Here's a pair of scripts to help ease running traces. This assumes you're using the 'default' name when having configured pd, and have a 'traces' folder under your default config

webseal_trace_on

#/bin/bash

TRACE_FILE=/var/pdweb/www-default/traces/pdweb.debug.txt,rollover_size=100000000
SERVER=default-webseald-webseal3.tam.private

read -s -p "sec_master password: " PASSWD

pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.debug 9 file path=$TRACE_FILE
echo 

webseal_trace_off

#/bin/bash

SERVER=default-webseald-webseal3.tam.private

read -s -p "sec_master password: " PASSWD

pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.debug 0
echo


A more interesting case is a single script that accepts arguments

vim webseal

#/bin/bash

SERVER=default-webseald-webseal4.tam.private
DEBUG_FILE=/var/pdweb/www-default/traces/pdweb.debug.log,rollover_size=100000000
SNOOP_FILE=/var/pdweb/www-default/traces/pdweb.snoop.log,rollover_size=100000000
WAN_FSSO_FILE=/var/pdweb/www-default/traces/pdweb.wan.fsso.log,rollover_size=100000000

TASK=$1
ACTION=$2

if [ $# -lt 2 ]
then
  echo
  echo "  Useage: "
  echo "      webseal <task> <action> "
  echo
  echo "  task: "
  echo "      debug | snoop | fsso | all"
  echo
  echo "  action: "
  echo "      on | off "
  echo
  echo "  Example: "
  echo "      webseal snoop on "
  echo
  exit 1
fi

read -s -p "sec_master password: " PASSWD
echo

case $TASK in

"debug")
  case $ACTION in
    "on")
                 pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.debug 9 file path=$DEBUG_FILE;;
    "off")
        pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.debug 0;;
    *)
echo "unknown action $ACTION";;
  esac;;

"snoop")
  case $ACTION in
    "on")
      pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.snoop 9 file path=$SNOOP_FILE;;
    "off")
      pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.snoop 0;;
    *)
      echo "unknown action $ACTION";;
  esac;;

"fsso")
  case $ACTION in
    "on")
        pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.wan.fsso 9 file path=$WAN_FSSO_FILE;;
    "off")
        pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.wan.fsso 0;;
    *)
      echo "unknown action $ACTION";;
  esac;;

"all")
  case $ACTION in
    "on")
        pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.debug 9 file path=$DEBUG_FILE
        pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.snoop 9 file path=$SNOOP_FILE
      pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.wan.fsso 9 file path=$WAN_FSSO_FILE;;
    "off")
        pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.debug 0
        pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.snoop 0
      pdadmin -a sec_master -p $PASSWD server task $SERVER trace set pdweb.wan.fsso 0;;
    *)
      echo "unknown action $ACTION";;
  esac;;

*)
  echo
  echo "Unkown task $TASK"
  echo
  ;;

esac

echo



Comments