Hi ,
We have 6 informatica workflow engine running on our server , so if we do a
ubnf0010% ps -ef |grep workflow |grep "TCPP01 TCPP01"
atlmsts 12721 1 0 06:52:18 ? 14:58 workflow TCPP01 TCPP01 1
atlmsts 14415 1 0 06:52:44 ? 14:56 workflow TCPP01 TCPP01 2
atlmsts 21876 1 0 06:54:07 ? 14:50 workflow TCPP01 TCPP01 5
atlmsts 19720 1 0 06:53:40 ? 15:02 workflow TCPP01 TCPP01 4
atlmsts 23736 1 0 06:54:25 ? 14:39 workflow TCPP01 TCPP01 6
atlmsts 17785 1 0 06:53:17 ? 14:53 workflow TCPP01 TCPP01 3
all 6 are shown running .
At times there is 1 or multiple engine failure, in that suppose 2 and 5 fails, when we do a
ubnf0010% ps -ef |grep workflow |grep "TCPP01 TCPP01"
Select records containing "workflow TCPP01 TCPP01" before last fiels (which is engine number).
NF is the totaal number of fields in the input record processed.
++p[$NF]
Increment the element for the engine ($NF is last fied) in the p array
END { ... }
When all input record have been processed
for (i=1; i<=count; i++) { ... }
I is the engine, number
if (! p)
print "engine not running:",i
If the element for the engine in the p array is 0 (not different of zero) the print message.
Use gawk instead of awk (on my system it's the same thing).
This solutions works only with gawk because the time functions aren't defined with other versions of awk.
LIST=$( ps -ef | grep 'workflow' - )
for NO in {1..6}
do
TEST=$( echo "$LIST" | grep "TCPP01 TCPP01 $NO" - )
if [ "$TEST" = "" ]
then
echo "Engine no. $NO down (?)."
fi
done