HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

setting email alert when cluster failover to another node

 
sprakash1980
Occasional Advisor

setting email alert when cluster failover to another node

Hi..

I would like to know how to set the email alert so that i can receive email when the HP UX cluster failover to another node. Please Help
2 REPLIES
kemo
Trusted Contributor

Re: setting email alert when cluster failover to another node

simple script can check the package owner and send alert in case of failover.
Note:
1- save the script in a file, run it with nohup and in the background.
2- this will check the cluster every 1 hour. change the 3600 sec to the period you want.
===================================
#!/usr/bin/ksh
cmviewcl|grep cmspkg|awk -F " " '{ print $5 }' >/tmp/running
running=`cat /tmp/running`
while true
do
cmviewcl|grep cmspkg|awk -F " " '{ print $5 }' >/tmp/active
active=`cat /tmp/active`
if [ $active = $running ]
then
sleep 3600
continue
else
running=`cat /tmp/active`
echo " failover occured" > /tmp/sending
mailx -s "FileSystem Space Alert" "your email" < /tmp/sending&
sleep 3600
fi
done

=========================================

thanks
kamal
rariasn
Honored Contributor

Re: setting email alert when cluster failover to another node

Hi:

Adjust the control file of each cluster package: when initialize the package send a notice via email.


echo ""|mailx -m -s "Node \"$(hostname)\": Package PKG_XXXXXX start ERROR at $(date)" username@company.com

echo ""|mailx -m -s "Node \"$(hostname)\": Package PKG_XXXXXX start OK at $(date)" username@company.com

echo ""|mailx -m -s "Node \"$(hostname)\": Package PKG_XXXXXX halt ERROR at $(date)" username@company.com

echo ""|mailx -m -s "Node \"$(hostname)\": Package PKG_XXXXXX halt OK at $(date)" username@company.com

rgs,