- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to write a script to find the status of Cluste...
Operating System - HP-UX
1824983
Members
3882
Online
109678
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2008 01:15 AM
06-17-2008 01:15 AM
how to write a script to find the status of Cluster system
Hi,
We have two node HP-UX 11i v2 11.23 rx5670 Cluster production system. We can check the Cluster health statuts by using cmviewcl and cmviewcl -v command.
Could any one help to write a script for check the cluster health status and send the output into another file?
Thanks
Khairul
We have two node HP-UX 11i v2 11.23 rx5670 Cluster production system. We can check the Cluster health statuts by using cmviewcl and cmviewcl -v command.
Could any one help to write a script for check the cluster health status and send the output into another file?
Thanks
Khairul
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2008 01:22 AM
06-17-2008 01:22 AM
Re: how to write a script to find the status of Cluster system
Hi khairul,
Please find the script. This may help you to check the health of the cluster.
#!/bin/sh
#check for the output file. If yes, delete it.
if [ -f /tmp/output.txt ]
then
rm -f /tmp/output.txt
fi
clust_status=$(cmviewcl -f line -l cluster| grep -e status|cut -d = -f 2,2)
if [ "$clust_status" = "up" ]
then
# Exclude Multi-node packages in the cmviewcl output.
for pkg_name in $(cmviewcl -f line -l package|grep -e type|grep -v multi_node|cu
t -d : -f 2,2 | cut -d "|" -f 1,1)
do
running_node=$(cmviewcl -v -p $pkg_name | grep current | awk '{print $1}')
node_name=$(cmviewcl -v -p $pkg_name | grep current | awk '{print $4}')
if [ "$running_node" = "Primary" ]
then
...skipping...
#!/bin/sh
#check for the output file. If yes, delete it.
if [ -f /tmp/output.txt ]
then
rm -f /tmp/output.txt
fi
clust_status=$(cmviewcl -f line -l cluster| grep -e status|cut -d = -f 2,2)
if [ "$clust_status" = "up" ]
then
# Exclude Multi-node packages in the cmviewcl output.
for pkg_name in $(cmviewcl -f line -l package|grep -e type|grep -v multi_node|cut -d : -f 2,2 | cut -d "|" -f 1,1)
do
running_node=$(cmviewcl -v -p $pkg_name | grep current | awk '{print $1}')
node_name=$(cmviewcl -v -p $pkg_name | grep current | awk '{print $4}')
if [ "$running_node" = "Primary" ]
then
echo $pkg_name running in Primary node $node_name. >> /tmp/output.txt
elif [ "$(cmviewcl -f line -l package -p $pkg_name|grep -e status|cut -d = -f 2,2)" != "up" ]
then
echo $pkg_name package totally down. Not running in Primary $node_name as well as secondary $node_name. >> /tmp/output.txt
else
echo $pkg_name running in Secondary node $node_name. >> /tmp/output.txt
fi
done
#mailx -s "Cluster status" aaa@bbb.com < /tmp/output.txt
else
echo "Cluster not up" >> /tmp/output.txt
fi
Please find the script. This may help you to check the health of the cluster.
#!/bin/sh
#check for the output file. If yes, delete it.
if [ -f /tmp/output.txt ]
then
rm -f /tmp/output.txt
fi
clust_status=$(cmviewcl -f line -l cluster| grep -e status|cut -d = -f 2,2)
if [ "$clust_status" = "up" ]
then
# Exclude Multi-node packages in the cmviewcl output.
for pkg_name in $(cmviewcl -f line -l package|grep -e type|grep -v multi_node|cu
t -d : -f 2,2 | cut -d "|" -f 1,1)
do
running_node=$(cmviewcl -v -p $pkg_name | grep current | awk '{print $1}')
node_name=$(cmviewcl -v -p $pkg_name | grep current | awk '{print $4}')
if [ "$running_node" = "Primary" ]
then
...skipping...
#!/bin/sh
#check for the output file. If yes, delete it.
if [ -f /tmp/output.txt ]
then
rm -f /tmp/output.txt
fi
clust_status=$(cmviewcl -f line -l cluster| grep -e status|cut -d = -f 2,2)
if [ "$clust_status" = "up" ]
then
# Exclude Multi-node packages in the cmviewcl output.
for pkg_name in $(cmviewcl -f line -l package|grep -e type|grep -v multi_node|cut -d : -f 2,2 | cut -d "|" -f 1,1)
do
running_node=$(cmviewcl -v -p $pkg_name | grep current | awk '{print $1}')
node_name=$(cmviewcl -v -p $pkg_name | grep current | awk '{print $4}')
if [ "$running_node" = "Primary" ]
then
echo $pkg_name running in Primary node $node_name. >> /tmp/output.txt
elif [ "$(cmviewcl -f line -l package -p $pkg_name|grep -e status|cut -d = -f 2,2)" != "up" ]
then
echo $pkg_name package totally down. Not running in Primary $node_name as well as secondary $node_name. >> /tmp/output.txt
else
echo $pkg_name running in Secondary node $node_name. >> /tmp/output.txt
fi
done
#mailx -s "Cluster status" aaa@bbb.com < /tmp/output.txt
else
echo "Cluster not up" >> /tmp/output.txt
fi
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP