Okay, the value of $14 is never a number. Therefore $PS is never a number.
Perhaps you need to count the hits? The awk is not necessary.
#!/usr/bin/ksh
PS=`/usr/ucb/ps -augxww | grep "ALGX_DEV__AS2" | grep -v "grep" |wc -l`
if [ ${PS} -eq 0 ]
then
/opt/OV/bin/OpC/opcmsg severity=normal application=Test object=Script msg_text="Process not running" msg_grp=Test
fi
Hmm. severity=normal ? That would reset the Openview alert after a previous failure.
Mystified. The Done lines suggest that you are putting a every command into background with an & character at the end of the line or backgrounding commands with some other method like ^Z . Very weird.
Word of warning. On a heavily loaded system ps can miss processes. It is safer to react to three consecutive failures rather than just the one. At least repeat the check at the start of the restart script and abort if the process is in fact still running.
ok i configure the script as you suggested and now output is clean but no message comes in from opcmsg?
severity was for testing only. change it to warning.
Please review the exact script you ran. Big hint, the Shell execution trace shows a comparison with the value 1 not the value 0 .
If there is still a problem, please post the script.
Ps. I really appreciate you posting the Shell execution trace. Many posters could learn from your example.