- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Format "cmviewcl" output
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
04-18-2002 07:10 AM
04-18-2002 07:10 AM
PACKAGE STATUS STATE PKG_SWITCH CURRENT_NODE PRIMARY_NODE
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2002 07:53 AM
04-18-2002 07:53 AM
Re: Format "cmviewcl" output
Perhaps something like this?
cmviewcl | sort -u |sed '/^$/d' |head -4
if you have 3 pakages then head -4
2 packages -> head -3
1 packages -> head -2
Hope this help,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2002 08:15 AM
04-18-2002 08:15 AM
Re: Format "cmviewcl" output
I would like to display 6 columns like follows:
1st column: PACKAGE
2nd column: STATUS
3rd column: STATE
4th column: PKG_SWITCH
5th column: CURRENT NODE
6th column: PRIMARY NODE
I can display first 5 columns with the following command:
cmviewcl -l package | grep -v PACK
What I want is to display the 6th column.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2002 08:31 AM
04-18-2002 08:31 AM
SolutionSomething like this?
echo "PACKAGE STATUS STATE PKG_SWITCH NODE Primary"
for i in `cmviewcl | sort -u |sed '/^$/d' |head -4 | tail -3| sed 's/\ \{1,\}/#/g'`
do
PKG=`echo $i | cut -d"#" -f2`
PRI=`cmviewcl -v -p $PKG | grep "Primary"|sed 's/\ \{1,\}/#/g' | cut -d"#" -f5`
echo "$i#$PRI" |sed 's/#/ /g'
done
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2002 08:34 AM
04-18-2002 08:34 AM
Re: Format "cmviewcl" output
This is the script.
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2002 08:36 AM
04-18-2002 08:36 AM
Re: Format "cmviewcl" output
#!/usr/bin/sh
#
cmviewcl -l package | grep -v PACK | {
while read PACKAGE STATUS STATE SWITCH CURRNODE
do
if [[ -z ${PACKAGE} ]];
then continue
fi
PRIMARY=$(cmviewcl -v -l package -p ${PACKAGE} | grep " Primary" | awk '{print
$4}')
printf "%12s %12s %12s %12s %12s %12s\n" ${PACKAGE} ${STATUS} ${STATE} ${SWITCH
} ${CURRNODE} ${PRIMARY}
done
}
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2002 09:12 AM
04-18-2002 09:12 AM
Re: Format "cmviewcl" output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2002 12:44 AM
04-19-2002 12:44 AM
Re: Format "cmviewcl" output
#!/usr/bin/sh
#
cmviewcl -l package -v|grep -e "^ [^ ]" -e "(current)" | {
while read PACKAGE STATUS STATE SWITCH CURRNODE
do
if [[ -z ${PACKAGE} || ${STATUS} = STATUS ]];
then continue
fi
read A B C PRIMARY E || exit
printf "%12s %12s %12s %12s %12s %12s\n" ${PACKAGE} ${STATUS} ${STATE} ${SWITCH
} ${CURRNODE} ${PRIMARY}
done
}
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2002 01:31 AM
04-19-2002 01:31 AM
Re: Format "cmviewcl" output
You can try to extract the information from the /etc/cmcluster/pakagename/pakagename.conf file, in order to do this you can try this:
PRI=`grep "^NODE_NAME" /etc/cmcluster/$PKG/$PKG.conf | head -1 | sed 's/\ \{1,\}/#/g' | cut -d"#" -f2`
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2003 09:49 AM
06-18-2003 09:49 AM
Re: Format "cmviewcl" output
PKG STATUS STATE PKG_SWTCH CURRENT_NODE PRIMARY_NODE
DB1 up running enabled server1 server1
DB2 up running enabled server1 server2
DB3 up running enabled server2 server1
.
.
.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2003 10:17 AM
06-18-2003 10:17 AM
Re: Format "cmviewcl" output
FILE-/tmp/cmviewcl.log
cmviewcl > $FILE
if [ ! $? ] || grep -v unowned $FILE | egrep -q ' down| failed'; then
COLOR="red"
elif grep -v unowned $FILE | egrep -q ' unknown| initializing| reforming| halted'; then
COLOR="yellow"
else
COLOR="green"
fi
Once it is in a file, then you can format the data any way you want...plus, you can go back and verify the contents...
Rgds...Geoff