[Cluster-devel] fence-agents: master - fencing: Remove unmaintained fence agents

Fabio M. Di Nitto fdinitto at redhat.com
Tue Jun 10 08:36:27 UTC 2014


On 6/9/2014 3:58 PM, Marek Grác wrote:
> Gitweb:        http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=9caf5a23e58b52e05042674260eb1f1aa6d22558
> Commit:        9caf5a23e58b52e05042674260eb1f1aa6d22558
> Parent:        77c8c858a41da9e593f5f630ff42924211248a9b
> Author:        Marek 'marx' Grac <mgrac at redhat.com>
> AuthorDate:    Mon Jun 9 15:47:09 2014 +0200
> Committer:     Marek 'marx' Grac <mgrac at redhat.com>
> CommitterDate: Mon Jun 9 15:47:09 2014 +0200
> 
> fencing: Remove unmaintained fence agents
> 
> Following agents were removed:
> fence_baytech
> fence_bullpap
> fence_cpint
> fence_mcdata
> fence_rackswitch
> fence_vixel
> fence_xcat
> ---
>  configure.ac                             |    9 -
>  fence/agents/baytech/Makefile.am         |   17 -
>  fence/agents/baytech/fence_baytech.pl    |  746 ---------------------------
>  fence/agents/bullpap/Makefile.am         |   17 -
>  fence/agents/bullpap/fence_bullpap.pl    |  433 ----------------
>  fence/agents/cpint/Makefile.am           |   17 -
>  fence/agents/cpint/fence_cpint.pl        |  188 -------
>  fence/agents/egenera/Makefile.am         |   17 -
>  fence/agents/egenera/fence_egenera.pl    |  501 ------------------
>  fence/agents/mcdata/Makefile.am          |   17 -
>  fence/agents/mcdata/fence_mcdata.pl      |  361 -------------
>  fence/agents/rackswitch/Makefile.am      |   17 -
>  fence/agents/rackswitch/do_rack.c        |  807 ------------------------------
>  fence/agents/rackswitch/do_rack.h        |   27 -
>  fence/agents/vixel/Makefile.am           |   17 -
>  fence/agents/vixel/fence_vixel.pl        |  267 ----------
>  fence/agents/xcat/Makefile.am            |   17 -
>  fence/agents/xcat/fence_xcat.pl          |  250 ---------
>  tests/data/metadata/fence_rackswitch.xml |   30 --
>  19 files changed, 0 insertions(+), 3755 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index f208bef..4d0aa6a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -12,7 +12,6 @@ LT_PREREQ([2.2.6])
>  LT_INIT
>  
>  AC_CONFIG_MACRO_DIR([m4])
> -AC_CONFIG_SRCDIR([fence/agents/rackswitch/do_rack.h])

^^^^^ You need this one to point to another file. It is used to detect
if we are building "in-tree" or "out-tree".

Fabio

