Index: pvfs2_src/examples/heartbeat/PVFS2
===================================================================
--- pvfs2_src/examples/heartbeat/PVFS2	(revision 4352)
+++ pvfs2_src/examples/heartbeat/PVFS2	(revision 4353)
@@ -27,7 +27,12 @@
 
 VARRUN=/var/run
 
+# newer versions of heartbeat have moved the ocf-shellfuncs  file
+if [ -f /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs ] ; then
+. /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
+else
 . /usr/lib/heartbeat/ocf-shellfuncs
+fi
 
 #######################################################################
 #
Index: pvfs2_src/examples/heartbeat/Filesystem-qla-monitor
===================================================================
--- pvfs2_src/examples/heartbeat/Filesystem-qla-monitor	(revision 4352)
+++ pvfs2_src/examples/heartbeat/Filesystem-qla-monitor	(revision 4353)
@@ -81,7 +81,12 @@
 #######################################################################
 # Initialization:
 
+# newer versions of heartbeat have moved the ocf-shellfuncs  file
+if [ -f /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs ] ; then
+. /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
+else
 . /usr/lib/heartbeat/ocf-shellfuncs
+fi
 
 #######################################################################
 
Index: pvfs2_src/examples/heartbeat/PVFS2-notify
===================================================================
--- pvfs2_src/examples/heartbeat/PVFS2-notify	(revision 4352)
+++ pvfs2_src/examples/heartbeat/PVFS2-notify	(revision 4353)
@@ -21,7 +21,12 @@
 #######################################################################
 # Initialization:
 
+# newer versions of heartbeat have moved the ocf-shellfuncs  file
+if [ -f /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs ] ; then
+. /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
+else
 . /usr/lib/heartbeat/ocf-shellfuncs
+fi
 
 #######################################################################
 
Index: pvfs2_src/examples/heartbeat/pvfs2-ha-heartbeat-configure.sh
===================================================================
--- pvfs2_src/examples/heartbeat/pvfs2-ha-heartbeat-configure.sh	(revision 4353)
+++ pvfs2_src/examples/heartbeat/pvfs2-ha-heartbeat-configure.sh	(revision 4354)
@@ -30,6 +30,7 @@
 echo "use_logd no" >> ${OUTDIR}/ha.cf
 echo "respawn hacluster /usr/lib/heartbeat/cibmon -d" >> ${OUTDIR}/ha.cf
 echo "crm yes" >> ${OUTDIR}/ha.cf
+echo "compression bz2" >> ${OUTDIR}/ha.cf
 
 # shift arguments down
 shift
Index: pvfs2_src/examples/heartbeat/PVFS2
===================================================================
--- pvfs2_src/examples/heartbeat/PVFS2	(revision 4354)
+++ pvfs2_src/examples/heartbeat/PVFS2	(revision 4355)
@@ -177,8 +177,18 @@
     if
       ProcessRunning $PVFS2PID
     then
-      ocf_log info "$CMD still running ($PVFS2PID)."
-      false
+      sleep 1
+      kill -9 $PVFS2PID >/dev/null 2>&1
+      ocf_log warn "Killing (-9) pvfs2-server PID $PVFS2PID"
+      sleep 5
+      if
+        ProcessRunning $PVFS2PID
+      then
+        ocf_log info "$CMD still running ($PVFS2PID)."
+        false
+      else
+        ocf_log info "$CMD stopped."
+      fi
     else
       ocf_log info "$CMD stopped."
     fi
