All of lore.kernel.org
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/fence/agents/ilo fence_ilo.pl
Date: 25 Jun 2007 21:48:26 -0000	[thread overview]
Message-ID: <20070625214826.23723.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2007-06-25 21:48:26

Modified files:
	fence/agents/ilo: fence_ilo.pl 

Log message:
	HP changed the iLO 2 interface again in the latest firmware revision, 1.30 (released on 2007-06-01)
	
	I tested this on iLO 2 firmware revisions 1.26, 1.29, and 1.30

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/ilo/fence_ilo.pl.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.1&r2=1.5.2.2

--- cluster/fence/agents/ilo/fence_ilo.pl	2007/05/10 19:42:24	1.5.2.1
+++ cluster/fence/agents/ilo/fence_ilo.pl	2007/06/25 21:48:26	1.5.2.2
@@ -1,4 +1,17 @@
 #!/usr/bin/perl 
+
+###############################################################################
+###############################################################################
+##
+##  Copyright (C) 2006-2007 Red Hat, Inc.  All rights reserved.
+##  
+##  This copyrighted material is made available to anyone wishing to use,
+##  modify, copy, or redistribute it subject to the terms and conditions
+##  of the GNU General Public License v.2.
+##
+###############################################################################
+###############################################################################
+
 $|=1;
 
 eval { $ssl_mod="Net::SSL" if require Net::SSL} || 
@@ -14,6 +27,9 @@
 # "#END_VERSION_GENERATION"  It is generated by the Makefile
 
 #BEGIN_VERSION_GENERATION
+$FENCE_RELEASE_NAME="";
+$REDHAT_COPYRIGHT="";
+$BUILD_DATE="";
 #END_VERSION_GENERATION
 
 # Get the program name from $0 and strip directory names
@@ -35,6 +51,7 @@
 	print "  -l <name>        Login name\n";
 	print "  -o <string>      Action: reboot (default), off, on or status\n";
 	print "  -p <string>      Login password\n";
+	print "  -S <path>        Script to run to retrieve login password\n";
 	print "  -q               quiet mode\n";
 	print "  -V               version\n";
 	print "  -v               verbose\n";
@@ -62,7 +79,7 @@
 sub version
 {
 	print "$pname $FENCE_RELEASE_NAME $BUILD_DATE\n";
-	print "$SISTINA_COPYRIGHT\n" if ( $SISTINA_COPYRIGHT );
+	print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
 	exit 0;
 }
 
@@ -262,10 +279,13 @@
 
 	foreach my $line (@response)
 	{
+		if ($line =~ /FIRMWARE_VERSION\s*=\s*\"(.*)\"/) {
+			$firmware_rev = $1;
+		}
 		if ($line =~ /MANAGEMENT_PROCESSOR\s*=\s*\"(.*)\"/) {
 			if ($1 eq "iLO2") {
 				$ilo_vers = 2;
-				print "power_status: reporting iLO2\n" if ($verbose);
+				print "power_status: reporting iLO2 $firmware_rev\n" if ($verbose);
 			}
 		}
 
@@ -341,7 +361,11 @@
 		# HOLD_PWR_BUTTON is used to power the machine off, and
 		# PRESS_PWR_BUTTON is used to power the machine on;
 		# when the power is off, HOLD_PWR_BUTTON has no effect.
-		sendsock $socket, "<HOLD_PWR_BTN/>\n";
+		if ($firmware_rev > 1.29) {
+			sendsock $socket, "<HOLD_PWR_BTN TOGGLE=\"Yes\" />\n";
+		} else {
+			sendsock $socket, "<HOLD_PWR_BTN/>\n";
+		}
 	}
 	# As of firmware version 1.71 (RIBCL 2.21) The SET_HOST_POWER command
 	# is no longer available.  HOLD_PWR_BTN and PRESS_PWR_BTN are used 
@@ -472,6 +496,10 @@
 		{
 			$passwd = $val;
 		}
+		elsif ($name eq "passwd_script" )
+		{
+			$passwd_script = $val;
+		}
 		elsif ($name eq "ribcl" )
 		{
 			$ribcl_vers = $val;
@@ -490,9 +518,10 @@
 $action = "reboot";
 $ribcl_vers = undef; # undef = autodetect
 $ilo_vers = 1;
+$firmware_rev = 0;
 
 if (@ARGV > 0) {
-	getopts("a:hl:n:o:p:r:qvV") || fail_usage ;
+	getopts("a:hl:n:o:p:S:r:qvV") || fail_usage ;
 
 	usage if defined $opt_h;
 	version if defined $opt_V;
@@ -505,7 +534,15 @@
 	fail_usage "No '-l' flag specified." unless defined $opt_l;
 	$username = $opt_l;
 
-	fail_usage "No '-p' flag specified." unless defined $opt_p;
+	if (defined $opt_S) {
+		$pwd_script_out = `$opt_S`;
+		chomp($pwd_script_out);
+		if ($pwd_script_out) {
+			$opt_p = $pwd_script_out;
+		}
+	}
+
+	fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
 	$passwd   = $opt_p;
 
 	$action = $opt_o if defined $opt_o;
@@ -525,6 +562,15 @@
 
 	fail "no host\n" unless defined $hostname;
 	fail "no login name\n" unless defined $username;
+
+	if (defined $passwd_script) {
+		$pwd_script_out = `$passwd_script`;
+		chomp($pwd_script_out);
+		if ($pwd_script_out) {
+			$passwd = $pwd_script_out;
+		}
+	}
+
 	fail "no password\n" unless defined $passwd;
 
 	fail "unrecognised action: $action\n"



             reply	other threads:[~2007-06-25 21:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-25 21:48 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-01-15 16:21 [Cluster-devel] cluster/fence/agents/ilo fence_ilo.pl rmccabe
2008-01-15 16:18 rmccabe
2007-07-17 18:38 rmccabe
2007-06-25 21:57 rmccabe
2007-06-25 21:47 rmccabe
2007-04-09 15:22 rmccabe
2007-04-09 15:20 rmccabe
2007-04-04 19:24 rmccabe
2007-04-04 19:15 rmccabe
2007-02-20 22:02 rmccabe
2007-02-19 17:09 rmccabe
2006-08-16 19:11 jparsons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070625214826.23723.qmail@sourceware.org \
    --to=rmccabe@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.