- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script for Failover Notification
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-02-2009 02:30 AM
06-02-2009 02:30 AM
Script for Failover Notification
I'm looking for a script which could send a email notification when ever a package failover happen.
Regards,
Ricky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2009 03:01 AM
06-02-2009 03:01 AM
Re: Script for Failover Notification
Only the package start operation is guaranteed to happen: if the failover happens because the original node has crashed, lost power or even burnt to ashes, the failing node is obviously not going to perform any package shutdown actions.
The simplest method would be to add a command for sending the email to package startup actions:
mailx -s "Package startup on node $(hostname)" someone@company.example
This would send a message *every* time a package starts up. It would be the job of the receiver of the message to determine whether this was a failover or a pre-planned maintenance action.
(The example command above leaves the message content empty, as everything that needs to be said fits in the message subject.)
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2009 08:49 PM
06-02-2009 08:49 PM
Re: Script for Failover Notification
1) write a small script for cmviewl and cron it every 15 minutes
2) We had a maintenance script, that emailed whenever there was a failover
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2009 05:37 AM
06-03-2009 05:37 AM
Re: Script for Failover Notification
Could you please share those scripts?
Regards,
Ricky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2009 06:14 AM
06-03-2009 06:14 AM
Re: Script for Failover Notification
Build a a call to build an attachment into your cluster scripts.
http://www.hpux.ws/?p=7
That script will enable you to send out an email with an attachment.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2009 06:26 AM
06-03-2009 06:26 AM
Re: Script for Failover Notification
#!/usr/bin/sh
# script name : cluster_mon
# script location : /etc/cmcluster
# prerequisites :
# ... run the following command prior to first run of this script
# ... cmviewcl > /etc/cmcluster/cluster_status.out
#
notify_list=me@mydomain.com
cmviewcl > /var/tmp/cluster_status.out
diff /etc/cmcluster/cluster_status.out /var/tmp/cluster_status.out > /dev/null
r=${?}
case $r in
0) echo "cluster is stable at $(date)" >> /var/adm/cluster_mon.log
exit 0
;;
1) echo "cluster status has changed since last check. $(date)" >> /var/adm/cluster_mon.log
echo "PREVIOUS CLUSTER STATUS\n" > /var/tmp/mailfile
cat /etc/cmcluster/cluster_status.out >> /var/tmp/mailfile
echo "\n\n\nCURRENT CLUSTER STATUS\n" >> /var/tmp/mailfile
cat /var/tmp/cluster_status.out >> /var/tmp/mailfile
echo "\n\n\n\nChanges found in the cluster status since the last check at $(date) >> /var/tmp/mailfile
cat /var/tmp/mailfile | mailx -s "Cluster Status Change ALERT !!" $notify_list
mv /var/tmp/cluster_status.out /etc/cmcluster/cluster_status.out
;;
*) MSG="Diff returned an unknown error while comparing cluster status files. Please investigate. $(date)"
echo $MSG >> /var/adm/cluster_mon.log
echo $MSG | mailx -s "ERROR while cheking cluster status" $notify_list
;;
esac
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2009 06:57 AM
06-03-2009 06:57 AM
Re: Script for Failover Notification
Could you be more clear about attachment into my cluster scripts?
How does it help me?
Regards,
Ricky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2009 10:35 AM
06-03-2009 10:35 AM
Re: Script for Failover Notification
Can use sudo to execute as a non-root user.
sudo /usr/sbin/cmviewcl -f line | grep owner | awk -F= '{print $2}'
This command will tell you who the owner is of a particular package.