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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Monitoring script to check if cm cluster is up or not.
# 1  
Old 01-15-2010
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

Code:
    db1pkg         up           running      enabled      box1


my script
Code:
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

Code:
check_db1pkg[9]: [up:  not found

am I missing or did something wrong here? Smilie

Last edited by pludi; 01-15-2010 at 02:23 AM.. Reason: code tags, please...
# 2  
Old 01-15-2010
The test operator requires that there be a whitespace on each side of the brackets. Add them, and it should work.
# 3  
Old 01-15-2010
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Sun cluster 4.0 - zone cluster failover doubt

Hello experts - I am planning to install a Sun cluster 4.0 zone cluster fail-over. few basic doubts. (1) Where should i install the cluster s/w binaries ?. ( global zone or the container zone where i am planning to install the zone fail-over) (2) Or should i perform the installation on... (0 Replies)
Discussion started by: NVA
0 Replies

2. High Performance Computing

How to check performance of your HPC cluster?

Hello Everybody, I have few queries : Do you have any idea how to check the performance of HPC cluster having mpich on top of centos 6.2? Are there any standard programs (like FFT, graphics rendering etc) to check the performance of mpi cluster with single node and multiple nodes? Can we... (4 Replies)
Discussion started by: albertspade
4 Replies

3. UNIX for Advanced & Expert Users

ldapsearch in monitoring script without bind password written in script

Hi I do a very simple monitoring of our OpenLDAP (runs in cronjob and generate alerts if unsuccessfull) $ ldapsearch -h hostname.domain -D "cn=monitor_user,ou=People,dc=organisation" -w "password" -b "dc=organisation" -x "(&(cn=monitor_user)(ou=People))" dn | grep -v version dn:... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

4. AIX

How to check if a filesystem is part of a cluster

Hello, - How do I know if a filesystem is part of a cluster? - Or do I have to check if the vg related to the fs is part of a cluster instead? if so, how do I check it? - I would also need to check if there are vxfs type inside aix machines and if there are, how do I know if that type of... (2 Replies)
Discussion started by: asanchez
2 Replies

5. Linux

Cluster check

I am working on a Linux server and want to check the cluster status. I dont know how many server is in cluster and what is the command to check. could you please help me to get the cluster status? (4 Replies)
Discussion started by: anshu ranjan
4 Replies

6. Shell Programming and Scripting

script to check if another script is running and if so, then sleep for sometime and check again

Hi, I am a unix newbie. I need to write a script to check wheteher another script is still running. If it is, then sleep for 30m and then check again if the script is running. If the script has stopped running then, I need to come out of the loop. I am using RHEL 5.2 (2 Replies)
Discussion started by: mathews
2 Replies

7. Shell Programming and Scripting

How to check whether server is up or down by monitoring PID?

we have a server, which becomes down at times and we dont get any notification mail. Can we monitor PID for that server run and create a script to send notification to a mail id? I have URL for the server, which I can use. Please let me know if more information is required from my end to... (2 Replies)
Discussion started by: vandana.parwani
2 Replies

8. UNIX for Dummies Questions & Answers

How to check if the server is on a Cluster

Hi im connecting to a datacenter remotely. is there a command to know if the server is on a cluster? i want to know the command to use in these OS(hp-ux,solaris,linux) Thanks (6 Replies)
Discussion started by: jinslick25
6 Replies

9. Shell Programming and Scripting

how to check all the applications are in cluster using shell script

Hi I have an application running in four different node.The server is tomcat.Each node in each tomcat server.How do i check whether all the nodes are in cluster using shell script. any command to check this would be of great use.:) (2 Replies)
Discussion started by: ahamed
2 Replies

10. High Performance Computing

Building a Solaris Cluster Express cluster in a VirtualBox on OpenSolaris

Provides a description of how to set up a Solaris Cluster Express cluster in a VirtualBox on OpenSolaris. More... (0 Replies)
Discussion started by: Linux Bot
0 Replies
Login or Register to Ask a Question