<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script for Failover Notification in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430993#M672589</link>
    <description>&lt;!--!*#--&gt;A very simple script I have written for an ex-colleague of mine who took over a couple of HPUX servers and not well versed in MCSG or posix shell programming. Hope it helps you. You can put it in crontab to run at whatever frequency you wish to do it.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;# script name : cluster_mon&lt;BR /&gt;# script location : /etc/cmcluster&lt;BR /&gt;# prerequisites :&lt;BR /&gt;# ... run the following command prior to first run of this script&lt;BR /&gt;# ... cmviewcl &amp;gt; /etc/cmcluster/cluster_status.out&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;notify_list=me@mydomain.com&lt;BR /&gt;&lt;BR /&gt;cmviewcl &amp;gt; /var/tmp/cluster_status.out&lt;BR /&gt;&lt;BR /&gt;diff /etc/cmcluster/cluster_status.out /var/tmp/cluster_status.out &amp;gt; /dev/null&lt;BR /&gt;r=${?}&lt;BR /&gt;&lt;BR /&gt;case $r in &lt;BR /&gt;0) echo "cluster is stable at $(date)" &amp;gt;&amp;gt; /var/adm/cluster_mon.log&lt;BR /&gt;exit 0&lt;BR /&gt;;;&lt;BR /&gt;1) echo "cluster status has changed since last check. $(date)" &amp;gt;&amp;gt; /var/adm/cluster_mon.log&lt;BR /&gt;echo "PREVIOUS CLUSTER STATUS\n" &amp;gt; /var/tmp/mailfile&lt;BR /&gt;cat /etc/cmcluster/cluster_status.out &amp;gt;&amp;gt; /var/tmp/mailfile&lt;BR /&gt;echo "\n\n\nCURRENT CLUSTER STATUS\n" &amp;gt;&amp;gt; /var/tmp/mailfile&lt;BR /&gt;cat /var/tmp/cluster_status.out &amp;gt;&amp;gt; /var/tmp/mailfile&lt;BR /&gt;echo "\n\n\n\nChanges found in the cluster status since the last check at $(date) &amp;gt;&amp;gt; /var/tmp/mailfile&lt;BR /&gt;cat /var/tmp/mailfile | mailx -s "Cluster Status Change ALERT !!" $notify_list&lt;BR /&gt;mv /var/tmp/cluster_status.out /etc/cmcluster/cluster_status.out&lt;BR /&gt;;;&lt;BR /&gt;*) MSG="Diff returned an unknown error while comparing cluster status files. Please investigate. $(date)"&lt;BR /&gt;echo $MSG &amp;gt;&amp;gt; /var/adm/cluster_mon.log&lt;BR /&gt;echo $MSG | mailx -s "ERROR while cheking cluster status" $notify_list&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;</description>
    <pubDate>Wed, 03 Jun 2009 13:26:10 GMT</pubDate>
    <dc:creator>Mel Burslan</dc:creator>
    <dc:date>2009-06-03T13:26:10Z</dc:date>
    <item>
      <title>Script for Failover Notification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430988#M672584</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm looking for a script which could send a email notification when ever a package failover happen.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ricky</description>
      <pubDate>Tue, 02 Jun 2009 09:30:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430988#M672584</guid>
      <dc:creator>ricky2</dc:creator>
      <dc:date>2009-06-02T09:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Failover Notification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430989#M672585</link>
      <description>A package failover is a combination of two operations: halting the package on one node and starting it on another. If you want to perform an action at failover, you should add the action to either one of these operations.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;The simplest method would be to add a command for sending the email to package startup actions:&lt;BR /&gt;&lt;BR /&gt;mailx -s "Package startup on node $(hostname)" someone@company.example &lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;(The example command above leaves the message content empty, as everything that needs to be said fits in the message subject.)&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Tue, 02 Jun 2009 10:01:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430989#M672585</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2009-06-02T10:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Failover Notification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430990#M672586</link>
      <description>We set up in 2 ways&lt;BR /&gt;&lt;BR /&gt;1) write a small script for cmviewl and cron it every 15 minutes&lt;BR /&gt;&lt;BR /&gt;2) We had a maintenance script, that emailed whenever there was a failover&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Jun 2009 03:49:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430990#M672586</guid>
      <dc:creator>Basheer_2</dc:creator>
      <dc:date>2009-06-03T03:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Failover Notification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430991#M672587</link>
      <description>Thanks Bashir,&lt;BR /&gt;&lt;BR /&gt;Could you please share those scripts?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ricky</description>
      <pubDate>Wed, 03 Jun 2009 12:37:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430991#M672587</guid>
      <dc:creator>ricky2</dc:creator>
      <dc:date>2009-06-03T12:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Failover Notification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430992#M672588</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Build a a call to build an attachment into your cluster scripts.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hpux.ws/?p=7" target="_blank"&gt;http://www.hpux.ws/?p=7&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;That script will enable you to send out an email with an attachment.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 03 Jun 2009 13:14:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430992#M672588</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-06-03T13:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Failover Notification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430993#M672589</link>
      <description>&lt;!--!*#--&gt;A very simple script I have written for an ex-colleague of mine who took over a couple of HPUX servers and not well versed in MCSG or posix shell programming. Hope it helps you. You can put it in crontab to run at whatever frequency you wish to do it.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;# script name : cluster_mon&lt;BR /&gt;# script location : /etc/cmcluster&lt;BR /&gt;# prerequisites :&lt;BR /&gt;# ... run the following command prior to first run of this script&lt;BR /&gt;# ... cmviewcl &amp;gt; /etc/cmcluster/cluster_status.out&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;notify_list=me@mydomain.com&lt;BR /&gt;&lt;BR /&gt;cmviewcl &amp;gt; /var/tmp/cluster_status.out&lt;BR /&gt;&lt;BR /&gt;diff /etc/cmcluster/cluster_status.out /var/tmp/cluster_status.out &amp;gt; /dev/null&lt;BR /&gt;r=${?}&lt;BR /&gt;&lt;BR /&gt;case $r in &lt;BR /&gt;0) echo "cluster is stable at $(date)" &amp;gt;&amp;gt; /var/adm/cluster_mon.log&lt;BR /&gt;exit 0&lt;BR /&gt;;;&lt;BR /&gt;1) echo "cluster status has changed since last check. $(date)" &amp;gt;&amp;gt; /var/adm/cluster_mon.log&lt;BR /&gt;echo "PREVIOUS CLUSTER STATUS\n" &amp;gt; /var/tmp/mailfile&lt;BR /&gt;cat /etc/cmcluster/cluster_status.out &amp;gt;&amp;gt; /var/tmp/mailfile&lt;BR /&gt;echo "\n\n\nCURRENT CLUSTER STATUS\n" &amp;gt;&amp;gt; /var/tmp/mailfile&lt;BR /&gt;cat /var/tmp/cluster_status.out &amp;gt;&amp;gt; /var/tmp/mailfile&lt;BR /&gt;echo "\n\n\n\nChanges found in the cluster status since the last check at $(date) &amp;gt;&amp;gt; /var/tmp/mailfile&lt;BR /&gt;cat /var/tmp/mailfile | mailx -s "Cluster Status Change ALERT !!" $notify_list&lt;BR /&gt;mv /var/tmp/cluster_status.out /etc/cmcluster/cluster_status.out&lt;BR /&gt;;;&lt;BR /&gt;*) MSG="Diff returned an unknown error while comparing cluster status files. Please investigate. $(date)"&lt;BR /&gt;echo $MSG &amp;gt;&amp;gt; /var/adm/cluster_mon.log&lt;BR /&gt;echo $MSG | mailx -s "ERROR while cheking cluster status" $notify_list&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Jun 2009 13:26:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430993#M672589</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-06-03T13:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Failover Notification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430994#M672590</link>
      <description>Shalom Steven,&lt;BR /&gt;&lt;BR /&gt;Could you be more clear about attachment into my cluster scripts?&lt;BR /&gt;How does it help me?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ricky</description>
      <pubDate>Wed, 03 Jun 2009 13:57:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430994#M672590</guid>
      <dc:creator>ricky2</dc:creator>
      <dc:date>2009-06-03T13:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Failover Notification</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430995#M672591</link>
      <description>View the output from the cmviewcl command. If running SG version 11.17 or later you have the -f switch available. &lt;BR /&gt;&lt;BR /&gt;Can use sudo to execute as a non-root user.&lt;BR /&gt;&lt;BR /&gt;sudo /usr/sbin/cmviewcl -f line | grep owner | awk -F= '{print $2}'&lt;BR /&gt;&lt;BR /&gt;This command will tell you who the owner is of a particular package.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Jun 2009 17:35:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-failover-notification/m-p/4430995#M672591</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2009-06-03T17:35:47Z</dc:date>
    </item>
  </channel>
</rss>