Index: pvfs2_src/examples/heartbeat/apc-switched-pdu-hybrid-outlet-status.pl
===================================================================
--- pvfs2_src/examples/heartbeat/apc-switched-pdu-hybrid-outlet-status.pl	(revision 0)
+++ pvfs2_src/examples/heartbeat/apc-switched-pdu-hybrid-outlet-status.pl	(revision 4509)
@@ -0,0 +1,124 @@
+#!/usr/bin/perl 
+
+# requires APC MIB file, which is available for download from APC's web site
+
+# this script will first attempt to use SNMP to send power control commands,
+# and then fail back to using SSH
+
+use strict;
+use Getopt::Long;
+use File::Find;
+use File::Path;
+use POSIX qw(setsid);
+use Socket;
+
+my $host;
+my $ssh_user;
+my $ssh_pass; 
+my $snmp_user;
+my $snmp_pass;
+my $outlet;
+
+my $snmp_command;
+
+&process_args;
+
+$snmp_command = "snmpget -v3 -a MD5 -l authNoPriv -u $snmp_user -A $snmp_pass -m \"/var/lib/filesystems/powernet387.mib\" $host PowerNet-MIB::rPDUOutletControlOutletCommand.$outlet";
+
+my $snmp_output = `$snmp_command 2>&1`;
+if ( $? == 0 )
+{
+   if($snmp_output =~ /immediateOn/)
+   {
+      print "On\n";
+   }
+   elsif($snmp_output =~ /immediateOff/)
+   {
+      print "Off\n";
+   }
+   else
+   {
+      print "Unknown\n";
+   }
+
+   exit 0;
+}
+
+# no fall back to ssh implemented in this script
+
+print "Error: failed to contact APC unit.\n";
+print "SNMP output: $snmp_output";
+print "SSH unsupported in this utility.\n";
+
+exit 1;
+
+sub process_args
+{
+   # Parse the command line options
+   # For a description of the command line options see &print_help
+   use vars qw( $opt_help $opt_host $opt_ssh_user $opt_ssh_pass $opt_snmp_user $opt_snmp_pass $opt_outlet);
+
+   Getopt::Long::Configure( "no_ignore_case", "bundling");
+   GetOptions( "help",
+               "host=s",
+               "ssh-user=s",
+               "ssh-pass=s",
+               "snmp-user=s",
+               "snmp-pass=s",
+               "outlet=i");
+
+   if ($opt_help)
+   {
+      &print_help;
+      exit(0);
+   }
+
+   if(!$opt_host || !$opt_ssh_user || !$opt_ssh_pass || 
+      !$opt_snmp_user || !$opt_snmp_pass || !$opt_outlet)
+   {
+      &print_help;
+      die "Error: missing arguments.\n";
+   }
+
+   $host = $opt_host;
+   $ssh_user = $opt_ssh_user;
+   $ssh_pass = $opt_ssh_pass; 
+   $snmp_user = $opt_snmp_user;
+   $snmp_pass = $opt_snmp_pass;
+   $outlet = $opt_outlet;
+}
+
+
+# --------------- print help information ------------------------------
+sub print_help {
+
+   print <<EOF;
+
+This script will check the status of a single outlet on an APC power strip.  
+It will only attempt communication via SNMP at this time (although it accepts
+arguments for ssh authentication for future use).
+
+usage: apc-switched-pdu-hybrid-outlet-status.pl <options>
+
+options:
+   --help                   print this help and exit
+   --host        <STRING>   hostname of APC unit
+   --ssh-user    <STRING>   ssh username for APC unit
+   --ssh-pass    <STRING>   ssh password for APC unit
+   --snmp-user   <STRING>   SNMP username for APC unit
+   --snmp-pass   <STRING>   SNMP authentication pass phrase (MD5) for APC unit
+   --outlet      <INTEGER>  APC outlet to control
+
+EOF
+}
+
+# Local variables:
+#  c-basic-offset: 3
+#  perl-indent-level: 3
+#  tab-width: 3
+#  indent-tabs-mode: nil
+#  shiftwidth: 3
+# End:
+#
+# vim: ts=3 expandtab
+

Property changes on: pvfs2_src/examples/heartbeat/apc-switched-pdu-hybrid-outlet-status.pl
___________________________________________________________________
Name: svn:executable
   + *

Index: pvfs2_src/examples/heartbeat/apc-switched-pdu-hybrid-control.pl
===================================================================
--- pvfs2_src/examples/heartbeat/apc-switched-pdu-hybrid-control.pl	(revision 4508)
+++ pvfs2_src/examples/heartbeat/apc-switched-pdu-hybrid-control.pl	(revision 4509)
@@ -45,7 +45,6 @@
 my $snmp_output = `$snmp_command 2>&1`;
 if ( $? == 0 )
 {
-   print "Success, snmp\n";
    exit 0;
 }
 
@@ -55,7 +54,6 @@
 my $ssh_output = `$ssh_command 2>&1`;
 if ( $? == 0 )
 {
-   print "Success, ssh\n";
    exit 0;
 }
 
