Monitoring script to check if cm cluster is up or not.

hi guys have this little problem, need some help from script gurus.

basically I'm running hpux cmviewcl command, cmviewcl command will produce

    db1pkg         up           running      enabled      box1

my script

PSV='box1'
STAT='up'

check_db1pkg()
{
# assign cmviewcl output to x
x=`cmviewcl | grep db1pkg`
#
# setup an array 'ARR' to do matching
#
set -A ARR $x
#test 'up'
if [${ARR[1]} -ne ${STAT}] -o [${ARR[4]} -ne ${PSV}];then
send_sms;
else
echo "db1pkg all fine as at `date`" > /var/tmp/heartbeat
fi

when I run this script it will says

check_db1pkg[9]: [up:  not found

am I missing or did something wrong here? :confused:

The test operator requires that there be a whitespace on each side of the brackets. Add them, and it should work.

alright it works with the space padded on either side of brackets. thanx for the tip pludi.

I also wrongly added "-ne" it should be "!=" instead.