>  AC_CONFIG_HEADERS([make/clusterautoconfig.h])
>  
>  AC_CANONICAL_HOST
> @@ -261,18 +260,14 @@ AC_CONFIG_FILES([Makefile
>  		 fence/agents/apc/Makefile
>  		 fence/agents/apc_snmp/Makefile
>  		 fence/agents/amt/Makefile 
> -		 fence/agents/baytech/Makefile
>  		 fence/agents/bladecenter/Makefile
>  		 fence/agents/brocade/Makefile
> -		 fence/agents/bullpap/Makefile
>  		 fence/agents/cisco_mds/Makefile
>  		 fence/agents/cisco_ucs/Makefile
> -		 fence/agents/cpint/Makefile
>  		 fence/agents/drac/Makefile
>  		 fence/agents/drac5/Makefile
>  		 fence/agents/dummy/Makefile
>  		 fence/agents/eaton_snmp/Makefile
> -		 fence/agents/egenera/Makefile
>  		 fence/agents/eps/Makefile
>  		 fence/agents/hpblade/Makefile
>  		 fence/agents/ibmblade/Makefile
> @@ -287,9 +282,7 @@ AC_CONFIG_FILES([Makefile
>  		 fence/agents/lib/Makefile
>  		 fence/agents/lpar/Makefile
>  		 fence/agents/manual/Makefile
> -		 fence/agents/mcdata/Makefile
>  		 fence/agents/netio/Makefile
> -		 fence/agents/rackswitch/Makefile
>  		 fence/agents/ovh/Makefile
>  		 fence/agents/pve/Makefile
>  		 fence/agents/raritan/Makefile
> @@ -299,11 +292,9 @@ AC_CONFIG_FILES([Makefile
>  		 fence/agents/sanbox2/Makefile
>  		 fence/agents/scsi/Makefile
>  		 fence/agents/virsh/Makefile
> -		 fence/agents/vixel/Makefile
>  		 fence/agents/vmware/Makefile
>  		 fence/agents/vmware_soap/Makefile
>  		 fence/agents/wti/Makefile
> -		 fence/agents/xcat/Makefile
>  		 fence/agents/xenapi/Makefile
>  		 fence/agents/hds_cb/Makefile
>  		 fence/agents/zvm/Makefile
> diff --git a/fence/agents/baytech/Makefile.am b/fence/agents/baytech/Makefile.am
> deleted file mode 100644
> index c0b0b84..0000000
> --- a/fence/agents/baytech/Makefile.am
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -MAINTAINERCLEANFILES	= Makefile.in
> -
> -TARGET			= fence_baytech
> -
> -SRC			= $(TARGET).pl
> -
> -EXTRA_DIST		= $(SRC)
> -
> -sbin_SCRIPTS		= $(TARGET)
> -
> -man_MANS		= $(TARGET).8
> -
> -include $(top_srcdir)/make/fencebuild.mk
> -include $(top_srcdir)/make/fencemanperl.mk
> -
> -clean-local: clean-man
> -	rm -f $(TARGET)
> diff --git a/fence/agents/baytech/fence_baytech.pl b/fence/agents/baytech/fence_baytech.pl
> deleted file mode 100644
> index bb7f42e..0000000
> --- a/fence/agents/baytech/fence_baytech.pl
> +++ /dev/null
> @@ -1,746 +0,0 @@
> -#!/usr/bin/perl
> -
> -# This fencing agent is written for the Baytech RPC27-20nc in conjunction with
> -# a Cyclades terminal server.  The Cyclades TS exports the RPC's serial port
> -# via a Telnet interface.  Other interfaces, such as SSH, are possible.  
> -# However, this script relys upon the assumption that Telnet is used.  Future
> -# features to this agent would allow the agent to work with a mulitude of 
> -# different communication protocols such as Telnet, SSH or Kermit.
> -#
> -# The other assumption that is made is that Outlet names do not end in space.
> -# The name "Foo" and "Foo    " are identical when the RPC prints them with
> -# the status command.
> -
> -use Net::Telnet;
> -use Getopt::Std;
> -
> -my $ME = $0;
> -
> -END {
> -  defined fileno STDOUT or return;
> -  close STDOUT and return;
> -  warn "$ME: failed to close standard output: $!\n";
> -  $? ||= 1;
> -}
> -
> -# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
> -# "#END_VERSION_GENERATION"  It is generated by the Makefile
> -
> -#BEGIN_VERSION_GENERATION
> -$RELEASE_VERSION="";
> -$REDHAT_COPYRIGHT="";
> -$BUILD_DATE="";
> -#END_VERSION_GENERATION
> -
> -# Get the program name from $0 and strip directory names
> -$_=$0;
> -s/.*\///;
> -my $pname = $_;
> -
> -
> -sub rpc_error 
> -{
> -	if (defined $error_message && $error_message ne "")
> -	{
> -		chomp $error_message;
> -		die "$error_message\n";
> -	}
> -	else
> -	{
> -		die "read timed-out\n"
> -	}
> -}
> -
> -sub usage 
> -{
> -
> -    print "Usage:\n";
> -    print "\n";
> -    print "$pname [options]\n";
> -    print "\n";
> -    print "Options:\n";
> -    print " -a host        host to connect to\n";
> -    print " -D             debugging output\n";
> -    print " -h             usage\n";
> -    print " -l string      user name\n";
> -    print " -o string      action: on,off,status, reboot (default) or metadata\n";
> -    print " -n string      outlet name\n";
> -    print " -p string      password\n";
> -    print " -S path        script to run to retrieve password\n";
> -    print " -V             version\n";
> -
> -    exit 0;
> -}
> -
> -sub fail
> -{
> -  ($msg)=@_;
> -  print $msg."\n" unless defined $quiet;
> -  $t->close if defined $t;
> -  exit 1;
> -}
> -
> -sub fail_usage
> -{
> -  ($msg)=@_;
> -  print STDERR $msg."\n" if $msg;
> -  print STDERR "Please use '-h' for usage.\n";
> -  exit 1;
> -}
> -
> -sub version
> -{
> -  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
> -  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
> -
> -  exit 0;
> -}
> -
> -sub print_metadata
> -{
> -print '<?xml version="1.0" ?>
> -<resource-agent name="fence_baytech" shortdesc="I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server" >
> -<longdesc>
> -This fencing agent is written for the Baytech RPC27-20nc in  combination  with  a Cyclades  terminal server. The Cyclades TS exports the RPC\'s serial port via a Telnet interface.  Other interfaces, such as SSH, are  possible. However, this script relies upon the assumption that Telnet is used.  
> -
> -The  other assumption that is made is that Outlet names do not end in space. The name "Foo" and "Foo    " are identical when the RPC prints them with the status command.
> -</longdesc>
> -<vendor-url>http://www.baytech.net</vendor-url>
> -<parameters>
> -        <parameter name="action" unique="1" required="1">
> -                <getopt mixed="-o [action]" />
> -                <content type="string" default="disable" />
> -                <shortdesc lang="en">Fencing Action</shortdesc>
> -        </parameter>
> -        <parameter name="ipaddr" unique="1" required="1">
> -                <getopt mixed="-a [ip]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">IP Address or Hostname</shortdesc>
> -        </parameter>
> -        <parameter name="login" unique="1" required="1">
> -                <getopt mixed="-l [name]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Login Name</shortdesc>
> -        </parameter>
> -        <parameter name="passwd" unique="1" required="0">
> -                <getopt mixed="-p [password]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Login password or passphrase</shortdesc>
> -        </parameter>
> -        <parameter name="passwd_script" unique="1" required="0">
> -                <getopt mixed="-S [script]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Script to retrieve password</shortdesc>
> -        </parameter>
> -        <parameter name="port" unique="1" required="1">
> -                <getopt mixed="-n [id]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
> -        </parameter>
> -        <parameter name="help" unique="1" required="0">
> -                <getopt mixed="-h" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Display help and exit</shortdesc>
> -        </parameter>
> -</parameters>
> -<actions>
> -        <action name="enable" />
> -        <action name="disable" />
> -        <action name="status" />
> -        <action name="metadata" />
> -</actions>
> -</resource-agent>
> -';
> -}
> -
> -
> -# Get operating paramters, either with getopts or from STDIN
> -sub get_options
> -{
> -   $action = "Reboot";
> -   if (@ARGV > 0) {
> -      getopts("n:l:p:S:o:a:VhD") || fail_usage ;
> -
> -      usage if defined $opt_h;
> -      version if defined $opt_V;
> -
> -      fail_usage "Unkown parameter." if (@ARGV > 0);
> -
> -   } else {
> -      get_options_stdin();
> -   } 
> -
> -   if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
> -      print_metadata();
> -      exit 0;
> -   }
> -
> -   fail "failed: must specify hostname" unless defined $opt_a;
> -   $host=$opt_a;
> -   $port=23 unless ($opt_a =~ /:/);
> -
> -   $action = $opt_o if defined $opt_o;
> -   fail "failed: unrecognised action: $action"
> -         unless $action=~ /^(Off|On|Reboot|status)$/i;
> -   
> -   fail "failed: no outletname" unless defined $opt_n;
> -   $outlet = $opt_n;
> -
> -   $debug=$opt_D if defined $opt_D;
> -   $quiet=$opt_q if defined $opt_q;
> -   $user=$opt_l if defined $opt_l;
> -   $passwd=$opt_p if defined $opt_p;
> -   if (defined $opt_S) {
> -     $pwd_script_out = `$opt_S`;
> -     chomp($pwd_script_out);
> -     if ($pwd_script_out) {
> -       $passwd=$pwd_script_out;
> -     }
> -   }
> -
> -   if(defined $passwd && !defined $user)
> -   {
> -      fail "failed: password given without username";
> -   }
> -}
> -
> -# Get options from STDIN
> -sub get_options_stdin
> -{
> -    my $opt;
> -    my $line = 0;
> -    while( defined($in = <>) )
> -    {
> -	$_ = $in;
> -        chomp;
> -
> -	# strip leading and trailing whitespace
> -        s/^\s*//;
> -        s/\s*$//;
> -
> -	# skip comments
> -	next if /^#/;
> -
> -        $line+=1;
> -        $opt=$_;
> -	next unless $opt;
> -
> -	($name,$val)=split /\s*=\s*/, $opt;
> -
> -	if ( $name eq "" )
> -	{
> -	   print STDERR "parse error: illegal name in option $line\n";
> -	   exit 2;
> -	} 
> -
> -        # DO NOTHING -- this field is used by fenced 
> -	elsif ($name eq "agent" ) { } 
> -
> -	elsif ($name eq "host" ) 
> -	{
> -	    $opt_a = $val;
> -	} 
> -
> -	elsif ($name eq "login" ) 
> -	{
> -	    $opt_l = $val;
> -	} 
> -
> -	elsif ($name eq "passwd" ) 
> -	{
> -	    $opt_p = $val;
> -	} 
> -
> -    elsif ($name eq "passwd_script") {
> -        $opt_S = $val;
> -    }
> -
> -	elsif ($name eq "action" ) 
> -	{
> -	    $opt_o = $val;
> -	} 
> -
> -	elsif ($name eq "outlet" ) 
> -	{
> -	    $opt_n = $val;
> -	} 
> -
> -    }
> -}
> -
> -# Get a bunch of lines.  The newlines must terminate complete lines.
> -sub getlines
> -{
> -	my $data=$t->get();
> -	return undef unless defined $data;
> -	my @chars = split //,$data;
> -	my @lines;
> -	my $line="";
> -
> -	for (my $i=0;$i<@chars;$i++)
> -	{
> -		$line = $line.$chars[$i];
> -		next unless $chars[$i] eq "\n";
> -		$lines[@lines] = $line;
> -		$line = "";
> -	}
> -	$lines[@lines] = $line unless $line eq "";
> -
> -	return @lines;
> -}
> -
> -# Fill the global input buffer of lines read.  All lines are terminated with
> -# a newline.  If a line is not terminated, the next call to fill buffer will
> -# append the last line of the input buffer with the first line that it gets from
> -# getlines()
> -sub fill_buffer
> -{
> -	my @lines = getlines();
> -	return undef unless @lines;
> -
> -	if(@buffer)
> -	{
> -		if ( $buffer[$#buffer]=~/\n/) { }
> -		else
> -		{
> -			$buffer[$#buffer] = $buffer[$#buffer].$lines[0];
> -			shift @lines;
> -		}
> -	}
> -
> -	foreach (@lines) 
> -	{ 
> -		push @buffer,$_;
> -	}
> -}
> -
> -
> -
> -#
> -# ($p_index, at data) = get_match @patterns;
> -#
> -# searches the input buffers for the patterns specified by the regeps in 
> -# @patterns, when a match is found, all the lines through the matched 
> -# pattern line are removed from the global input buffer and returned in the
> -# array @data.  The index into @patterns for the matching pattern is also
> -# returned.
> -sub get_match
> -{
> -	my (@patterns) = @_;
> -	$b_index = 0 unless defined $b_index;
> -
> -	fill_buffer() unless defined @buffer;
> -
> -	for(;;)
> -	{
> -		for(my $bi=$b_index; $bi<@buffer; $bi++)
> -		{
> -			for(my $pat=0; $pat<@patterns; $pat++)
> -			{
> -				if($buffer[$bi] =~ /$patterns[$pat]/)
> -				{
> -					$b_index = 0;
> -					my @rtrn = splice(@buffer,0,$bi);
> -					shift @buffer;
> -				
> -					if($debug)
> -					{
> -						foreach (@rtrn) { print $_ }
> -						print "$patterns[$pat] ";
> -					}
> -					
> -					return ($pat, at rtrn);
> -				}
> -			}
> -			$b_index = $bi;
> -		}
> -
> -		fill_buffer();
> -	}
> -}
> -
> -#
> -# ($bt_num,$bt_name,$bt_state,$bt_locked) = parse_status $outlet, at data;
> -#
> -# This parses the data @data and searches for an outlet named $outlet.
> -# The data will be in the form:
> -# 
> -#   Average Power:    0 Watts        Apparent Power:   17 VA
> -# 
> -#   True RMS Voltage: 120.0 Volts
> -# 
> -#   True RMS Current:   0.1 Amps     Maximum Detected:   0.2 Amps     
> -# 
> -#   Internal Temperature:  19.5 C
> -# 
> -#   Outlet Circuit Breaker: Good
> -# 
> -#    1)...Outlet  1       : Off           2)...Outlet  2       : Off          
> -#    3)...Outlet  3       : On            4)...Outlet  4       : On           
> -#    5)...Outlet  5       : On            6)...Outlet  6       : On           
> -#    7)...Outlet  7       : On            8)...Outlet  8       : On           
> -#    9)...Outlet  9       : On           10)...Outlet 10       : On           
> -#   11)...Outlet 11       : On           12)...Outlet 12       : On           
> -#   13)...Outlet 13       : On           14)...Outlet 14       : On           
> -#   15)...Outlet 15       : On           16)...Outlet 16       : On           
> -#   17)...Outlet 17       : On           18)...Outlet 18       : On           
> -#   19)...Outlet 19       : On           20)...Outlet 20       : On    Locked 
> -#
> -sub parse_status
> -{
> -	my $outlet = shift;
> -	my @data = @_;
> -
> -	my $bt_num="";
> -	my $bt_name="";
> -	my $bt_state="";
> -	my $bt_locked="";
> -
> -	# Verify that the Outlet name exists
> -	foreach my $line (@data)
> -	{
> -		next unless $line =~ /^[ 12][0-9]\)\.\.\./;
> -
> -		my @entries = split /([ 12][0-9])\)\.\.\./,$line;
> -	
> -		foreach my $entry (@entries)
> -		{
> -			next if $entry eq "";
> -			
> -			if($entry =~ /^([ 12][0-9])$/)
> -			{
> -				$bt_num = $1;
> -			}
> -			elsif($entry =~ /^(.{15}) : (On|Off)(.*)/)
> -			{
> -	
> -				$bt_name = $1;
> -				$bt_state = $2;
> -				$bt_locked = $3;
> -	
> -				$_ = $bt_name;
> -				s/\s*$//;
> -				$bt_name = $_;
> -	
> -				$_ = $bt_locked;
> -				s/\s*$//;
> -				$bt_locked = $_;
> -	
> -				last if ($bt_name eq $outlet);
> -	
> -				$bt_name = "";
> -				next;
> -			}
> -			else
> -			{
> -				die "parse error: $entry";
> -			}
> -		}
> -		last if ($bt_name ne "");
> -	}
> -	
> -	if ($bt_name eq "")
> -	{
> -		$bt_num=undef;
> -		$bt_name=undef;
> -		$bt_state=undef;
> -		$bt_locked=undef;
> -	}
> -
> -	return ($bt_num,$bt_name,$bt_state,$bt_locked);
> -}
> -
> -##########################################################################
> -#
> -# Main
> -
> -get_options;
> -
> -
> -if (defined $port)
> -{
> -	$t = new Net::Telnet(Host=>$host, Port=>$port) or 
> -		die "Unable to connect to $host:$port: ".($!?$!:$_)."\n";
> -}
> -else
> -{
> -	$t = new Net::Telnet(Host=>$host) or 
> -		die "Unable to connect to $host: ".($!?$!:$_)."\n";
> -}
> -
> -
> -
> -#> DEBUG $t->dump_log("LOG");
> -
> -$t->print("\n");
> -
> -my @patterns;
> -$prompt_user="^Enter user name:";
> -$prompt_pass="^Enter Password:";
> -$prompt_cmd="^RPC-27>";
> -$prompt_confirm_yn="^.*\\(Y/N\\)\\?";
> -
> -$patterns[0]=$prompt_user;
> -$patterns[1]=$prompt_pass;
> -$patterns[2]=$prompt_cmd;
> -$patterns[3]=$prompt_confirm_yn;
> -
> -my $p_index;
> -my @data;
> -
> -my $bt_num="";
> -my $bt_name="";
> -my $bt_state="";
> -my $bt_locked="";
> -my $exit=1;
> -
> -($p_index, at data) = get_match @patterns;
> -
> -#
> -# Set errmode after first get_match.  This allows for more descriptive errors
> -# when handling unexpected error conditions
> -#
> -$t->errmode(\&rpc_error);
> -
> -# At this point, the username is unknown.  We'll just
> -# pass in an empty passwd so that we can get back to the 
> -# login prompt.  
> -#
> -# FIXME
> -# If this is the third login failure for this switch, an
> -# additional newline will need to be made sent.  This script
> -# does not handle that case at this time.  This will cause
> -# a timeout on read and cause this to fail.  Rerunning the
> -# script ought to work though.
> -if ($patterns[$p_index] eq $prompt_pass)
> -{
> -	$t->print("\n");
> -	($p_index, at data) = get_match @patterns;
> -}
> -
> -# Enter user name:
> -#
> -# Depending how the RPC is configured, a user name may not be required.
> -# We will only deal with usernames if prompted.  
> -#
> -# If there is no user/passwd given as a parameter, but the switch
> -# expects one, rather than just fail, we will first try to
> -# get the switch in a known state 
> -my $warn_user="yes";
> -my $warn_passwd="yes";
> -
> -$error_message = "Invalid user/password";
> -
> -for (my $retrys=0; $patterns[$p_index] eq $prompt_user ; $retrys++)
> -{
> -	$warn_passwd = "yes";
> -	if(defined $user)
> -	{
> -		$t->print("$user\n");
> -		$warn_user = "no";
> -	}
> -	else
> -	{
> -		$t->print("\n");
> -
> -	}
> -	($p_index, at data) = get_match @patterns;
> -
> -	# Enter Password:
> -	#
> -	# Users don't have to have passwords either.  We will only check
> -	# that the user specified a password if we were prompted by the
> -	# RPC.
> -	if ($patterns[$p_index] eq $prompt_pass)
> -	{
> -		if(defined $passwd)
> -		{
> -			$t->print("$passwd\n");
> -			$warn_passwd = "no";
> -		}
> -		else
> -		{
> -			$t->print("\n");
> -		}
> -
> -		($p_index, at data) = get_match @patterns;
> -	}
> -
> -
> -	#
> -	# If a valid user name is given, but not a valid password, we
> -	# will loop forever unless we limit the number of retries
> -	#
> -	# set the user to "" so we stop entering a valid username and
> -	# force the login proccess to fail
> -	#
> -	if ($retrys>2)
> -	{
> -		$user = "";
> -	}
> -	elsif ($retrys>10)
> -	{
> -		die "maximum retry count exceeded\n";
> -	}
> -}
> -
> -#
> -# reset errmode to die()
> -#
> -$t->errmode("die");
> -
> -# all through with the login/passwd.  If we see any other prompt it is an 
> -# error.
> -if ($patterns[$p_index] ne $prompt_cmd)
> -{
> -	$t->print("\n");
> -	die "bad state: '$patterns[$p_index]'";
> -}
> -
> -if (defined $user && ($warn_user eq "yes"))
> -{
> -	warn "warning: user parameter ignored\n";
> -}
> -
> -if (defined $passwd && ($warn_passwd eq "yes"))
> -{
> -	warn "warning: passwd parameter ignored\n";
> -}
> -
> -
> -
> -
> -# We are now logged in, no need for these patterns.  We'll strip these
> -# so that we don't have to keep searching for patterns that shouldn't
> -# appear.
> -shift @patterns;
> -shift @patterns;
> -
> -# Get the current status of a particular outlet.  Explicitly pass
> -# the status command in case the RPC is not configured to report the
> -# status on each command completion.
> -$t->print("status\n");
> -($p_index, at data) = get_match @patterns;
> -($bt_num,$bt_name,$bt_state,$bt_locked) = parse_status $outlet, at data;
> -
> -if (!defined $bt_name )
> -{
> -	# We have problems if there is not outlet named $outlet
> -	print "Outlet \'$outlet\' not found\n";
> -	$exit=1;
> -}
> -elsif ($action =~ /status/i)
> -{
> -	print "Outlet '$bt_name' is $bt_state and is ".
> -		(($bt_locked eq "")?"not ":"")."Locked\n";
> -
> -	if ($bt_state =~ /on/i)
> -	{
> -		$exit=0;
> -	} else {
> -		$exit=2;
> -	}
> -}
> -elsif ($bt_locked ne "")
> -{
> -	# Report an error if an outlet is locked since we can't actually 
> -	# issue commands on a Locked outlet.  This will prevent false
> -	# successes.
> -	print "Outlet '$bt_name' is Locked\n";
> -	$exit=1;
> -}
> -elsif (($action =~ /on/i && $bt_state eq "On") ||
> -	($action =~ /off/i && $bt_state eq "Off") )
> -{
> -	# No need to issue the on/off command since we are already in 
> -	# the desired state
> -	print "Outlet '$bt_name' is already $bt_state\n";
> -	$exit=0;
> -}
> -elsif ($action =~ /o(n|ff)/i)
> -{
> -	# On/Off command
> -	$t->print("$action $bt_num\n");
> -	($p_index, at data) = get_match @patterns;
> -	
> -	# Confirmation prompting maybe enabled in the switch.  If it is,
> -	# we enter 'Y' for yes.
> -	if ($patterns[$p_index] eq $prompt_confirm_yn)
> -	{
> -		$t->print("y\n");
> -		($p_index, at data) = get_match @patterns;
> -	}
> -
> -	$t->print("status\n");
> -	($p_index, at data) = get_match @patterns;
> -
> -	($bt_num,$bt_name,$bt_state,$bt_locked) = parse_status $outlet, at data;
> -	
> -	if ($bt_state =~ /$action/i)
> -	{
> -		print "success: outlet='$outlet' action='$action'\n";
> -		$exit=0;
> -	}
> -	else
> -	{	
> -		print "fail: outlet='$outlet' action='$action'\n";
> -		$exit=1;
> -	}
> -}
> -elsif ($action =~ /reboot/i)
> -{
> -	# Reboot command
> -	$t->print("$action $bt_num\n");
> -	($p_index, at data) = get_match @patterns;
> -	
> -	# Confirmation prompting maybe enabled in the switch.  If it is,
> -	# we enter 'Y' for yes.
> -	if ($patterns[$p_index] eq $prompt_confirm_yn)
> -	{
> -		$t->print("y\n");
> -		($p_index, at data) = get_match @patterns;
> -	}
> -
> -	# The reboot command is annoying.  It reports that the outlet will
> - 	# reboot in 9 seconds.  Then it has a countdown timer.  We first
> -	# look for the "Rebooting... 9" message, then we parse the remaining
> -	# output to verify that it reaches 0 without skipping anything.
> -	my $pass=0;
> -	foreach (@data)
> -	{
> -		chomp;
> -		my $line = $_;
> -
> -		# There is a countdown timer that prints a number, then sleeps a 
> -		# second, then prints a backspace and then another number
> -		#
> -		# /^Rebooting\.\.\. 9\b8\b7\b6\b5\b4\b3\b2\b1\b0\b$/
> -		if($line =~/^Rebooting\.\.\..*0[\b]$/)
> -		{
> -			$pass=1;
> -			last;
> -		}
> -	}
> -
> -	if ($pass)
> -	{
> -		print "success: outlet='$outlet' action='$action'\n";
> -		$exit=0;
> -	}
> -	else
> -	{
> -		print "fail: outlet='$outlet' action='$action'\n";
> -		$exit=1;
> -	}
> -}
> -else
> -{
> -	die "bad state";
> -}
> -
> -# Clean up.  If we don't tell it to logout, then anybody else can log onto 
> -# the serial port and have access to the switch without authentication (when 
> -# enabled)
> -$t->print("logout\n");
> -$t->close;
> -exit $exit;
> diff --git a/fence/agents/bullpap/Makefile.am b/fence/agents/bullpap/Makefile.am
> deleted file mode 100644
> index a602b5e..0000000
> --- a/fence/agents/bullpap/Makefile.am
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -MAINTAINERCLEANFILES	= Makefile.in
> -
> -TARGET			= fence_bullpap
> -
> -SRC			= $(TARGET).pl
> -
> -EXTRA_DIST		= $(SRC)
> -
> -sbin_SCRIPTS		= $(TARGET)
> -
> -man_MANS		= $(TARGET).8
> -
> -include $(top_srcdir)/make/fencebuild.mk
> -include $(top_srcdir)/make/fencemanperl.mk
> -
> -clean-local: clean-man
> -	rm -f $(TARGET)
> diff --git a/fence/agents/bullpap/fence_bullpap.pl b/fence/agents/bullpap/fence_bullpap.pl
> deleted file mode 100644
> index 3012fa2..0000000
> --- a/fence/agents/bullpap/fence_bullpap.pl
> +++ /dev/null
> @@ -1,433 +0,0 @@
> -#!/usr/bin/perl
> -
> -use Getopt::Std;
> -use POSIX;
> -
> -my $ME = $0;
> -
> -END {
> -  defined fileno STDOUT or return;
> -  close STDOUT and return;
> -  warn "$ME: failed to close standard output: $!\n";
> -  $? ||= 1;
> -}
> -
> -# Get the program name from $0 and strip directory names
> -$_=$0;
> -s/.*\///;
> -my $pname = $_;
> -
> -$action = "reboot"; # Default fence action
> -my $bulldir = "/usr/local/bull/NSMasterHW/bin";
> -
> -
> -# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
> -# "#END_VERSION_GENERATION"  It is generated by the Makefile
> -
> -#BEGIN_VERSION_GENERATION
> -$RELEASE_VERSION="";
> -$REDHAT_COPYRIGHT="";
> -$BUILD_DATE="";
> -#END_VERSION_GENERATION
> -
> -
> -sub usage
> -{
> -	print "Usage:\n";
> -	print "\n";
> -	print "$pname [options]\n";
> -	print "\n";
> -	print "Options:\n";
> -	print "  -a <ip>          IP address or hostname of PAP console\n";
> -	print "  -h               usage\n";
> -	print "  -l <name>        Login name\n";
> -	print "  -d <domain>      Domain to operate on\n";
> -	print "  -o <string>      Action:  on, off, reboot (default), status or metadata\n";
> -	print "  -p <string>      Password for login\n";
> -	print "  -S <path>        Script to run to retrieve password\n";
> -	print "  -q               quiet mode\n";
> -	print "  -V               version\n";
> -	print "\n";
> -	print "When run with no arguments, $pname takes arguments from ";
> -	print "standard\ninput, one line per option.  They are as follows:\n";
> -	print "\n";
> -	print "  ipaddr=<ip>          Same as -a command line option\n";
> -	print "  login=<name>         Same as -l command line option\n";
> -	print "  domain=<domain>      Same as -d command line option\n";
> -	print "  option=<string>      Same as -o command line option\n";
> -	print "  passwd=<string>      Same as -p command line option\n";
> -	print "  passwd_script=<path> Same as -S command line option\n\n";
> -
> -	exit 0;
> -}
> -
> -sub fail
> -{
> -	($msg) = @_;
> -	print $msg."\n" unless defined $quiet;
> -	exit 1;
> -}
> -
> -sub fail_usage
> -{
> -	($msg)=@_;
> -	print STDERR $msg."\n" if $msg;
> -	print STDERR "Please use '-h' for usage.\n";
> -	exit 1;
> -}
> -
> -sub version
> -{
> -	print "$pname $RELEASE_VERSION $BUILD_DATE\n";
> -	print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
> -
> -	exit 0;
> -}
> -
> -sub print_metadata
> -{
> -print '<?xml version="1.0" ?>
> -<resource-agent name="fence_bullpap" shortdesc="I/O Fencing agent for Bull FAME architecture controlled by a PAP management console." >
> -<longdesc>
> -fence_bullpap is an I/O Fencing agent which can be used with Bull\'s NovaScale machines controlled by PAP management consoles. This agent calls Bull\'s support software provided by the NSMasterHW RPM available from Bull.
> -</longdesc>
> -<vendor-url>http://www.bull.com</vendor-url>
> -<parameters>
> -        <parameter name="action" unique="1" required="1">
> -                <getopt mixed="-o [action]" />
> -                <content type="string" default="reboot" />
> -                <shortdesc lang="en">Fencing Action</shortdesc>
> -        </parameter>
> -        <parameter name="ipaddr" unique="1" required="1">
> -                <getopt mixed="-a [ip]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">IP Address or Hostname</shortdesc>
> -        </parameter>
> -        <parameter name="login" unique="1" required="1">
> -                <getopt mixed="-l [name]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Login Name</shortdesc>
> -        </parameter>
> -        <parameter name="passwd" unique="1" required="0">
> -                <getopt mixed="-p [password]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Login password or passphrase</shortdesc>
> -        </parameter>
> -        <parameter name="passwd_script" unique="1" required="0">
> -                <getopt mixed="-S [script]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Script to retrieve password</shortdesc>
> -        </parameter>
> -        <parameter name="domain" unique="1" required="1">
> -                <getopt mixed="-d [domain]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Domain name of the Bull machine to power-cycle</shortdesc>
> -        </parameter>
> -        <parameter name="help" unique="1" required="0">
> -                <getopt mixed="-h" />           
> -                <content type="string"  />
> -                <shortdesc lang="en">Display help and exit</shortdesc>                    
> -        </parameter>
> -</parameters>
> -<actions>
> -        <action name="on" />
> -        <action name="off" />
> -	<action name="reboot" />
> -        <action name="status" />
> -        <action name="metadata" />
> -</actions>
> -</resource-agent>
> -';
> -}
> -
> -sub get_options_stdin
> -{
> -	my $opt;
> -	my $line = 0;
> -	while( defined($in = <>) )
> -	{
> -		$_ = $in;
> -		chomp;
> -
> -		# strip leading and trailing whitespace
> -		s/^\s*//;
> -		s/\s*$//;
> -	
> -		# skip comments
> -		next if /^#/;
> -
> -		$line+=1;
> -		$opt=$_;
> -		next unless $opt;
> -
> -		($name,$val)=split /\s*=\s*/, $opt;
> -
> -		if ( $name eq "" )
> -		{  
> -			print STDERR "parse error: illegal name in option $line\n";
> -			exit 2;
> -		}
> -	
> -		# DO NOTHING -- this field is used by fenced
> -		elsif ($name eq "agent" ) { } 
> -
> -		elsif ($name eq "ipaddr" ) 
> -		{
> -			$host = $val;
> -		} 
> -		elsif ($name eq "login" ) 
> -		{
> -			$login = $val;
> -		} 
> -		elsif (($name eq "option" ) || ($name eq "action"))
> -		{
> -			$action = $val;
> -		}
> -		elsif ($name eq "passwd" ) 
> -		{
> -			$passwd = $val;
> -		} 
> -		elsif ($name eq "password" ) 
> -		{
> -			$passwd = $val;
> -		} 
> -		elsif ($name eq "passwd_script" ) {
> -			$passwd_script = $val;
> -		}
> -		elsif ($name eq "domain" ) 
> -		{
> -			$domain = $val;
> -		} 
> -		elsif ($name eq "debuglog" ) 
> -		{
> -			$verbose = $val;
> -		} 
> -	}
> -}
> -
> -sub get_power_state
> -{
> -	my ($ip,$dom,$user,$pass,$junk) = @_;
> -	fail "missing IP address in get_power_state()" unless defined $ip;
> -	fail "missing domain to get_power_state()" unless defined $dom;
> -	fail "illegal argument to get_power_state()" if defined $junk;
> -
> -	my $state="";
> -	my $cmd = $bulldir . "/pampower.pl";
> -	
> -	$cmd = $cmd . " -a status";
> -	$cmd = $cmd . " -M $ip -D $dom";
> -	if (defined $user) {
> -		$cmd = $cmd . "	-u $user";
> -	}
> -	if (defined $pass) {
> -		$cmd = $cmd . " -p $pass";
> -	}
> -
> -	$state=system($cmd);
> -	WIFEXITED($state) || die "child killed abnormally";
> -
> -	$state=WEXITSTATUS($state);
> -	if ($state == 0) {
> -		$state = "ON";
> -	} elsif ($state == 1) {
> -		$state = "OFF";
> -	} else {
> -		$state = "$state TRANSITION";
> -	}
> -
> -	$_=$state;
> -}
> -
> -sub set_power_state
> -{
> -	my ($ip,$dom,$set,$user,$pass,$junk) = @_;
> -	fail "missing action to set_power_state()" unless defined $set;
> -	fail "missing IP address in set_power_state()" unless defined $ip;
> -	fail "missing domain to set_power_state()" unless defined $dom;
> -	fail "illegal argument to set_power_state()" if defined $junk;
> -
> -	my $state="";
> -	my $cmd = $bulldir . "/pampower.pl";
> -	
> -	if ($set =~ /on/) {
> -		$cmd = $cmd . " -a on";
> -	} else {
> -		$cmd = $cmd . " -a off_force";
> -	}
> -	
> -	$cmd = $cmd . " -M $ip -D $dom";
> -	if (defined $user) {
> -		$cmd = $cmd . "	-u $user";
> -	}
> -	if (defined $pass) {
> -		$cmd = $cmd . " -p $pass";
> -	}
> -
> -	$state=system "$cmd";
> -
> -	$_=$state;
> -}
> -
> -# MAIN
> -
> -if (@ARGV > 0) 
> -{
> -	getopts("a:hl:d:o:p:S:qv:V") || fail_usage ;
> -
> -	usage if defined $opt_h;
> -	version if defined $opt_V;
> -
> -	if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
> -		print_metadata();
> -		exit 0;
> -	}
> -
> -	$host     = $opt_a if defined $opt_a;
> -	$login    = $opt_l if defined $opt_l;
> -	$passwd   = $opt_p if defined $opt_p;
> -	$action   = $opt_o if defined $opt_o;
> -	$domain	  = $opt_d if defined $opt_d;
> -	$verbose  = $opt_v if defined $opt_v;
> -	$quiet    = $opt_q if defined $opt_q;
> -
> -	if (defined $opt_S) {
> -		$pwd_script_out = `$opt_S`;
> -		chomp($pwd_script_out);
> -		if ($pwd_script_out) {
> -			$passwd = $pwd_script_out;
> -		}
> -	}
> -
> -	fail_usage "Unknown parameter." if (@ARGV > 0);
> -
> -	fail_usage "No '-a' flag specified." unless defined $host;
> -	fail_usage "No '-d' flag specified." unless defined $domain;
> -	fail_usage "No '-l' flag specified." unless defined $login;
> -	fail_usage "No '-p' or '-S' flag specified." unless defined $passwd;
> -	fail_usage "Unrecognised action '$action' for '-o' flag"
> -		unless $action =~ /^(on|off|reboot|status)$/i;
> -} 
> -else 
> -{
> -	get_options_stdin();
> -
> -	if ((defined $action) && ($action =~ /metadata/i)) {
> -		print_metadata();
> -		exit 0;
> -	}
> -
> -	fail "failed: no IP address" unless defined $host;
> -	fail "failed: no domain" unless defined $domain;
> -	fail "failed: no login name" unless defined $login;
> -	fail "failed: unrecognized action: $action"
> -		unless $action =~ /^(on|off|reboot|status)$/i;
> -
> -	if (defined $passwd_script) {
> -		$pwd_script_out = `$passwd_script`;
> -		chomp($pwd_script_out);
> -		if ($pwd_script_out) {
> -			$passwd = $pwd_script_out;
> -		}
> -	}
> -	fail "failed: no password" unless defined $passwd;
> -}
> -
> -stat($bulldir);
> -die "NSMasterHW not installed correctly" if ! -d _;
> -
> -# convert $action to lower case 
> -$_=$action;
> -if    (/^on$/i)     { $action = "on"; }
> -elsif (/^off$/i)    { $action = "off"; }
> -elsif (/^reboot$/i) { $action = "reboot"; }
> -elsif (/^status$/i) { $action = "status"; }
> -
> -#
> -# If if pampower / pamreset don't exist, we're done.
> -#
> -# -M -- the maintenance port on the NovaScale Windows 2000 master server
> -# -D -- the Domain to reboot
> -# -u -- User name
> -# -p -- Password
> -#
> -#/usr/local/bull/NSMasterHW/bin/pamreset.pl 
> -#    -M 192.168.78.169 -D Domaine2-8CPU -u Administrator -p administrator
> -#
> -#/usr/local/bull/NSMasterHW/bin/pampower.pl -a off_force 
> -#    -M 192.168.78.169 -D Domaine2-8CPU -u Administrator -p administrator
> -#
> -#/usr/local/bull/NSMasterHW/bin/pampower.pl -a on 
> -#    -M 192.168.78.169 -D Domaine2-8CPU -u Administrator -p administrator
> -#
> -# Do the command
> -#
> -$success=0;
> -$_ = $action;
> -my $exit_code=0;
> -if (/(on|off)/)
> -{
> -	my $timeout = 120; # 120 = max of (60, 120).  Max timeout for "on"
> -			   # on 32-way bull machines
> -
> -	set_power_state $host,$domain,$action,$login,$passwd;
> -	do {
> -		sleep 5;
> -		$state=get_power_state $host,$domain,$login,$passwd;
> -		$timeout -= 5;
> -	} while ($timeout > 0 && !($state =~ /^$action$/i));
> -
> -	$success = 1 if ($state=~/^$action$/i);
> -}
> -elsif (/reboot/)
> -{
> -	my $timeout = 60; # 60 seconds for "off" for 32-way bull machines
> -
> -	set_power_state $host,$domain,"off",$login,$passwd;
> -	do {
> -		sleep 5;
> -		$state=get_power_state $host,$domain,$login,$passwd;
> -		$timeout -= 5;
> -	} while ($timeout > 0 && $state != 0);
> -
> -	if ($timeout <= 0) {
> -		$success = 0;
> -	} else  {
> -		$timeout = 120; # 120 seconds for on, for 32-way bull machines
> -		set_power_state $host,$domain,"on",$login,$passwd;
> -		do {
> -			sleep 5;
> -			$state=get_power_state $host,$domain,$login,$passwd;
> -			$timeout -= 5;
> -		} while ($timeout > 0 && $state != 0);
> -
> -		$success = 1 if ($state == 0);
> -	}
> -}
> -elsif (/status/)
> -{
> -	get_power_state $host,$domain,$login,$passwd;
> -	$state=$_;
> -	$success = 1 if defined $state;
> -	if ($state eq "OFF") {
> -		$exit_code = 2;
> -	}
> -}
> -else
> -{
> -	fail "fail: illegal action";
> -}
> -
> -if ($success)
> -{
> -	print "success: domain $domain $action". ((defined $state) ? ": $state":"")
> -		."\n" unless defined $quiet;
> -	exit $exit_code;
> -}
> -else
> -{
> -	fail "fail: domain $domain $action";	
> -	exit 1
> -}
> -
> -
> diff --git a/fence/agents/cpint/Makefile.am b/fence/agents/cpint/Makefile.am
> deleted file mode 100644
> index c9680bd..0000000
> --- a/fence/agents/cpint/Makefile.am
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -MAINTAINERCLEANFILES	= Makefile.in
> -
> -TARGET			= fence_cpint
> -
> -SRC			= $(TARGET).pl
> -
> -EXTRA_DIST		= $(SRC)
> -
> -sbin_SCRIPTS		= $(TARGET)
> -
> -man_MANS		= $(TARGET).8
> -
> -include $(top_srcdir)/make/fencebuild.mk
> -include $(top_srcdir)/make/fencemanperl.mk
> -
> -clean-local: clean-man
> -	rm -f $(TARGET)
> diff --git a/fence/agents/cpint/fence_cpint.pl b/fence/agents/cpint/fence_cpint.pl
> deleted file mode 100644
> index 7a7a5f5..0000000
> --- a/fence/agents/cpint/fence_cpint.pl
> +++ /dev/null
> @@ -1,188 +0,0 @@
> -#!/usr/bin/perl
> -
> -use Getopt::Std;
> -
> -my $ME = $0;
> -
> -END {
> -  defined fileno STDOUT or return;
> -  close STDOUT and return;
> -  warn "$ME: failed to close standard output: $!\n";
> -  $? ||= 1;
> -}
> -
> -# Get the program name from $0 and strip directory names
> -$_=$0;
> -s/.*\///;
> -my $pname = $_;
> -
> -$comm_prog = "hcp";
> -
> -# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
> -# "#END_VERSION_GENERATION"  It is generated by the Makefile
> -
> -#BEGIN_VERSION_GENERATION
> -$RELEASE_VERSION="";
> -$REDHAT_COPYRIGHT="";
> -$BUILD_DATE="";
> -#END_VERSION_GENERATION
> -
> -
> -sub usage
> -{
> -    print "Usage:\n";  
> -    print "\n";
> -    print "$pname [options]\n";
> -    print "\n";
> -    print "Options:\n";
> -    print "  -h               usage\n";
> -    print "  -o metadata      print XML metadata for fence agent\n";
> -    print "  -u <string>      userid of the virtual machine to fence\n";
> -    print "  -q               quiet mode\n";
> -    print "  -V               Version\n";
> -
> -    exit 0;
> -}
> -
> -sub fail
> -{
> -  ($msg)=@_;
> -  print "failed: " . $msg . "\n" unless defined $opt_q;
> -  exit 1;
> -}
> -
> -sub fail_usage
> -{
> -  ($msg)=@_q;
> -  print stderr $msg."\n" if $msg;
> -  print stderr "Please use '-h' for usage.\n";
> -  exit 1;
> -}
> -
> -sub version
> -{
> -  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
> -  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
> -
> -  exit 0;
> -}
> -
> -sub print_metadata
> -{
> -print '<?xml version="1.0" ?>
> -<resource-agent name="fence_cpint" shortdesc="I/O Fencing agent for GFS on s390 and zSeries VM clusters" >
> -<longdesc>
> -fence_cpint is an I/O Fencing agent used on a virtual machine running GFS in a s390 or zSeries VM cluster. It uses the cpint package to send a CP LOGOFF command to the specified virtual machine. For fence_cpint to execute correctly, you must have the cpint module installed, and hcp in your PATH.
> -
> -NOTE: for fence_cpint to send a command to another virtual machine, the machine executing it must either be a privilege class C user or it must be the secondary user of the virtual machine to be fenced. This means that unless all of you GULM server nodes are privilege class C, fence_cpint can only be used with SLM.
> -</longdesc>
> -<vendor-url>http://www.ibm.com</vendor-url>
> -<parameters>
> -        <parameter name="userid" unique="1" required="1">
> -                <getopt mixed="-u [userid]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Userid of the virtual machine to fence</shortdesc>
> -        </parameter>
> -        <parameter name="help" unique="1" required="0">
> -                <getopt mixed="-h" />           
> -                <content type="string"  />
> -                <shortdesc lang="en">Display help and exit</shortdesc>                    
> -        </parameter>
> -</parameters>
> -<actions>
> -        <action name="metadata" />
> -</actions>
> -</resource-agent>
> -';
> -}
> -
> -sub get_options_stdin
> -{
> -    my $opt;
> -    my $line = 0;
> -    while( defined($in = <>) )
> -    {
> -        $_ = $in;
> -	      chomp;
> -
> -        # strip leading and trailing whitespace
> -        s/^\s*//;
> -        s/\s*$//;
> -
> -        # skip comments
> -        next if /^#/;
> -
> -	      $line+=1;
> -        $opt=$_;
> -        next unless $opt;
> -
> -	      ($name,$val)=split /\s*=\s*/, $opt;
> -
> -	      if ( $name eq "" )
> -        {
> -           print stderr "parse error: illegal name in option $line\n";
> -           exit 2;
> -        }
> -
> -	      # DO NOTHING -- this field is used by fenced or stomithd
> -        elsif ($name eq "agent" ) { }
> -
> -	      # FIXME -- depricated.  use "userid" and "password" instead.
> -        elsif ($name eq "fm" )
> -        {
> -            (my $dummy,$opt_u,$opt_p) = split /\s+/,$val;
> -	          print STDERR "Depricated \"fm\" entry detected.  refer to man page.\n";
> -        }
> -
> -        # FIXME -- depreicated residue of old fencing system
> -      	elsif ($name eq "name" ) { }
> -
> -	      elsif ($name eq "userid" )
> -        {
> -            $opt_u = $val;
> -        }
> -
> -        elsif ($name eq "action" )
> -        {
> -            $opt_o = $val;
> -        }
> -
> -	else
> -        {
> -           print stderr "parse error: unknown option \"$opt\"\n";
> -           #> exit 2;
> -        }
> -    }
> -}
> -
> -if (@ARGV > 0){
> -    getopts("hqu:Vo:") || fail_usage;
> -    usage if defined $opt_h;
> -    version if defined $opt_V;
> -
> -    fail_usage "Unkown parameter." if (@ARGV > 0);
> -
> -    if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
> -        print_metadata();
> -        exit 0;
> -    }
> -
> -    fail_usage "No '-u' flag specified." unless defined $opt_u;
> -} else {
> -    get_options_stdin();
> -
> -    if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
> -        print_metadata();
> -        exit 0;
> -    }
> -
> -    fail "no userid" unless defined $opt_u;
> -}
> -
> -$ret_val = system("$comm_prog send cp $opt_u logoff > /dev/null 2>&1") >> 8;
> -fail "$comm_prog failed ($ret_val)" unless ($ret_val == 0 || $ret_val == 45);
> -$ret_val = system("$comm_prog send cp $opt_u > /dev/null 2>&1") >> 8;
> -fail "$userid isn't logged off. $comm_prog return ($ret_val)" unless ($ret_val == 45);
> -
> -print "success: booted userid $opt_u\n" unless defined $opt_q;
> -exit 0;
> diff --git a/fence/agents/egenera/Makefile.am b/fence/agents/egenera/Makefile.am
> deleted file mode 100644
> index c69f805..0000000
> --- a/fence/agents/egenera/Makefile.am
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -MAINTAINERCLEANFILES	= Makefile.in
> -
> -TARGET			= fence_egenera
> -
> -SRC			= $(TARGET).pl
> -
> -EXTRA_DIST		= $(SRC)
> -
> -sbin_SCRIPTS		= $(TARGET)
> -
> -man_MANS		= $(TARGET).8
> -
> -include $(top_srcdir)/make/fencebuild.mk
> -include $(top_srcdir)/make/fencemanperl.mk
> -
> -clean-local: clean-man
> -	rm -f $(TARGET)
> diff --git a/fence/agents/egenera/fence_egenera.pl b/fence/agents/egenera/fence_egenera.pl
> deleted file mode 100644
> index 2ea4d0c..0000000
> --- a/fence/agents/egenera/fence_egenera.pl
> +++ /dev/null
> @@ -1,501 +0,0 @@
> -#!/usr/bin/perl
> -
> -use Getopt::Std;
> -use IPC::Open3;
> -
> -my $ME = $0;
> -
> -END {
> -  defined fileno STDOUT or return;
> -  close STDOUT and return;
> -  warn "$ME: failed to close standard output: $!\n";
> -  $? ||= 1;
> -}
> -
> -# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
> -# "#END_VERSION_GENERATION"  It is generated by the Makefile
> -
> -#BEGIN_VERSION_GENERATION
> -$RELEASE_VERSION="";
> -$REDHAT_COPYRIGHT="";
> -$BUILD_DATE="";
> -#END_VERSION_GENERATION
> -
> -# Get the program name from $0 and strip directory names
> -$_=$0;
> -$|=1;
> -s/.*\///;
> -my $pname = $_;
> -
> -$esh="/opt/panmgr/bin/esh";
> -
> -sub usage 
> -{
> -	print "Usage:\n";
> -	print "\n";
> -	print "$pname [options]\n";
> -	print "\n";
> -	print "Options:\n";
> -	print "  -c <string>      cserver\n";
> -	print "  -h               help\n";
> -	print "  -l <string>      lpan\n";
> -	print "  -o <string>      Action: reboot (default), off, on or status\n";
> -	print "  -p <string>      pserver\n";
> -	print "  -u <string>      username (default=root)\n";
> -	print "  -f <seconds>     Wait X seconds before fencing is started\n";
> -	print "  -q               quiet mode\n";
> -	print "  -V               version\n";
> -	
> -	exit 0;
> -}
> -
> -sub fail
> -{
> -	($msg)=@_;
> -	print $msg."\n" unless defined $opt_q;
> -	$t->close if defined $t;
> -	exit 1;
> -}
> -
> -sub fail_usage
> -{
> -	($msg)=@_;
> -	print STDERR $msg."\n" if $msg;
> -	print STDERR "Please use '-h' for usage.\n";
> -	exit 1;
> -}
> -
> -
> -sub version
> -{
> -	print "$pname $RELEASE_VERSION $BUILD_DATE\n";
> -	print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
> -
> -	exit 0;
> -}
> -
> -sub print_metadata
> -{
> -print '<?xml version="1.0" ?>
> -<resource-agent name="fence_egenera" shortdesc="I/O Fencing agent for the Egenera BladeFrame" >
> -<longdesc>
> -fence_egenera  is  an I/O Fencing agent which can be used with the Egenera BladeFrame. It logs into a control blade (cserver) via ssh and operates on a process    ing  blade  (pserver) identified by the pserver name and the logical process area network (LPAN) that it is in. fence_egenera requires that ssh keys have been setup so that the fence_egenera  does not require a password to authenticate. Refer to ssh(8) for more information on setting up ssh keys.
> -</longdesc>
> -<vendor-url>http://www.bull.com</vendor-url>
> -<parameters>
> -        <parameter name="action" unique="0" required="1">
> -                <getopt mixed="-o [action]" />
> -                <content type="string" default="reboot" />
> -                <shortdesc lang="en">Fencing Action</shortdesc>
> -        </parameter>
> -        <parameter name="cserver" unique="0" required="1">
> -                <getopt mixed="-c [cserver]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">The cserver to ssh to. cserver can be in the form user at hostname to specify a different user to login as.</shortdesc>
> -        </parameter>
> -        <parameter name="pserver" unique="0" required="1">
> -                <getopt mixed="-p [pserver]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">The pserver to operate on.</shortdesc>
> -        </parameter>
> -        <parameter name="user" unique="0" required="1">
> -                <getopt mixed="-u [name]" />
> -                <content type="string" default="root" />
> -                <shortdesc lang="en">Login Name</shortdesc>
> -        </parameter>
> -        <parameter name="lpan" unique="0" required="1">
> -                <getopt mixed="-l [lpan]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">The lpan to operate on.</shortdesc>
> -        </parameter>
> -        <parameter name="delay" unique="0" required="0">
> -                <getopt mixed="-f [seconds]" />
> -                <content type="string" default="0"/>
> -                <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
> -        </parameter>
> -        <parameter name="help" unique="0" required="0">
> -                <getopt mixed="-h" />           
> -                <content type="string"  />
> -                <shortdesc lang="en">Display help and exit</shortdesc>                    
> -        </parameter>
> -</parameters>
> -<actions>
> -        <action name="on" />
> -        <action name="off" />
> -	<action name="reboot" />
> -        <action name="status" />
> -        <action name="metadata" />
> -</actions>
> -</resource-agent>
> -';
> -}
> -
> -if (@ARGV > 0) 
> -{
> -	getopts("c:hl:o:p:u:qVf:") || fail_usage ;
> -
> -	usage if defined $opt_h;
> -	version if defined $opt_V;
> -
> -	fail_usage "Unkown parameter." if (@ARGV > 0);
> -
> -
> -	$cserv  = $opt_c if defined $opt_c;
> -	$lpan   = $opt_l if defined $opt_l;
> -	$pserv  = $opt_p if defined $opt_p;
> -	$action = $opt_o if defined $opt_o;
> -	$user   = $opt_u if defined $opt_u;
> -	$delay  = $opt_f if defined $opt_f;
> -} 
> -else 
> -{
> -	get_options_stdin();
> -} 
> -
> -if (((defined $opt_o) && ($opt_o =~ /metadata/i)) || ((defined $action) && ($action =~ /metadata/i))) {
> -	print_metadata();
> -	exit 0;
> -}
> -
> -$action = "reboot" unless defined $action;
> -$user = "root" unless defined $user;
> -
> -fail "failed: no cserver defined" unless defined $cserv;
> -fail "failed: no lpan defined" unless defined $lpan;
> -fail "failed: no pserver defined" unless defined $pserv;
> -
> -fail "failed: unrecognised action: $action"
> -	unless $action =~ /^(off|on|reboot|status|pblade)$/i;
> -
> -sub get_options_stdin
> -{
> -	my $opt;
> -	my $line = 0;
> -	while( defined($in = <>) )
> -	{
> -		$_ = $in;
> -		chomp;
> -
> -		# strip leading and trailing whitespace
> -		s/^\s*//;
> -		s/\s*$//;
> -
> -		# skip comments
> -		next if /^#/;
> -
> -	        $line+=1;
> -		$opt=$_;
> -		next unless $opt;
> -
> -		($name,$val)=split /\s*=\s*/, $opt;
> -
> -		if ( $name eq "" )
> -		{
> -			print STDERR "parse error: illegal name in option $line\n";
> -			exit 2;
> -		} 
> -
> -		elsif ($name eq "agent" )
> -		{
> -			# DO NOTHING -- this field is used by fenced 
> -		}
> -
> -		elsif ($name eq "cserver" ) 
> -		{
> -			$cserv = $val;
> -		} 
> -
> -		elsif ($name eq "lpan" ) 
> -		{
> -			$lpan = $val;
> -		} 
> -
> -		elsif ($name eq "pserver" ) 
> -		{
> -			$pserv = $val;
> -		} 
> -
> -		elsif ($name eq "action" ) 
> -		{
> -			$action = $val;
> -		} 
> -
> -		elsif ($name eq "esh" ) 
> -		{
> -			$esh = $val;
> -		} 
> -		elsif ($name eq "user" )
> -		{
> -			$user = $val;
> -		}
> -		elsif ($name eq "delay" )
> -		{
> -			$delay = $val;
> -		}
> -	}
> -}
> -
> -# _pserver_query_field -- query the state of the pBlade or Status field
> -# and return it's value in $_.  
> -# Return 0 on success, or non-zero on error
> -sub _pserver_query_field
> -{
> -	my ($field,$junk) = @_;
> -
> -	if ($field ne "pBlade" && $field ne "Status")
> -	{
> -		$_="Error _pserver_query_field: unknown field of type '$field'";
> -		return 1;
> -	}
> -
> -	my $val;
> -
> -	my $cmd = "ssh -l $user $cserv $esh pserver $lpan/$pserv";
> -	my $pid = open3 (\*WTR, \*RDR,\*RDR, $cmd)
> -		or die "error open3(): $!";
> -
> -	while(<RDR>)
> -	{
> -		chomp;
> -		my $line = $_;
> -		my @fields = split /\s+/,$line;
> -
> -		if ($fields[0] eq "Error:")
> -		{
> -			$val=$line;
> -			print "Debug ERROR: $val\n";
> -			last;
> -		}
> -		elsif ($fields[0] eq $pserv)
> -		{
> -			if ( $field eq "Status" ) 
> -			{
> -				$val=$fields[1];
> -			}
> -			elsif ($field eq "pBlade" )
> -			{
> -				# grrr... Status can be "Shutting down"
> -				if ($fields[1] ne "Shutting")
> -				{
> -					$val=$fields[3];
> -				}
> -				else
> -				{
> -					$val=$fields[4];
> -				}
> -			}
> -		}
> -	}
> -
> -	close WTR;
> -	close RDR;
> -	
> -	waitpid $pid,0;
> -	my $rtrn = $?>>8;
> -	$_=$val if defined $val;
> -	return $rtrn;
> -}
> -
> -# return the pBlade of an lpan/pserver in $_.  
> -# Return 0 on success or non=zero on error
> -sub pserver_pblade
> -{
> -	_pserver_query_field "pBlade";
> -}
> -
> -# return the Status of an lpan/pserver in $_.  
> -# Return 0 on success or non=zero on error
> -sub pserver_status
> -{
> -	_pserver_query_field "Status";
> -}
> -
> -# boot an lpan/pserver.  
> -# Return 0  if the status is "Booted" or "Booting" or non-zero on failure.
> -# Continue checking the value until the status is "Boot" or "Booting" or
> -# until a timeout of 120 seconds has been reached.
> -sub pserver_boot
> -{
> -	my $rtrn=1;
> -
> -	# It seems it can take a while for a pBlade to 
> -	# boot sometimes.  We shall wait for 120 seconds
> -	# before giving up on a node returning failure
> -	for (my $trys=0; $trys<120; $trys++)
> -	{
> -		last if (pserver_status != 0);
> -
> -		my $status = $_;
> -		if ( $status eq "Booted"  || $status eq "Booting")
> -		{
> -			$rtrn=0;
> -			last;
> -		}
> -
> -		if(pserver_pblade)
> -		{
> -			die "error getting pBlade info";
> -		}
> -
> -		# Is there any harm in sending this command multiple times?
> -		my $cmd = "ssh -l $user $cserv $esh pserver -b $lpan/$pserv";
> -		my $pid = open3 (\*WTR, \*RDR,\*RDR, $cmd)
> -			or die "error open3(): $!";
> -
> -		close WTR;
> -		close RDR;
> -
> -		waitpid $pid,0;
> -		$rtrn = $?>>8;
> -
> -		sleep 1;
> -	}
> -	return $rtrn;
> -}
> -
> -# boot an lpan/pserver.  
> -# Return 0  if the status is "Shutdown" or non-zero on failure.
> -# Continue checking the value until the status is "Shutdown" or
> -# until a timeout of 20 seconds has been reached.
> -sub pserver_shutdown
> -{
> -	my $rtrn=1;
> -	local *egen_log;
> -	open(egen_log,">>/@LOGDIR@/fence_egenera.log");
> -	print egen_log "Attempting shutdown at ".`date`."\n";
> -	for (my $trys=0; $trys<20; $trys++)
> -	{
> -		last if (pserver_status != 0);
> -
> -
> -		my $status = $_;
> -                print egen_log "shutdown: $trys    $status\n";
> -		if (/^Shutdown/)
> -		{
> -			$rtrn=0;
> -			last;
> -		}
> -		elsif (/^Shutting/)
> -		{
> -			# We are already in the process of shutting down.
> -			# do I need to do anything here?  
> -			# We'll just wait for now
> -		}
> -    elsif (/^Booting/)
> -    {
> -       # Server is already on the way back up. Do nothing
> -       $rtrn=0;
> -       last;
> -    }
> -		elsif (/^Booted\(KDB\)/ || /^Debugging/ )
> -		{
> -			print egen_log "shutdown: crash dump being performed. Waiting\n";
> -			$rtrn=0;
> -			last;
> -		}
> -		else
> -		{
> -			if (pserver_pblade)
> -			{
> -				die "error getting pBlade info: $_";
> -			}
> -
> -			# is there any harm in sending this command multiple 
> -			# times?
> -			my $cmd = "ssh -l $user $cserv $esh blade -s $_";
> -                        print egen_log "shutdown: $cmd  being called, before open3\n";
> -			my $pid = open3 (\*WTR, \*RDR,\*RDR, $cmd)
> -				or die "error open3(): $!";
> -                        print egen_log "shutdown: after calling open3\n";
> -                        @outlines = <RDR>;
> -                        print egen_log "shutdown: Open3 result: ", @outlines, "\n";
> -
> -			close WTR;
> -			close RDR;
> -
> -			waitpid $pid,0;
> -			$rtrn = $?>>8;
> -		}
> -
> -		sleep 1;
> -	}
> -        print egen_log "shutdown: Returning from pserver_shutdown with return code $rtrn\n";
> -	return $rtrn;
> -}
> -
> -
> -$_=$action;
> -if (/^status$/i)
> -{
> -	if (pserver_status==0)
> -	{
> -		print "$lpan/$pserv is $_\n" unless defined $opt_q;
> -		exit 0;
> -	}
> -	else
> -	{
> -		fail "failed to get status of $lpan/$pserv: $_";
> -	}
> -}
> -elsif (/^pblade$/i)
> -{
> -	if (pserver_pblade==0)
> -	{
> -		print "$lpan/$pserv is $_\n" unless defined $opt_q;
> -		exit 0;
> -	}
> -	else
> -	{
> -		fail "failed to get pblade of $lpan/$pserv: $_";
> -	}
> -}
> -elsif (/^off$/i)
> -{
> -	sleep ($delay) if defined($delay);
> -	if (pserver_shutdown==0)
> -	{
> -		print "success: $lpan/$pserv has been shutdown\n" 
> -			unless defined $opt_q;
> -		exit 0;
> -	}
> -	else
> -	{
> -		fail "failed to shutdown $lpan/$pserv";
> -	}
> -}
> -elsif (/^on$/i)
> -{
> -	if (pserver_boot==0)
> -	{
> -		print "success: $lpan/$pserv has been turned on\n" 
> -			unless defined $opt_q;
> -		exit 0;
> -	}
> -	else
> -	{
> -		fail "failed to turn on $lpan/$pserv";
> -	}
> -}
> -elsif (/^reboot$/i)
> -{
> -	sleep ($delay) if defined($delay);
> -	if (pserver_shutdown!=0)
> -	{
> -		fail "failed to shutdown $lpan/$pserv";
> -	}
> -
> -	if (pserver_boot==0)
> -	{
> -		print "success: $lpan/$pserv has been rebooted\n" 
> -			unless defined $opt_q;
> -		exit 0;
> -	}
> -	else
> -	{
> -		fail "failed to turn on $lpan/$pserv";
> -	}
> -}
> -else
> -{
> -	die "unknown action: $action";
> -}
> diff --git a/fence/agents/mcdata/Makefile.am b/fence/agents/mcdata/Makefile.am
> deleted file mode 100644
> index 54b64fc..0000000
> --- a/fence/agents/mcdata/Makefile.am
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -MAINTAINERCLEANFILES	= Makefile.in
> -
> -TARGET			= fence_mcdata
> -
> -SRC			= $(TARGET).pl
> -
> -EXTRA_DIST		= $(SRC)
> -
> -sbin_SCRIPTS		= $(TARGET)
> -
> -man_MANS		= $(TARGET).8
> -
> -include $(top_srcdir)/make/fencebuild.mk
> -include $(top_srcdir)/make/fencemanperl.mk
> -
> -clean-local: clean-man
> -	rm -f $(TARGET)
> diff --git a/fence/agents/mcdata/fence_mcdata.pl b/fence/agents/mcdata/fence_mcdata.pl
> deleted file mode 100644
> index 3148a99..0000000
> --- a/fence/agents/mcdata/fence_mcdata.pl
> +++ /dev/null
> @@ -1,361 +0,0 @@
> -#!/usr/bin/perl
> -
> -# This works on the following firmware versions:
> -#   01.03.00
> -#   02.00.00
> -#   04.01.00
> -#   04.01.02
> -
> -use Getopt::Std;
> -use Net::Telnet ();
> -
> -my $ME = $0;
> -
> -END {
> -  defined fileno STDOUT or return;
> -  close STDOUT and return;
> -  warn "$ME: failed to close standard output: $!\n";
> -  $? ||= 1;
> -}
> -
> -# Get the program name from $0 and strip directory names
> -$_=$0;
> -s/.*\///;
> -my $pname = $_;
> -
> -$opt_o = 'disable';        # Default fence action
> -
> -# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
> -# "#END_VERSION_GENERATION"  It is generated by the Makefile
> -
> -#BEGIN_VERSION_GENERATION
> -$RELEASE_VERSION="";
> -$REDHAT_COPYRIGHT="";
> -$BUILD_DATE="";
> -#END_VERSION_GENERATION
> -
> -
> -sub usage
> -{
> -    print "Usage:\n";
> -    print "\n";
> -    print "$pname [options]\n";
> -    print "\n";
> -    print "Options:\n";
> -    print "  -a <ip>          IP address or hostname of switch\n";
> -    print "  -h               usage\n";
> -    print "  -l <name>        Login name\n";
> -    print "  -n <num>         Port number to disable\n";
> -    print "  -o <string>      Action:  disable (default), enable or metadata\n";
> -    print "  -p <string>      Password for login\n";
> -    print "  -S <path>        Script to run to retrieve login password\n";
> -    print "  -q               quiet mode\n";
> -    print "  -V               version\n";
> -
> -    exit 0;
> -}
> -
> -sub fail
> -{
> -  ($msg) = @_;
> -  print $msg."\n" unless defined $opt_q;
> -  $t->close if defined $t;
> -  exit 1;
> -}
> -
> -sub fail_usage
> -{
> -  ($msg)=@_;
> -  print STDERR $msg."\n" if $msg;
> -  print STDERR "Please use '-h' for usage.\n";
> -  exit 1;
> -}
> -
> -sub version
> -{
> -  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
> -  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
> -
> -  exit 0;
> -}
> -
> -sub print_metadata
> -{
> -print '<?xml version="1.0" ?>
> -<resource-agent name="fence_mcdata" shortdesc="I/O Fencing agent for McData FC switches" >
> -<longdesc>
> -fence_mcdata is an I/O Fencing agent which can be used with McData FC switches. It logs into a McData switch via telnet and disables a specified port. Disabling the port which a machine is connected to effectively fences that machine. Lengthy telnet connections to the switch should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions.
> -
> -After a fence operation has taken place the fenced machine can no longer connect to the McData FC switch.  When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the McData FC switch needs to be enabled. This can be done by running fence_mcdata and specifying the enable action.
> -</longdesc>
> -<vendor-url>http://www.brocade.com</vendor-url>
> -<parameters>
> -        <parameter name="action" unique="1" required="1">
> -                <getopt mixed="-o [action]" />
> -                <content type="string" default="disable" />
> -                <shortdesc lang="en">Fencing Action</shortdesc>
> -        </parameter>
> -        <parameter name="ipaddr" unique="1" required="1">
> -                <getopt mixed="-a [ip]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">IP Address or Hostname</shortdesc>
> -        </parameter>
> -        <parameter name="login" unique="1" required="1">
> -                <getopt mixed="-l [name]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Login Name</shortdesc>
> -        </parameter>
> -        <parameter name="passwd" unique="1" required="0">
> -                <getopt mixed="-p [password]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Login password or passphrase</shortdesc>
> -        </parameter>
> -        <parameter name="passwd_script" unique="1" required="0">
> -                <getopt mixed="-S [script]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Script to retrieve password</shortdesc>
> -        </parameter>
> -        <parameter name="port" unique="1" required="1">
> -                <getopt mixed="-n [id]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
> -        </parameter>
> -        <parameter name="help" unique="1" required="0">
> -                <getopt mixed="-h" />           
> -                <content type="string"  />
> -                <shortdesc lang="en">Display help and exit</shortdesc>                    
> -        </parameter>
> -</parameters>
> -<actions>
> -        <action name="enable" />
> -        <action name="disable" />
> -        <action name="status" />
> -        <action name="metadata" />
> -</actions>
> -</resource-agent>
> -';
> -}
> -
> -
> -sub get_options_stdin
> -{
> -    my $opt;
> -    my $line = 0;
> -    while( defined($in = <>) )
> -    {
> -        $_ = $in;
> -        chomp;
> -
> -	# strip leading and trailing whitespace
> -        s/^\s*//;
> -        s/\s*$//;
> -
> -	# skip comments
> -        next if /^#/;
> -
> -        $line+=1;
> -        $opt=$_;
> -        next unless $opt;
> -
> -        ($name,$val)=split /\s*=\s*/, $opt;
> -
> -        if ( $name eq "" )
> -        {  
> -           print STDERR "parse error: illegal name in option $line\n";
> -           exit 2;
> -	}
> -	
> -        # DO NOTHING -- this field is used by fenced
> -	elsif ($name eq "agent" ) { } 
> -
> -        elsif ($name eq "ipaddr" ) 
> -	{
> -            $opt_a = $val;
> -        } 
> -	elsif ($name eq "login" ) 
> -	{
> -            $opt_l = $val;
> -        } 
> -        elsif (($name eq "option" ) || ($name eq "action"))
> -        {
> -            $opt_o = $val;
> -        }
> -	elsif ($name eq "passwd" ) 
> -	{
> -            $opt_p = $val;
> -        }
> -	elsif ($name eq "passwd_script" )
> -	{
> -		$opt_S = $val;
> -	}
> -	elsif ($name eq "port" ) 
> -	{
> -            $opt_n = $val;
> -        } 
> -    }
> -}
> -
> -sub telnet_error
> -{ 
> -  fail "failed: telnet returned: ".$t->errmsg;
> -}
> -
> -######################################################################33
> -# MAIN
> -
> -if (@ARGV > 0) {
> -   getopts("a:hl:n:o:p:S:qV") || fail_usage ;
> -
> -   usage if defined $opt_h;
> -   version if defined $opt_V;
> -
> -   fail_usage "Unknown parameter." if (@ARGV > 0);
> -
> -   if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
> -     print_metadata();
> -     exit 0;
> -   }
> -
> -   fail_usage "No '-a' flag specified." unless defined $opt_a;
> -   fail_usage "No '-n' flag specified." unless defined $opt_n;
> -   fail_usage "No '-l' flag specified." unless defined $opt_l;
> -
> -   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;
> -   fail_usage "Unrecognised action '$opt_o' for '-o' flag"
> -      unless $opt_o =~ /^(disable|enable)$/i;
> -
> -} else {
> -   get_options_stdin();
> -
> -   if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
> -     print_metadata();
> -     exit 0;
> -   }
> -
> -   fail "failed: no IP address" unless defined $opt_a;
> -   fail "failed: no plug number" unless defined $opt_n;
> -   fail "failed: no login name" unless defined $opt_l;
> -
> -   if (defined $opt_S) {
> -     $pwd_script_out = `$opt_S`;
> -     chomp($pwd_script_out);
> -     if ($pwd_script_out) {
> -        $opt_p = $pwd_script_out;
> -     }
> -   }
> -
> -   fail "failed: no password" unless defined $opt_p;
> -   fail "failed: unrecognised action: $opt_o"
> -      unless $opt_o =~ /^(disable|enable)$/i;
> -}
> -
> -
> -my $block=1;
> -$_=$opt_o;
> -if(/disable/)
> -{
> -    $block=1
> -}
> -elsif(/enable/)
> -{
> -    $block=0
> -}
> -else
> -{
> -    fail "failed: unrecognised action: $opt_o"
> -}
> -
> -#
> -# Set up and log in
> -#
> -
> -$t = new Net::Telnet;
> -
> -$t->errmode(\&telnet_error);
> -$t->open($opt_a);
> -
> -$t->waitfor('/sername:/');
> -
> -# Send Username
> -$t->print($opt_l);
> -
> -# Send Password
> -$t->waitfor('/assword:/');
> -$t->print($opt_p);
> -$t->waitfor('/\>/');
> -
> -#> # Set switch to comma delimited output
> -#> $t->print("commadelim 1");
> -#> $t->waitfor('/\>/');
> -
> -# Block/Unblock the desired port
> -$t->print("config port blocked $opt_n $block");
> -($text, $match) = $t->waitfor('/\>/');
> -
> -# Verfiy that the port has been blocked/unblocked
> -$t->print("config port show $opt_n");
> -($text, $match) = $t->waitfor('/\>/');
> -
> -# scan the port configurations to make sure that
> -# the port is in the state we told it to be in
> -#
> -# Output from the prvious command will look like:
> -# 
> -# Root> config port show 0
> -#
> -# Port Information
> -# Port Number:          0
> -# Name:                 name
> -# Blocked:              true
> -# Extended Distance:    false
> -# Type:                 gPort
> -# 
> -my $fail=1;
> -
> - at lines = split /\n/,$text;
> -foreach my $line (@lines)
> -{
> -   my $field = "";
> -   my $b_state = "";
> -
> -   if ( $line =~ /^(.*):\s*(\S*)/ )
> -   {
> -      $field = $1;
> -      $b_state = $2;
> -   }
> -   next unless ( $field eq "Blocked" );
> -   if ( ($block && $b_state eq "true") ||
> -        (!$block && $b_state eq "false") ||
> -        ($block && $b_state eq "Blocked") ||
> -        (!$block && $b_state eq "Unblocked") )
> -   {
> -      $fail = 0;
> -   }
> -   last;
> -}
> -
> -# log out of the switch
> -$t->print("logout");
> -$t->close();
> -
> -if($fail)
> -{
> -   print "failed: unexpected port state\n" unless $opt_q;
> -}
> -else
> -{
> -   print "success: port $opt_n ".($block?"disabled":"enabled")."\n" 
> -      unless defined $opt_q;
> -}
> -
> -exit $fail;
> -
> -
> diff --git a/fence/agents/rackswitch/Makefile.am b/fence/agents/rackswitch/Makefile.am
> deleted file mode 100644
> index 0792308..0000000
> --- a/fence/agents/rackswitch/Makefile.am
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -MAINTAINERCLEANFILES	 = Makefile.in
> -
> -TARGET			 = fence_rackswitch
> -
> -sbin_PROGRAMS		 = $(TARGET)
> -
> -noinst_HEADERS		 = do_rack.h
> -
> -fence_rackswitch_SOURCES = do_rack.c
> -
> -man_MANS		 = $(TARGET).8
> -
> -include $(top_srcdir)/make/fencemanc.mk
> -include $(top_srcdir)/make/agentccheck.mk
> -
> -clean-local: clean-man
> -	rm -f $(TARGET)
> diff --git a/fence/agents/rackswitch/do_rack.c b/fence/agents/rackswitch/do_rack.c
> deleted file mode 100644
> index ee29153..0000000
> --- a/fence/agents/rackswitch/do_rack.c
> +++ /dev/null
> @@ -1,807 +0,0 @@
> -#include "clusterautoconfig.h"
> -
> -#include "do_rack.h"
> -
> -const char *pname = "fence_rack";
> -
> -int quiet_flag = 0;
> -int verbose_flag = 0;
> -int debug_flag = 0;
> -
> -char ipaddr[256];
> -char portnumber[256];
> -char username[256];
> -char password[256];
> -char arg[256];
> -char name[256];
> -char pwd_script[PATH_MAX] = { 0, };
> -
> -char readbuf[MAXBUF];
> -char writebuf[MAXBUF];
> -int sock;
> -
> -char op_login = 0x7e; 	        /* 126*/ 
> -char op_action = 0x66;	        /* 102 */
> -char ack_login = 0x7D;	        /* 125 */
> -
> -char action_idle = 0x00;
> -char action_reset = 0x01;
> -char action_off = 0x02;
> -char action_offon = 0x03;
> -
> -char configuration_request = 0x5b;   /* 91 */
> -char config_reply = 0x5c;            /* 92 */
> -char config_general = 0x01;
> -char config_section1 = 0x02;
> -char config_section2 = 0x03;
> -char config_section3 = 0x04;
> -
> -char message_status = 0x65;         /* 101 */
> -
> -char login_deny = 0xFF;          
> -
> -int time_out = 60;
> -
> -void ignore_message_status(void);
> -int wait_frame(char);
> -
> -/*
> - * scan input, waiting for a given frame
> - */
> -int wait_frame(char frame_id)
> -{
> -  int read_more = 1;
> -  int success = 0;
> -  int n;
> -  char target = frame_id;
> -
> -  if(debug_flag){printf("%s: Looking for frametype 0x%.2x\n",name,target);}
> -  read_more = 1;
> -  while(read_more){
> -    n = read(sock,readbuf,1);
> -    if(debug_flag){printf("%s: Found frametype 0x%.2x\n",name,readbuf[0]);}
> -    if(readbuf[0] == target){
> -      read_more = 0;
> -      success = 1;
> -    }
> -    else{
> -      if(readbuf[0] == message_status){
> -	ignore_message_status();
> -	read_more = 1;
> -      }
> -      else{
> -	if(debug_flag){printf("%s: Got unexpected frame from switch\n",name);}
> -	read_more = 0;
> -	success = 0;
> -      }
> -    }
> -  }
> -  return(success);
> -}  
> -
> -void ignore_message_status(void)
> -{
> -  int n,i;
> -  int read_more = 1;
> -  int number_of_temp;
> -  int number_of_config_mobo;
> -    
> -  if(debug_flag){printf("%s: Ignoring message-status\n",name);}
> -  read_more=1;
> -  while(read_more){
> -    n = read(sock,readbuf,1); /* status */
> -    if(n == 1)
> -      read_more = 0;
> -  }
> -
> -  read_more = 1;
> -  while(read_more){         /* Date & time */
> -    n = read(sock,readbuf,1);
> -    if(readbuf[0] == '\0'){
> -      read_more = 0;
> -    }
> -    else{
> -      read_more = 1;
> -    }
> -  }
> -   
> -  read_more = 1;
> -  number_of_temp = 0;
> -  n = read(sock,readbuf,1); /* Temprature Input count */
> -  number_of_temp = (int)readbuf[0];
> -  
> -  for(i=0;i<number_of_temp;i++){
> -    read_more = 1;
> -    while(read_more){
> -      n = read(sock,readbuf,1); /* Temprature input ID */
> -      n = read(sock,readbuf,8); /* Temprature Value, Fahrenheit */
> -      n = read(sock,readbuf,8); /* Temprature Vaule, Celcius */
> -      n = read(sock,readbuf,1); /* Temprature Alarm */
> -    }
> -  }
> -  number_of_config_mobo = 0;
> -  for(i=4;i>0;i--){
> -    read_more = 1;	
> -    while(read_more){
> -      n=read(sock,readbuf,1);
> -      if(n == 1){
> -	read_more = 0;
> -	number_of_config_mobo = number_of_config_mobo + (int)(readbuf[0]<<(8*(i-1)));
> -      }
> -    }
> -  }
> -  for(i=0;i<number_of_config_mobo;i++){
> -    n = read(sock,readbuf,4); /* Motherboard ID */
> -    n = read(sock,readbuf,1); /* Motherboard status */
> -  }
> -}
> -
> -
> -
> -static void print_usage(void)
> -{
> -  printf("Usage:\n");
> -  printf("\n");
> -  printf("%s [options]\n"
> -         "\n"
> -         "Options:\n"
> -         "  -h               usage\n"
> -	 "  -a <ip>          IP address for RackSwitch\n"
> -	 "  -n <dec num>     Physical plug number on RackSwitch\n"
> -	 "  -l <string>      Username\n"
> -	 "  -p <string>      Password\n"
> -	 "  -S <path>        Script to retrieve password\n"
> -	 "  -v               Verbose\n"
> -	 "  -q               Quiet\n"
> -         "  -V               Version information\n", pname);
> -}
> -
> -
> -
> -static void print_metadata(void)
> -{
> -  printf("<?xml version=\"1.0\" ?>\n"
> -        "<resource-agent name=\"fence_rackswitch\" shortdesc=\"fence_rackswitch - I/O Fencing agent for RackSaver RackSwitch\" >\n"
> -        "<longdesc>fence_rackswitch is an I/O Fencing agent which can be used with the RackSaver RackSwitch. It logs into the RackSwitch and boots a specified plug. Using the http interface to the RackSwitch should be avoided while a GFS cluster is running because the connection may interfere with the operation of this agent.</longdesc>\n"
> -	"<vendor-url>http://www.bladenetwork.net</vendor-url>\n"
> -	"<parameters>\n"
> -        "<parameter name=\"ipaddr\" unique=\"1\" required=\"1\">\n"
> -        "\t<getopt mixed=\"-a [ip]\" />\n"
> -        "\t<content type=\"string\"  />\n"
> -        "\t<shortdesc lang=\"en\">IP Address or Hostname</shortdesc>\n"
> -        "</parameter>\n"
> -        "<parameter name=\"login\" unique=\"1\" required=\"1\">\n"
> -        "\t<getopt mixed=\"-l [name]\" />\n"
> -        "\t<content type=\"string\"  />\n"
> -        "\t<shortdesc lang=\"en\">Login Name</shortdesc>\n"
> -        "</parameter>\n"
> -        "<parameter name=\"passwd\" unique=\"1\" required=\"0\">\n"
> -        "\t<getopt mixed=\"-p [password]\" />\n"
> -        "\t<content type=\"string\"  />\n"
> -        "\t<shortdesc lang=\"en\">Login password or passphrase</shortdesc>\n"
> -        "</parameter>\n"
> -        "<parameter name=\"passwd_script\" unique=\"1\" required=\"0\">\n"
> -        "\t<getopt mixed=\"-S [script]\" />\n"
> -        "\t<content type=\"string\"  />\n"
> -        "\t<shortdesc lang=\"en\">Script to retrieve password</shortdesc>\n"
> -        "</parameter>\n"
> -	"</parameters>\n"
> -	"<actions>\n"
> -	"\t<action name=\"metadata\" />\n"
> -	"</actions>\n"
> -	"</resource-agent>\n");
> -}
> -
> -static void get_options(int argc, char **argv)
> -{
> -  int c;
> -  char *value;
> -
> -  if (argc > 1){  
> -    /*
> -     * Command line input
> -     */
> -    while ((c = getopt(argc, argv, "ha:n:l:p:S:vqVdo:")) != -1)
> -      {
> -	switch(c)
> -	  {
> -	  case 'h':
> -	    print_usage();
> -	    exit(DID_SUCCESS);
> -	
> -	  case 'a':
> -	    strncpy(ipaddr,optarg,254);
> -	    break;
> -
> -	  case 'n':
> -	    strncpy(portnumber,optarg,254);
> -	    break;
> -
> -	  case 'l':
> -	    strncpy(username,optarg,254);	
> -	    break;
> -
> -	  case 'p':
> -	    strncpy(password,optarg,254);
> -	    break;
> -
> -	  case 'S':
> -		strncpy(pwd_script, optarg, sizeof(pwd_script));
> -		pwd_script[sizeof(pwd_script) - 1] = '\0';
> -		break;
> -
> -	  case 'v':
> -	    verbose_flag = 1;
> -	    break;
> -
> -	  case 'q':
> -	    quiet_flag = 1;
> -	    break;
> -
> -	  case 'd':
> -	    debug_flag = 1;
> -	    break;
> -
> -	  case 'V':
> -	    printf("%s %s (built %s %s)\n", pname, VERSION,
> -		   __DATE__, __TIME__);
> -	    printf("%s\n", REDHAT_COPYRIGHT);
> -	    exit(DID_SUCCESS);
> -	    break;
> -
> -	  case ':':
> -	  case '?':
> -	    fprintf(stderr, "Please use '-h' for usage.\n");
> -	    exit(DID_FAILURE);
> -	    break;
> -          
> -          case 'o':
> -            if (strncasecmp(optarg, "metadata", 254) == 0) {
> -              print_metadata();
> -              exit(DID_SUCCESS);              
> -            } else {
> -              fprintf(stderr, "Only 'metadata' option is aviable for this fence agent\n");
> -              exit(DID_FAILURE);
> -            }
> -            break;
> -
> -	  default:
> -	    fprintf(stderr, "Bad programmer! You forgot to catch the %c flag\n", c);
> -	    exit(DID_FAILURE);
> -	    break;
> -
> -	  }
> -      }
> -    strcpy(name, pname);
> -  }
> -  else{
> -    errno = 0;
> -    while(fgets(arg, 256, stdin) != NULL){    
> - if( (value = strchr(arg, '\n')) == NULL){
> -        fprintf(stderr, "line too long: '%s'\n", arg);
> -	exit(DID_FAILURE);
> -      }
> -      *value = 0;
> -      if( (value = strchr(arg, '=')) == NULL){
> -        /* in this agent we can ignore options without value
> -         * as we don't need any of them, here. But we should
> -         * accept and ignore them.
> -         */
> -        fprintf(stderr, "invalid input: '%s'\n", arg);
> -        continue;
> -      }
> -      *value = 0;
> -      value++;
> -    /*  bahfuck. "agent" is not passed to us anyway
> -     *  if (!strcmp(arg, "agent")){
> -      *  strcpy(name, value);
> -       * pname = name;
> -      *}
> -      */
> -      strcpy(name, pname);
> -      if (!strcmp(arg, "ipaddr"))
> -        strcpy(ipaddr, value);
> -
> -      if (!strcmp(arg, "action")) 
> -        if (strncasecmp(value, "metadata", 254) == 0) {
> -          print_metadata();
> -          exit(DID_SUCCESS);              
> -        } else {
> -          fprintf(stderr, "Only 'metadata' option is aviable for this fence agent\n");
> -          exit(DID_FAILURE);
> -        } 
> -      
> -      if (!strcmp(arg, "portnumber"))
> -        strcpy(portnumber, value);
> -      
> -      if (!strcmp(arg, "username"))
> -        strcpy(username, value);
> -      
> -      if (!strcmp(arg, "password"))
> -        strcpy(password, value);
> -
> -	  if (!strcasecmp(arg, "passwd_script")) {
> -		strncpy(pwd_script, optarg, sizeof(pwd_script));
> -		pwd_script[sizeof(pwd_script) - 1] = '\0';
> -	  }
> -    }
> -    errno = 0;
> -    
> -  }
> -
> -  if (pwd_script[0] != '\0') {
> -	FILE *fp;
> -	char pwd_buf[1024];
> -
> -	fp = popen(pwd_script, "r");
> -	if (fp != NULL) {
> -		ssize_t len = fread(pwd_buf, 1, sizeof(pwd_buf), fp);
> -		if (len > 0) {
> -			char *p;
> -			p = strchr(pwd_buf, '\n');
> -			if (p != NULL)
> -				*p = '\0';
> -			p = strchr(pwd_buf, '\r');
> -			if (p != NULL)
> -				*p = '\0';
> -			strncpy(password, pwd_buf, sizeof(password));
> -			password[sizeof(password) - 1] = '\0';
> -		}
> -		pclose(fp);
> -	}
> -  }
> -}
> -
> -static void sig_alarm(int sig)
> -{
> - if(!quiet_flag){
> -   fprintf(stderr,"failed: %s: Timeout, nothing happened for %d seconds.\n", pname, time_out);
> -   fprintf(stderr,"failed: %s: Perhaps you should inspect the RackSwitch at %s\n",pname,ipaddr);
> - }
> - exit(DID_FAILURE);	
> -}
> -
> -
> -int main(int argc, char **argv)
> -{
> -  int n,i,j,pnumb;
> -  int ip_portnumber = 1025;
> -  char boardnum = 0x00;
> -  /*char number_of_action = 0x01;*/
> -  int number_of_config_mobo = 0;
> -  int number_of_section_config_mobo = 0;
> -  int exit_status= 0;
> -  int success_off = 0;
> -  /*int success_on = 0;*/
> -  int read_more = 1;
> -  struct sockaddr_in rackaddr; 
> -  
> -  /*char mobo_enabled = 0x01;*/
> -  /*char mobo_default_status = 0x00;*/
> -  /*char mobo_output_status = 0x00;*/
> -  int this_mobo = 0;
> -  /*int mobo_id = 0;*/
> -  /*int our_mobo = 0;*/
> -  int number_of_temp = 0;
> -
> -  memset(arg, 0, 256);
> -  memset(name, 0, 256);
> -  memset(ipaddr, 0, 256);
> -  memset(portnumber,0,256);
> -  memset(username,0,256);
> -  memset(password,0,256);
> -
> -  /*
> -   * Ensure that we always get out of the fencing agent
> -   * even if things get fucked up and we get no replies
> -   */
> -  signal(SIGALRM, &sig_alarm);
> -  alarm(time_out);
> -  get_options(argc, argv);
> -
> -  if(name[0] == '\0')
> -  {
> -    if(!quiet_flag)
> -      fprintf(stderr,"failed: no name for this program\n");
> -    exit(DID_FAILURE);
> -  }
> -  
> -  if(ipaddr[0] == '\0')
> -  {
> -    if(!quiet_flag)
> -      fprintf(stderr,"failed: %s, no IP address given\n",name);
> -    exit(DID_FAILURE);
> -  }
> -  if (portnumber[0] == '\0')
> -  {
> -    if(!quiet_flag)
> -      fprintf(stderr,"failed: %s, no portnumber given\n",name);
> -    exit(DID_FAILURE);
> -  }
> -  if (username[0] == '\0')
> -  {
> -    if(!quiet_flag)
> -      fprintf(stderr,"failed: %s, no username given\n",name);
> -    exit(DID_FAILURE);
> -  }
> -
> -  if (password[0] == '\0')
> -  {
> -    if(!quiet_flag)
> -      fprintf(stderr,"failed: %s, no password given\n",name);
> -    exit(DID_FAILURE);
> -  }
> -  /*
> -   * Port number given to us as a string.
> -   * Does the number make sense?
> -   */
> -  pnumb = 0;
> -  for(n=0;(portnumber[n]!='\0');n++){
> -    if((portnumber[n] < 48) || (portnumber[n] > 57)){
> -      if(!quiet_flag)
> -	fprintf(stderr,"failed: %s, invalid port number\n",name);
> -      exit(1);
> -    }
> -    pnumb = ((pnumb * 10) + ((int)(portnumber[n]) - 48));
> -  }
> -  /*
> -   * what section of the rack is this port part of?
> -   * The switch has 4 "subsections", called boardnum here
> -   */
> -  if((pnumb > 0) && (pnumb < 47))
> -    boardnum = 0x02;
> -  if((pnumb > 46) && (pnumb < 94))
> -    boardnum = 0x03;
> -  if((pnumb > 93) && (pnumb < 137))
> -    boardnum = 0x04;
> -  if((pnumb < 1) || (pnumb> 136)){
> -    boardnum = 0x00;
> -    if(!quiet_flag)
> -      fprintf(stderr,"failed: %s, the portnumber given is not in the range [1 - 136]\n",name);
> -    exit(DID_FAILURE);
> -  } 
> -  /*********************************************
> -   ***
> -   *** set up TCP connection to the rackswitch
> -   ***
> -   ********************************************/
> -  if ((sock = socket(AF_INET,SOCK_STREAM,0)) < 0){
> -    fprintf(stderr,"failed: %s: socket error, %s\n",name,strerror(errno));
> -    exit(DID_FAILURE);
> -  }
> -  
> -  bzero(&rackaddr,sizeof(rackaddr));
> -  rackaddr.sin_family = AF_INET;
> -  rackaddr.sin_port = htons(ip_portnumber);
> -
> -  if(inet_pton(AF_INET,ipaddr,&rackaddr.sin_addr) <= 0){
> -    fprintf(stderr,"failed: %s: inet_pton error\n", name);
> -  }
> - 
> -  if(connect(sock,(SA *) &rackaddr,sizeof(rackaddr)) < 0){
> -    fprintf(stderr,"failed: %s: connect error to %s, %s\n", name, ipaddr,strerror(errno));
> -    exit(DID_FAILURE);
> -  }
> -  /**********************************************
> -   ***
> -   ***	Send Login Frame
> -   ***
> -   *********************************************/
> -  writebuf[0] = op_login;
> -   
> -  for(n=0;n<=(strlen(username));n++){
> -    writebuf[sizeof(char)+n] = username[n];
> -  }
> -  writebuf[sizeof(char)+(strlen(username))+1] ='\n';
> -   
> -  for(n=0;n<=(strlen(password))+1;n++){
> -    writebuf[sizeof(char)+strlen(username)+1+n] = password[n];
> -  }
> -  writebuf[sizeof(char)+(strlen(username))+1+(strlen(password))+1] ='\n';
> -     
> -  if(write(sock,writebuf,sizeof(char)+strlen(username)+strlen(password)+2) < 0) {
> -    fprintf(stderr,"failed to write to socket\n");
> -    exit(DID_FAILURE);
> -  }
> -   
> -  /********************************************
> -   ***
> -   ***	Read Login Reply
> -   ***
> -   *******************************************/
> - if(wait_frame(ack_login)){
> -   n=read(sock,readbuf,1);
> -   if(readbuf[0] == login_deny){
> -     if(!quiet_flag){fprintf(stderr,"failed: %s: Not able to log into RackSwitch\n",name);}
> -     exit(DID_FAILURE);
> -   }
> -   else{
> -     if(verbose_flag){printf("%s: Successfully logged into RackSwitch\n",name);}
> -   }
> -  }
> -
> - /********************************************
> -  ***
> -  ***	Send Configuration Request Message
> -  ***
> -  *******************************************/
> - 
> - writebuf[0] = configuration_request;
> - writebuf[1] = config_general;
> - if(write(sock,writebuf,2*(sizeof(char))) < 0) {
> -   fprintf(stderr,"failed to write to socket\n");
> -   exit(DID_FAILURE);
> - }
> -
> - /********************************************
> -   ***
> -   ***	Read General Configuration Message
> -   ***
> -   *******************************************/
> -
> - if(wait_frame(config_reply)){
> -   n = read(sock,readbuf,1);
> -   if(readbuf[0] == config_general){
> -
> -     /* Configuration Status, one byte */
> -     n = read(sock,readbuf,1);
> -     
> -     /* Switch description, string */
> -     read_more = 1;
> -     while(read_more){         
> -       n = read(sock,readbuf,1);
> -       if(readbuf[0] == '\0'){
> -	 read_more = 0;
> -       }
> -       else{
> -	 read_more = 1;
> -       }
> -     }
> -     
> -     /* Serial number, string */
> -     read_more = 1;
> -     while(read_more){
> -       n = read(sock,readbuf,1);
> -       if(readbuf[0] == '\0'){
> -	 read_more = 0;
> -       }
> -       else{
> -	 read_more = 1;
> -       }
> -     }
> -
> -       	  /* Version number, string */
> -     read_more = 1;
> -     while(read_more){
> -       n = read(sock,readbuf,1);
> -       if(readbuf[0] == '\0'){
> -	 read_more = 0;
> -       }
> -       else{
> -	 read_more = 1;
> -       }
> -     }
> -
> -     /* number of configured temps, 1 byte */
> -     number_of_temp = 0; 
> -     n = read(sock,readbuf,1);
> -     number_of_temp = (int)readbuf[0];
> -     
> -     for(i=0;i<number_of_temp;i++){
> -
> -       /* Temprature description, string */
> -       read_more = 1;
> -       while(read_more){ 
> -	 read_more = 1;
> -	 while(read_more){         
> -	   n = read(sock,readbuf,1);
> -	   if(readbuf[0] == '\0'){
> -	     read_more = 0;
> -	   }
> -	   else{
> -	     read_more = 1;
> -	   }
> -	 }
> -       }
> -       
> -       n = read(sock,readbuf,1); /* Temprature input ID */
> -       n = read(sock,readbuf,1); /* Tempratue unit */
> -       n = read(sock,readbuf,8); /* Temprature HI alarm */
> -       n = read(sock,readbuf,8); /* Temprature LO alarm */
> -       n = read(sock,readbuf,1); /* Temprature HI Alarm */
> -       n = read(sock,readbuf,1); /* Temprature LO Alarm */
> -       n = read(sock,readbuf,1); /* Temprature Alarm email */
> -     }
> -     /* Number of configured motherboards */
> -     number_of_config_mobo = 0;
> -     for(i=4;i>0;i--){
> -       read_more = 1;	
> -       while(read_more){
> -	 n=read(sock,readbuf,1);
> -	 if(n == 1){
> -	   read_more = 0;
> -	   number_of_config_mobo = number_of_config_mobo + (int)(readbuf[0]<<(8*(i-1)));
> -	 }
> -       }
> -     }
> -     /*
> -      * make sure the motherboard we are asked to turn of is configured
> -      */
> -     if(pnumb > number_of_config_mobo){
> -       if(!quiet_flag){
> -	 fprintf(stderr,"failed: %s asked to reboot port %d, but there are only %d ports configured\n",name,pnumb,number_of_config_mobo);
> -	 exit(DID_FAILURE);
> -       }
> -     }
> -     n = read(sock,readbuf,1); /* email alarms */
> -     n = read(sock,readbuf,4); /* email alarm delay */
> -
> -     /* email addresses, string */
> -     read_more = 1;
> -     while(read_more){         
> -       n = read(sock,readbuf,1);
> -       if(readbuf[0] == '\0'){
> -	 read_more = 0;
> -       }
> -       else{
> -	 read_more = 1;
> -       }
> -     }
> -     
> -     n = read(sock,readbuf,4); /* reset action duration */
> -     n = read(sock,readbuf,4); /* power off action duration */
> -     n = read(sock,readbuf,4); /* power on action duration */
> -   }
> -   else{
> -     if(debug_flag){fprintf(stderr,"failed: %s: Did not receive general configuration frame when requested\n",name);}
> -     exit(DID_FAILURE);
> -   }
> - }
> - else{
> -   if(debug_flag){fprintf(stderr,"failed: %s: Did not receive configuration frame when requested\n",name);}
> -   exit(DID_FAILURE);
> - }
> -
> -
> -
> - /******************************************
> -  ***
> -  ***	Send Action packet to switch
> -  ***	Off/On port <portnum>
> -  ***
> -  *****************************************/
> - memset(writebuf,0,sizeof(writebuf));
> - writebuf[0] = op_action; 
> - writebuf[1] = (char)(number_of_config_mobo >> 24);
> - writebuf[2] = (char)(number_of_config_mobo >> 16);
> - writebuf[3] = (char)(number_of_config_mobo >> 8);
> - writebuf[4] = (char)(number_of_config_mobo);
> - 
> - writebuf[(pnumb*5)+0] = (char)(pnumb >> 24);
> - writebuf[(pnumb*5)+1] = (char)(pnumb >> 16);
> - writebuf[(pnumb*5)+2] = (char)(pnumb >> 8);
> - writebuf[(pnumb*5)+3] = (char)(pnumb);
> - writebuf[(pnumb*5)+4] = action_offon;
> -
> - if(write(sock,writebuf,(pnumb*5)+5) < 0) {
> -   fprintf(stderr,"failed to write to socket\n");
> -   exit(DID_FAILURE);
> - }
> - if(verbose_flag){
> -   printf("%s: sending action frame to switch:\n",name);
> -   for(i=0;i<(pnumb*5)+5;i++) 
> -     printf("0x%.2x ",writebuf[i]);
> -   printf("\n");
> - }
> -
> -  /******************************************
> -   ***
> -   ***	Send Configuration Request packet to switch
> -   ***
> -   *****************************************/
> - memset(writebuf,0,sizeof(writebuf));
> - writebuf[0] = configuration_request;
> - writebuf[1] = boardnum;
> - 
> - if(write(sock,writebuf,2*(sizeof(char))) < 0) {
> -   fprintf(stderr,"failed to write to socket\n");
> -   exit(DID_FAILURE);
> - }
> - if(verbose_flag){
> -   printf("%s: sending Request Configuration Frame from switch:\n",name);
> -   printf("0x%.2x 0x%.2x\n",writebuf[0],writebuf[1]);
> - }
> -
> - /*******************************************
> -  ***
> -  ***	Read Switch Status Message
> -  ***
> -  ******************************************/
> - while(success_off == 0){
> -   if(debug_flag){
> -     printf("%s: Status does not indicate port %d being rebooted. Looking again\n",name,pnumb);}
> -   if(wait_frame(message_status)){
> -     n = read(sock,readbuf,1); /* Rackswitch status */
> -     
> -     read_more = 1;
> -     while(read_more){         /* Date & time */
> -       n = read(sock,readbuf,1);
> -       if(readbuf[0] == '\0'){
> -	 read_more = 0;
> -       }
> -       else{
> -	 read_more = 1;
> -       }
> -     }
> -     number_of_temp = 0;
> -     n = read(sock,readbuf,1);
> -     number_of_temp = readbuf[0];
> -     for(i=0;i<number_of_temp;i++){
> -       read_more = 1;
> -       while(read_more){
> -	 n = read(sock,readbuf,1); /* Temprature input ID */
> -	 n = read(sock,readbuf,8); /* Temprature Value, Fahrenheit */
> -	 n = read(sock,readbuf,8); /* Temprature Vaule, Celcius */
> -	 n = read(sock,readbuf,1); /* Temprature Alarm */
> -       }
> -     }
> -     
> -     /* number of motherboards, 4 byte */
> -     number_of_section_config_mobo = 0;
> -     for(i=4;i>0;i--){
> -       read_more = 1;	
> -       while(read_more){
> -	 n=read(sock,readbuf,1);
> -	 if(n == 1){
> -	   read_more = 0;
> -	   number_of_section_config_mobo = number_of_section_config_mobo + (int)(readbuf[0]<<(8*(i-1)));
> -	 }
> -       }
> -     }
> -     
> -     for(i=0;i<number_of_section_config_mobo;i++){
> -       
> -       this_mobo = 0;
> -       for(j=4;j>0;j--){
> -	 read_more = 1;	
> -	 while(read_more){
> -	   n=read(sock,readbuf,1);
> -	   if(n == 1){
> -	     read_more = 0;
> -	     this_mobo = this_mobo + (int)(readbuf[0]<<(8*(j-1)));
> -	   }
> -	 }
> -       }
> -       if(debug_flag){printf("%s: port %d is currently ",name,this_mobo);}
> -       n = read(sock,readbuf,1); /* Motherboard status */
> -       if(debug_flag){printf("0x%.2x\n",readbuf[0]);}
> -       if((pnumb == this_mobo) && ((readbuf[0] == 0x02)||(readbuf[0] == 0x03))){
> -	 success_off = 1;
> -	 if(verbose_flag){printf("%s: Status shows port %d being rebooted\n",name,this_mobo);}
> -       }
> -     } /* end number_of_section_mobo loop */
> -     if(!success_off){
> -       if(verbose_flag){printf("%s: Status shows port %d NOT being rebooted, asking for status again\n",name,pnumb);}
> -     }
> -   }
> -   else{
> -     if(debug_flag){fprintf(stderr,"%s: Did not receive Switch Status Message\n",name);}
> -     exit(DID_FAILURE);
> -   }
> - }
> -
> -
> - if(success_off){
> -	 if(!quiet_flag){	
> -   printf("success: %s: successfully told RackSwitch to reboot port %d\n",name,pnumb);
> -	 }   
> -   alarm(0);
> -   exit_status = DID_SUCCESS;
> - }
> - return(exit_status);
> -}
> -/* And that is it. There is no more.
> - * Maybe there  should be more?
> - * Or maybe not?
> - * But there is no more
> - */
> diff --git a/fence/agents/rackswitch/do_rack.h b/fence/agents/rackswitch/do_rack.h
> deleted file mode 100644
> index 63c1365..0000000
> --- a/fence/agents/rackswitch/do_rack.h
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -
> -#include <unistd.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
> -#include <limits.h>
> -#include <fcntl.h>
> -#include <errno.h>
> -#include <ctype.h>
> -
> -#include <sys/socket.h>
> -#include <sys/types.h>
> -
> -#include <arpa/inet.h>
> -
> -#include <signal.h>
> -
> -#include "copyright.cf"
> -
> -#define SA struct sockaddr
> -
> -
> -#define MAXBUF 1200
> -
> -#define DID_SUCCESS 0
> -#define DID_FAILURE 1 
> -
> diff --git a/fence/agents/vixel/Makefile.am b/fence/agents/vixel/Makefile.am
> deleted file mode 100644
> index 3159e50..0000000
> --- a/fence/agents/vixel/Makefile.am
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -MAINTAINERCLEANFILES	= Makefile.in
> -
> -TARGET			= fence_vixel
> -
> -SRC			= $(TARGET).pl
> -
> -EXTRA_DIST		= $(SRC)
> -
> -sbin_SCRIPTS		= $(TARGET)
> -
> -man_MANS		= $(TARGET).8
> -
> -include $(top_srcdir)/make/fencebuild.mk
> -include $(top_srcdir)/make/fencemanperl.mk
> -
> -clean-local: clean-man
> -	rm -f $(TARGET)
> diff --git a/fence/agents/vixel/fence_vixel.pl b/fence/agents/vixel/fence_vixel.pl
> deleted file mode 100644
> index 2080909..0000000
> --- a/fence/agents/vixel/fence_vixel.pl
> +++ /dev/null
> @@ -1,267 +0,0 @@
> -#!/usr/bin/perl
> -
> -use Getopt::Std;
> -use Net::Telnet ();
> -
> -my $ME = $0;
> -
> -END {
> -  defined fileno STDOUT or return;
> -  close STDOUT and return;
> -  warn "$ME: failed to close standard output: $!\n";
> -  $? ||= 1;
> -}
> -
> -# Get the program name from $0 and strip directory names
> -$_=$0;
> -s/.*\///;
> -my $pname = $_;
> -
> -# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
> -# "#END_VERSION_GENERATION"  It is generated by the Makefile
> -
> -#BEGIN_VERSION_GENERATION
> -$RELEASE_VERSION="";
> -$REDHAT_COPYRIGHT="";
> -$BUILD_DATE="";
> -#END_VERSION_GENERATION
> -
> -
> -sub usage 
> -{
> -    print "Usage:\n\n"; 
> -    print "$pname [options]\n\n";
> -    print "Options:\n";
> -    print "  -a <ip>          IP address or hostname of switch\n";
> -    print "  -h               Usage\n";
> -    print "  -o metadata      print XML metadata for fence agent\n";
> -    print "  -n <num>         Port number to disable\n";
> -    print "  -p <string>      Password for login\n";
> -    print "  -S <path>        Script to run to retrieve login password\n";
> -    print "  -V               version\n\n";
> -
> -    exit 0;
> -}
> -
> -sub fail
> -{
> -  ($msg) = @_;
> -  print $msg."\n" unless defined $opt_q;
> -  $t->close if defined $t;
> -  exit 1;
> -}
> -
> -sub fail_usage
> -{
> -  ($msg) = @_;
> -  print STDERR $msg."\n" if $msg;
> -  print STDERR "Please use '-h' for usage.\n";
> -  exit 1;
> -}
> -
> -sub version
> -{
> -  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
> -  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
> -
> -  exit 0;
> -}
> -
> -sub print_metadata
> -{
> -print '<?xml version="1.0" ?>
> -<resource-agent name="fence_vixel" shortdesc="I/O Fencing agent for Vixel FC switches" >
> -<longdesc>
> -fence_vixel is an I/O Fencing agent which can be used with Vixel FC switches. It logs into a Vixel switch via telnet and removes the specified port from the zone. Removing the zone access from the port disables the port from being able to access the storage.
> -
> -After a fence operation has taken place the fenced machine can no longer connect to the Vixel FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the Vixel FC switch needs to be enabled. In order to do this, log into the Vixel FC switch. Then go to:
> -
> -config->zones->config [port] [comma-separated-list-of-ports-in-the-zone]
> -
> -Then apply. Consult the Vixel manual for details.
> -</longdesc>
> -<vendor-url>http://www.emulex.com</vendor-url>
> -<parameters>
> -        <parameter name="ipaddr" unique="1" required="1">
> -                <getopt mixed="-a [ip]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">IP Address or Hostname</shortdesc>
> -        </parameter>
> -        <parameter name="passwd" unique="1" required="0">
> -                <getopt mixed="-p [password]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Login password or passphrase</shortdesc>
> -        </parameter>
> -        <parameter name="passwd_script" unique="1" required="0">
> -                <getopt mixed="-S [script]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Script to retrieve password</shortdesc>
> -        </parameter>
> -        <parameter name="port" unique="1" required="1">
> -                <getopt mixed="-n [id]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
> -        </parameter>
> -        <parameter name="help" unique="1" required="0">
> -                <getopt mixed="-h" />           
> -                <content type="string"  />
> -                <shortdesc lang="en">Display help and exit</shortdesc>                    
> -        </parameter>
> -</parameters>
> -<actions>
> -        <action name="metadata" />
> -</actions>
> -</resource-agent>
> -';
> -}
> -
> -
> -if (@ARGV > 0) {
> -    getopts("a:hn:p:S:Vo:") || fail_usage ;
> -
> -    usage if defined $opt_h;
> -    version if defined $opt_V;
> -
> -    fail_usage "Unknown parameter." if (@ARGV > 0);
> -
> -    if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
> -        print_metadata();
> -        exit 0;
> -    }
> -
> -    fail_usage "No '-a' flag specified." unless defined $opt_a;
> -
> -	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;
> -    fail_usage "No '-n' flag specified." unless defined $opt_n;
> -
> -} else {
> -    get_options_stdin();
> -
> -    fail "failed: no IP address for the Vixel." unless defined $opt_a;
> -
> -	if (defined $opt_S) {
> -		$pwd_script_out = `$opt_S`;
> -		chomp($pwd_script_out);
> -		if ($pwd_script_out) {
> -			$opt_p = $pwd_script_out;
> -		}
> -	}
> -
> -    fail "failed: no password provided." unless defined $opt_p;
> -    fail "failed: no port number specified." unless defined $opt_n;
> -}
> -
> -#
> -# Set up and log in
> -#
> -
> -$t = new Net::Telnet;
> -
> -$t->open($opt_a);
> -
> -$t->waitfor('/assword:/');
> -
> -$t->print($opt_p);
> -
> -($out, $match)= $t->waitfor(Match => '/\>/', Match => '/assword:/');
> -
> -if ($match =~ /assword:/) {
> -  fail "failed: incorrect password\n";
> -} elsif ( $match !~ />/ ) {
> -  fail "failed: timed out waiting for prompt\n";
> -}
> - 
> -$t->print("config");
> -
> -$t->waitfor('/\(config\)\>/');
> -
> -$t->print("zone");
> -
> -$t->waitfor('/\(config\/zone\)\>/');
> -
> -#
> -# Do the command
> -#
> -
> -$cmd = "config $opt_n \"\"";
> -$t->print($cmd);
> -
> -$t->waitfor('/\(config\/zone\)\>/');
> -
> -$t->print("apply");
> -
> -($text, $match) = $t->waitfor('/\>/');
> -if ($text !~ /[Oo][Kk]/) {
> -	fail "failed: error from switch\n";
> -}
> -
> -$t->print("exit");
> -
> -print "success: zonedisable $opt_n\n";
> -exit 0;
> -
> -
> -sub get_options_stdin
> -{
> -	my $opt;
> -	my $line = 0;
> -
> -	while( defined($in = <>) )
> -	{
> -		$_ = $in;
> -		chomp;
> -
> -		# strip leading and trailing whitespace
> -		s/^\s*//;
> -		s/\s*$//;
> -
> -		# skip comments
> -		next if /^#/;
> -
> -		$line+=1;
> -		$opt=$_;
> -		next unless $opt;
> -
> -		($name,$val)=split /\s*=\s*/, $opt;
> -
> -		if ( $name eq "" ) {
> -			print("parse error: illegal name in option $line\n");
> -			exit 2;
> -		} 
> -
> -		# DO NOTHING -- this field is used by fenced
> -		elsif ($name eq "agent" ) { }
> -
> -		# FIXME -- depricated.  use "port" instead.
> -		elsif ($name eq "fm" ) {
> -			(my $dummy,$opt_n) = split /\s+/,$val;
> -			print STDERR "Depricated \"fm\" entry detected. Refer to man page.\n";
> -		} 
> -		elsif ($name eq "ipaddr" ) 
> -		{
> -			$opt_a = $val;
> -		} 
> -		elsif ($name eq "name" ) { }
> -		elsif ($name eq "passwd" ) 
> -		{
> -			$opt_p = $val;
> -		}
> -		elsif ($name eq "passwd_script" )
> -		{
> -			$opt_S = $val;
> -		} 
> -		elsif ($name eq "port" ) 
> -		{
> -			$opt_n = $val;
> -		} 
> -	}
> -}
> -
> diff --git a/fence/agents/xcat/Makefile.am b/fence/agents/xcat/Makefile.am
> deleted file mode 100644
> index ef99def..0000000
> --- a/fence/agents/xcat/Makefile.am
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -MAINTAINERCLEANFILES	= Makefile.in
> -
> -TARGET			= fence_xcat
> -
> -SRC			= $(TARGET).pl
> -
> -EXTRA_DIST		= $(SRC)
> -
> -sbin_SCRIPTS		= $(TARGET)
> -
> -man_MANS		= $(TARGET).8
> -
> -include $(top_srcdir)/make/fencebuild.mk
> -include $(top_srcdir)/make/fencemanperl.mk
> -
> -clean-local: clean-man
> -	rm -f $(TARGET)
> diff --git a/fence/agents/xcat/fence_xcat.pl b/fence/agents/xcat/fence_xcat.pl
> deleted file mode 100644
> index c2937c9..0000000
> --- a/fence/agents/xcat/fence_xcat.pl
> +++ /dev/null
> @@ -1,250 +0,0 @@
> -#!/usr/bin/perl
> -
> -use Getopt::Std;
> -
> -my $ME = $0;
> -
> -END {
> -  defined fileno STDOUT or return;
> -  close STDOUT and return;
> -  warn "$ME: failed to close standard output: $!\n";
> -  $? ||= 1;
> -}
> -
> -# Get the program name from $0 and strip directory names
> -$_=$0;
> -s/.*\///;
> -my $pname = $_;
> -
> -$opt_o = 'reset';        # Default fence action
> -$opt_r = 'rpower';        # Default fence action
> -
> -# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
> -# "#END_VERSION_GENERATION"  It is generated by the Makefile
> -
> -#BEGIN_VERSION_GENERATION
> -$RELEASE_VERSION="";
> -$REDHAT_COPYRIGHT="";
> -$BUILD_DATE="";
> -#END_VERSION_GENERATION
> -
> -
> -sub usage
> -{
> -    print "Usage:\n";
> -    print "\n";
> -    print "$pname [options]\n";
> -    print "\n";
> -    print "Options:\n";
> -    print "  -h               usage\n";
> -    print "  -n <name>        nodename\n";
> -    print "  -o <string>      Action: on, off, reset (default), status or metadata\n";
> -    print "  -r <rpower>      rpower command\n";
> -    print "  -q               quiet mode\n";
> -    print "  -V               version\n";
> -
> -    exit 0;
> -}
> -
> -sub fail
> -{
> -  ($msg) = @_;
> -  print $msg."\n" unless defined $opt_q;
> -  $t->close if defined $t;
> -  exit 1;
> -}
> -
> -sub fail_usage
> -{
> -  ($msg)=@_;
> -  print STDERR $msg."\n" if $msg;
> -  print STDERR "Please use '-h' for usage.\n";
> -  exit 1;
> -}
> -
> -sub version
> -{
> -  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
> -  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
> -
> -  exit 0;
> -}
> -
> -sub print_metadata
> -{
> -print '<?xml version="1.0" ?>
> -<resource-agent name="fence_xcat" shortdesc="I/O Fencing agent for xcat environments" >
> -<longdesc>
> -fence_xcat is a wrapper to the rpower(1) command that is distributed with the xCAT project available at http://www.xcat.org. Use of fence_xcat requires that xcat has already been properly configured for your environment. Refer to xCAT(1) for more information on configuring xCAT.
> -
> -NOTE: It is recommended that fence_bladecenter(8) is used instead of fence_xcat if the bladecenter firmware supports telnet.  This interface is much cleaner and easier to setup.
> -</longdesc>
> -<vendor-url>http://www.xcat.org</vendor-url>
> -<parameters>
> -        <parameter name="action" unique="1" required="1">
> -                <getopt mixed="-o [action]" />
> -                <content type="string" default="restart" />
> -                <shortdesc lang="en">Fencing Action</shortdesc>
> -        </parameter>
> -        <parameter name="nodename" unique="1" required="1">
> -                <getopt mixed="-n [nodename]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">The nodename as defined in nodelist.tab of the xCAT setup.</shortdesc>
> -        </parameter>
> -        <parameter name="rpower" unique="1" required="0">
> -                <getopt mixed="-r [rpower]" />
> -                <content type="string"  />
> -                <shortdesc lang="en">The path to the rpower binary.</shortdesc>
> -        </parameter>
> -        <parameter name="help" unique="1" required="0">
> -                <getopt mixed="-h" />           
> -                <content type="string"  />
> -                <shortdesc lang="en">Display help and exit</shortdesc>                    
> -        </parameter>
> -</parameters>
> -<actions>
> -        <action name="on" />
> -        <action name="off" />
> -        <action name="status" />
> -        <action name="metadata" />
> -</actions>
> -</resource-agent>
> -';
> -}
> -
> -
> -sub get_options_stdin
> -{
> -    my $opt;
> -    my $line = 0;
> -    while( defined($in = <>) )
> -    {
> -        $_ = $in;
> -        chomp;
> -
> -	# strip leading and trailing whitespace
> -        s/^\s*//;
> -        s/\s*$//;
> -
> -	# skip comments
> -        next if /^#/;
> -
> -        $line+=1;
> -        $opt=$_;
> -        next unless $opt;
> -
> -        ($name,$val)=split /\s*=\s*/, $opt;
> -
> -        if ( $name eq "" )
> -        {  
> -           print STDERR "parse error: illegal name in option $line\n";
> -           exit 2;
> -	}
> -	
> -        # DO NOTHING -- this field is used by fenced
> -	elsif ($name eq "agent" ) { } 
> -
> -        elsif ($name eq "action" )
> -        {
> -            $opt_o = $val;
> -        }
> -	elsif ($name eq "nodename" ) 
> -	{
> -            $opt_n = $val;
> -        } 
> -	elsif ($name eq "rpower" ) 
> -	{
> -            $opt_r = $val;
> -        } 
> -
> -    }
> -}
> -
> -######################################################################33
> -# MAIN
> -
> -if (@ARGV > 0) {
> -   getopts("hn:o:r:qV") || fail_usage ;
> -
> -   usage if defined $opt_h;
> -   version if defined $opt_V;
> -
> -   fail_usage "Unknown parameter." if (@ARGV > 0);
> -
> -   if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
> -     print_metadata();
> -     exit 0;
> -   }
> -
> -   fail_usage "No '-n' flag specified." unless defined $opt_n;
> -   $opt_o=lc($opt_o);
> -   fail_usage "Unrecognised action '$opt_o' for '-o' flag"
> -      unless $opt_o =~ /^(on|off|reset|stat|status)$/;
> -
> -} else {
> -   get_options_stdin();
> -
> -   if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
> -     print_metadata();
> -     exit 0;
> -   }
> -   
> -   fail "failed: no plug number" unless defined $opt_n;
> -   $opt_o=lc($opt_o);
> -   fail "failed: unrecognised action: $opt_o"
> -      unless $opt_o =~ /^(on|off|reset|stat|status)$/;
> -}
> -
> -pipe (RDR,WTR);
> -
> -if ( $pid=fork() == 0 )
> -{
> -   close RDR;
> -
> -   open STDOUT, ">&WTR";
> -   exec "$opt_r $opt_n $opt_o" or die "failed to exec \"$opt_r\"\n";
> -}
> -
> -close WTR;
> -
> -wait;
> -
> -if ( $? != 0 )
> -{
> -   die "failed: rpower error: exit $?\n"
> -}
> -
> -$found=0;
> -$status="";
> -while (<RDR>)
> -{
> -   chomp;
> -
> -   if ( $_ =~ /^(\S+): (\S+)$/)
> -   {
> -      if ($opt_n eq $1) 
> -      {
> -         $status = $2;
> -
> -         if (($opt_o eq $2) || ($opt_o =~ /stat/i) || ($opt_o =~ /status/i))
> -         {
> -            $found=1;
> -            last;
> -         }
> -      }
> -   }
> -}
> -
> -print (($found ? "success":"failed") . ": $opt_n $status\n")
> -   unless defined $opt_q;
> -
> -exit ($found ? 0 : 1 );
> -
> -
> -
> -
> -
> -
> -
> -
> -
> diff --git a/tests/data/metadata/fence_rackswitch.xml b/tests/data/metadata/fence_rackswitch.xml
> deleted file mode 100644
> index 63f2faf..0000000
> --- a/tests/data/metadata/fence_rackswitch.xml
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -<?xml version="1.0" ?>
> -<resource-agent name="fence_rackswitch" shortdesc="fence_rackswitch - I/O Fencing agent for RackSaver RackSwitch" >
> -<longdesc>fence_rackswitch is an I/O Fencing agent which can be used with the RackSaver RackSwitch. It logs into the RackSwitch and boots a specified plug. Using the http interface to the RackSwitch should be avoided while a GFS cluster is running because the connection may interfere with the operation of this agent.</longdesc>
> -<vendor-url>http://www.bladenetwork.net</vendor-url>
> -<parameters>
> -<parameter name="ipaddr" unique="1" required="1">
> -	<getopt mixed="-a [ip]" />
> -	<content type="string"  />
> -	<shortdesc lang="en">IP Address or Hostname</shortdesc>
> -</parameter>
> -<parameter name="login" unique="1" required="1">
> -	<getopt mixed="-l [name]" />
> -	<content type="string"  />
> -	<shortdesc lang="en">Login Name</shortdesc>
> -</parameter>
> -<parameter name="passwd" unique="1" required="0">
> -	<getopt mixed="-p [password]" />
> -	<content type="string"  />
> -	<shortdesc lang="en">Login password or passphrase</shortdesc>
> -</parameter>
> -<parameter name="passwd_script" unique="1" required="0">
> -	<getopt mixed="-S [script]" />
> -	<content type="string"  />
> -	<shortdesc lang="en">Script to retrieve password</shortdesc>
> -</parameter>
> -</parameters>
> -<actions>
> -	<action name="metadata" />
> -</actions>
> -</resource-agent>
> _______________________________________________
> cluster-commits mailing list
> cluster-commits at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/cluster-commits
> 




More information about the Cluster-devel mailing list