[Linux-cluster] determine active or passive node
Lon Hohberger
lhh at redhat.com
Wed Dec 13 16:03:23 UTC 2006
On Wed, 2006-12-13 at 08:42 -0500, Neil Watson wrote:
> I decided to query the cluster suite directly:
>
> #!/bin/bash
>
> HOSTNAME=`hostname`
> SERVICE="db2"
> CLUSTAT=`/usr/sbin/clustat -s ${SERVICE}|tail -n1`
> # Should return:
> #db2 your-hostname started
>
> if [[ ${CLUSTAT} =~
> ${SERVICE}[[:blank:]]+${HOSTNAME}[[:blank:]]+started ]] ; then
> exit 0;
> fi
>
> # Else node is not active.
> exit 255
>
That looks similar to something someone posted awhile ago -- but I can't
seem to find it...
-- Lon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/linux-cluster/attachments/20061213/aa7d7268/attachment.sig>
More information about the Linux-cluster
mailing list