- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Alert if the package and node is down.
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
06-09-2008 01:19 AM
06-09-2008 01:19 AM
I have a 2 node Active active configuration cluster based around Oracle RAC and SG. I need to send an email to admin if there is any failure in the cluster i.e. either package failure or the node itself and the packages currently active in the node etc. Any idea on which method I can use so that I will get the required functionality. Any sample scripts will help me to proceed in best way.
Thanks,
Srini
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 01:49 AM
06-09-2008 01:49 AM
Re: Alert if the package and node is down.
1. User script in the package control file - when package goes down, script will send an email.
2. Crontab script to monitor package/cluster status every 5-10 min.
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 02:17 AM
06-09-2008 02:17 AM
Re: Alert if the package and node is down.
Any sample scripts which can be used in general to know the status of all the packages? I can run cmviewcl -v -p pkg_name |grep current|awk '{print $4}' to identify which node is running that particular package. I need the generailzed script to know the status of all the packages.
Regards,
Srini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 03:00 AM
06-09-2008 03:00 AM
Re: Alert if the package and node is down.
why don't you just use cmviewcl command ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 03:20 AM
06-09-2008 03:20 AM
Re: Alert if the package and node is down.
Currently I have a script like
primary=prinode
running=`cmviewcl -v -p prodnfs |grep current | awk '{print $4}'`
if [ "$running" = "$primary" ]
then
exit
else
/usr/bin/bttrap sysFailureMajor application is not running on its Primary Node.Contact admin Immediately
fi
What I need is intead of one package, I need the status of all the packages in the cluster even if I add a new package.
Regards,
Srini.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 04:25 AM
06-09-2008 04:25 AM
SolutionHope it helps:
for pkg_name in $(cmviewconf | grep 'package name'| awk '{print $3}')
do
running_node=$(cmviewcl -v -p $pkg_name | grep current | awk '{print $1}');
if [ "$running_node" = "Primary" ]
then
//do something if package is running in it's primary node
else
//do something if package is not running in it's primary node
fi
done
for pkg_name in $(cmviewcl | grep 'down' | awk '{print $1}')
do
//do something with $pkg_name
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 04:32 AM
06-09-2008 04:32 AM
Re: Alert if the package and node is down.
Using the package control script to spawn an email when a package is halted may not produce the results you need. There are two cases that come to mind
1) node outage = no way the package halt script will be run
2) manual package maintenance, moving it to another node
Though not as timely, a cron job may produce more legitimate information.
To determine package status, check this:
To find all package status
# cmviewcl -v -f line | grep ^package: | grep "|status=" | grep -v node:
package:SG-CFS-pkg|status=up
package:CFSdg|status=up
package:CFSdg-vol1|status=up
package:CFSdg-vol2|status=up
package:CFSdg-vol3|status=up
package:P1|status=down
package:p2|status=down
package:henry|status=up
package:testpkg|status=up
To filter just the down packages:
# cmviewcl -v -f line | grep ^package: | grep "|status=" | grep -v node: | grep =down
package:P1|status=down
package:p2|status=down
And to get just the names of the packages that are down:
# cmviewcl -v -f line | grep ^package: | grep "|status=" | grep -v node: | grep =down | cut -d : -f 2,2 | cut -d "|" -f 1,1
P1
p2
Now, you can write a script to send an email if any results return, and link it to a cron job.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 06:36 AM
06-09-2008 06:36 AM
Re: Alert if the package and node is down.
Stephen,
cmviewcl -f line -l package|grep -e status give only the status of the packages but not on the node it's running. Any other formatting to acheive this?
Kenan,
How can I eliminate the multi-node packages in the output.
Regards,
Srini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 06:59 AM
06-09-2008 06:59 AM
Re: Alert if the package and node is down.
#!/usr/bin/sh
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}');
if [ "$running_node" = "Primary" ]
then
echo $pkg_name running in Primary
else
echo $pkg_name not running in Primary
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2008 02:06 AM
06-11-2008 02:06 AM
Re: Alert if the package and node is down.
check this script
#!/usr/bin/ksh
##########################
DATE=`date +%Y.%m.%d`
TIME=`date +%X`
cmviewcl -v >/tmp/clstatus-file
#Checking TESTPKG
check1=`more clstatus-file|awk '{if($1=="testpkg")
if($5=="node1") print "TEST IS FAILOVER"
else if($2=="down") print "TEST IS HALTED"
else continue}'`
if [ "$check1" ]
then
mailx -s "$check1-$DATE-$TIME" admin@node1.com
//send sms also
fi
====================================
set this script in ur cron in every 5 min.
Thanks & Regards
Aashique
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2008 06:14 AM
06-11-2008 06:14 AM
Re: Alert if the package and node is down.
I wrote the generalised script for the required functionality.
#!/usr/bin/sh
if [ -f /tmp/output.txt ]
then
rm /tmp/output.txt
fi
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)" = "down" ]
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" oracle < /tmp/output.txt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2008 01:09 AM
06-17-2008 01:09 AM