Operating System - HP-UX
1748169 Members
4111 Online
108758 Solutions
New Discussion юеВ

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 2
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,