#!/bin/bash
#
# sccl_list_process listet einen Prozess im Script-Cluster auf
#
# Aufruf:
#
# sccl_list_process <prozess>
#
# Der Prozess <prozess> wird im ScriptCluster gesucht
#
########################################################################################
#
. `dirname $0`/globals.functions
#
PROZESS=$1
#
#
for i in $NODES $SLAVENODES
 do
  if [[ ($i = $THISHOSTNAME || $i = $THISFQDN) && $ADMINFLG = 1 ]]
   then
    ps -efa | egrep -v 'grep|sccl' | grep -i "$PROZESS"
  else
    if ! readnode $i "sccl_list_process.s3w" | grep -i "$PROZESS"
     then
      if [[ "$HBNODES" = *"$i$HBNODE_EXT"* ]]
       then
        readnode $i$HBNODE_EXT "sccl_list_process.s3w" | grep -i "$PROZESS"
      else
        exit 1
      fi
    fi
  fi
done
