FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 11-24-2011, 12:55 PM
"Marek 'marx' Grac"
 
Default fencing-agents: Add metadata output for fence agents in perl

Fencing agents written in PERL usually did not have option to print
XML metadata about its feature. Adding this feature also allow us
to generate manual pages directly from XML, so both GUI tools and manual
pages can see same feature.

Resolves: rhbz#714841 (partial)
---
fence/agents/baytech/Makefile.am | 3 +-
fence/agents/baytech/fence_baytech.8 | 84 --------------------------
fence/agents/baytech/fence_baytech.pl | 64 ++++++++++++++++++++-
fence/agents/brocade/Makefile.am | 3 +-
fence/agents/brocade/fence_brocade.8 | 84 --------------------------
fence/agents/brocade/fence_brocade.pl | 64 ++++++++++++++++++++-
fence/agents/bullpap/Makefile.am | 3 +-
fence/agents/bullpap/fence_bullpap.8 | 73 -----------------------
fence/agents/bullpap/fence_bullpap.pl | 68 ++++++++++++++++++++-
fence/agents/cpint/Makefile.am | 3 +-
fence/agents/cpint/fence_cpint.8 | 54 -----------------
fence/agents/cpint/fence_cpint.pl | 37 +++++++++++-
fence/agents/drac/Makefile.am | 3 +-
fence/agents/drac/fence_drac.8 | 105 ---------------------------------
fence/agents/drac/fence_drac.pl | 87 +++++++++++++++++++++++++++-
fence/agents/egenera/Makefile.am | 3 +-
fence/agents/egenera/fence_egenera.8 | 84 --------------------------
fence/agents/egenera/fence_egenera.pl | 61 +++++++++++++++++++
fence/agents/lib/fence2man.xsl | 4 +-
fence/agents/mcdata/Makefile.am | 3 +-
fence/agents/mcdata/fence_mcdata.8 | 84 --------------------------
fence/agents/mcdata/fence_mcdata.pl | 65 ++++++++++++++++++++-
fence/agents/vixel/Makefile.am | 3 +-
fence/agents/vixel/fence_vixel.8 | 72 ----------------------
fence/agents/vixel/fence_vixel.pl | 57 +++++++++++++++++-
fence/agents/xcat/Makefile.am | 3 +-
fence/agents/xcat/fence_xcat.8 | 63 --------------------
fence/agents/xcat/fence_xcat.pl | 56 ++++++++++++++++-
fence/agents/zvm/Makefile.am | 3 +-
fence/agents/zvm/fence_zvm.8 | 64 --------------------
fence/agents/zvm/fence_zvm.pl | 50 +++++++++++++++-
make/fencemanperl.mk | 7 ++
32 files changed, 625 insertions(+), 792 deletions(-)
delete mode 100644 fence/agents/baytech/fence_baytech.8
delete mode 100644 fence/agents/brocade/fence_brocade.8
delete mode 100644 fence/agents/bullpap/fence_bullpap.8
delete mode 100644 fence/agents/cpint/fence_cpint.8
delete mode 100644 fence/agents/drac/fence_drac.8
delete mode 100644 fence/agents/egenera/fence_egenera.8
delete mode 100644 fence/agents/mcdata/fence_mcdata.8
delete mode 100644 fence/agents/vixel/fence_vixel.8
delete mode 100644 fence/agents/xcat/fence_xcat.8
delete mode 100644 fence/agents/zvm/fence_zvm.8
create mode 100644 make/fencemanperl.mk

diff --git a/fence/agents/baytech/Makefile.am b/fence/agents/baytech/Makefile.am
index 9ad50ec..5288efa 100644
--- a/fence/agents/baytech/Makefile.am
+++ b/fence/agents/baytech/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8

include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk

-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/baytech/fence_baytech.8 b/fence/agents/baytech/fence_baytech.8
deleted file mode 100644
index aa17955..0000000
--- a/fence/agents/baytech/fence_baytech.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_baytech 8
-
-.SH NAME
-fence_baytech - I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server
-
-.SH SYNOPSIS
-.B
-fence_baytech
-[fIOPTIONfR]...
-
-.SH DESCRIPTION
-
-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. Future
-features to this agent would allow the agent to work with a multitude 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.
-
-fence_baytech accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_baytech
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.baytech.net
-
-.SH OPTIONS
-.TP
-fB-afP fIhostfP
-IP address or hostname to connect to.
-.TP
-fB-hfP
-Print out a help message describing available options, then exit.
-.TP
-fB-lfP fIloginfP
-Username name for the switch.
-.TP
-fB-nfP fIportfP
-The name of the outlet to act upon.
-.TP
-fB-ofP fIactionfP
-The action required. This can be on, off, status or reboot (default)
-.TP
-fB-pfP fIpasswordfP
-Password for login.
-.TP
-fB-SfP fIpathfR
-Full path to an executable to generate the password for login.
-.TP
-fB-qfP
-Quiet mode: print only error messages.
-.TP
-fB-VfP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-
-.TP
-fIagent = < param >fR
-This option is used by fence_node(8) and is ignored by fence_baytech.
-.TP
-fIhost = < hostname | ip >fR
-IP address or hostname to connect to.
-.TP
-fIlogin = < param >fR
-Login name.
-.TP
-fIaction = < param >fR
-The action required. This can be on, off, status or reboot (default)
-.TP
-fIpasswd = < param >fR
-Password for login.
-.TP
-fIpasswd_script = < param >fR
-Full path to an executable to generate the password for login.
-.TP
-fIoutlet = < param >fR
-The name of the outlet to act upon.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/baytech/fence_baytech.pl b/fence/agents/baytech/fence_baytech.pl
index b625968..c978ec5 100644
--- a/fence/agents/baytech/fence_baytech.pl
+++ b/fence/agents/baytech/fence_baytech.pl
@@ -63,7 +63,7 @@ sub usage
print " -D debugging output
";
print " -h usage
";
print " -l string user name
";
- print " -o string action: on,off,status or reboot (default)
";
+ print " -o string action: on,off,status, reboot (default) or metadata
";
print " -n string outlet name
";
print " -p string password
";
print " -S path script to run to retrieve password
";
@@ -96,6 +96,64 @@ sub version
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 &lt;action&gt;" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a &lt;ip&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l &lt;name&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p &lt;password&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S &lt;script&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n &lt;id&gt;" />
+ <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
{
@@ -108,6 +166,10 @@ sub get_options

fail_usage "Unkown parameter." if (@ARGV > 0);

+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
} else {
get_options_stdin();
}
diff --git a/fence/agents/brocade/Makefile.am b/fence/agents/brocade/Makefile.am
index f4281ab..ed3394d 100644
--- a/fence/agents/brocade/Makefile.am
+++ b/fence/agents/brocade/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8

include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk

-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/brocade/fence_brocade.8 b/fence/agents/brocade/fence_brocade.8
deleted file mode 100644
index 812a3f9..0000000
--- a/fence/agents/brocade/fence_brocade.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_brocade 8
-
-.SH NAME
-fence_brocade - I/O Fencing agent for Brocade FC switches
-
-.SH SYNOPSIS
-.B
-fence_brocade
-[fIOPTIONfR]...
-
-.SH DESCRIPTION
-fence_brocade is an I/O Fencing agent which can be used with Brocade FC
-switches. It logs into a Brocade 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.
-
-fence_brocade accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_brocade
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer connect
-to the Brocade FC switch. When the fenced machine is ready to be brought back
-into the GFS cluster (after reboot) the port on the Brocade FC switch needs to
-be enabled. This can be done by running fence_brocade and specifying the
-enable action.
-
-Vendor URL: http://www.brocade.com
-
-.SH OPTIONS
-.TP
-fB-afP fIIPaddressfP
-IP address of the switch.
-.TP
-fB-hfP
-Print out a help message describing available options, then exit.
-.TP
-fB-lfP fIloginfP
-Login name for the switch.
-.TP
-fB-nfP fIportfP
-The port number to disable on the switch.
-.TP
-fB-ofP fIactionfP
-The action required. disable (default) or enable.
-.TP
-fB-pfP fIpasswordfP
-Password for login.
-.TP
-fB-SfP fIpathfR
-Full path to an executable to generate the password for login.
-.TP
-fB-qfP
-Quiet mode: print only error messages.
-.TP
-fB-VfP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-fIagent = < param >fR
-This option is used by fence_node(8) and is ignored by fence_brocade.
-.TP
-fIipaddr = < hostname | ip >fR
-IP address or hostname of the switch.
-.TP
-fIlogin = < param >fR
-Login name.
-.TP
-fIoption = < param >fR
-The action required. disable (default) or enable.
-.TP
-fIpasswd = < param >fR
-Password for login.
-.TP
-fIpasswd_script = < param >fR
-Full path to an executable to generate the password for login.
-.TP
-fIport = < param >fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/brocade/fence_brocade.pl b/fence/agents/brocade/fence_brocade.pl
index 933cecf..b6d3f45 100644
--- a/fence/agents/brocade/fence_brocade.pl
+++ b/fence/agents/brocade/fence_brocade.pl
@@ -40,7 +40,7 @@ sub usage
print " -h usage
";
print " -l <name> Login name
";
print " -n <num> Port number to operate on
";
- print " -o <string> Action: disable (default) or enable
";
+ print " -o <string> Action: disable (default), enable or metadata
";
print " -p <string> Password for login
";
print " -S <path> Script to run to retrieve password
";
print " -q quiet mode
";
@@ -73,6 +73,63 @@ sub version
exit 0;
}

+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_brocade" shortdesc="Fence agent for Brocade over telnet" >
+<longdesc>
+fence_brocade is an I/O Fencing agent which can be used with Brocade FC switches. It logs into a Brocade 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 Brocade FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the Brocade FC switch needs to be enabled. This can be done by running fence_brocade 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 &lt;action&gt;" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a &lt;ip&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l &lt;name&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p &lt;password&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S &lt;script&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n &lt;id&gt;" />
+ <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>
+';
+}
+

if (@ARGV > 0) {
getopts("a:hl:n:S:qV") || fail_usage ;
@@ -82,6 +139,11 @@ if (@ARGV > 0) {

fail_usage "Unknown parameter." if (@ARGV > 0);

+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
if (defined $opt_S) {
$pwd_script_out = `$opt_S`;
chomp($pwd_script_out);
diff --git a/fence/agents/bullpap/Makefile.am b/fence/agents/bullpap/Makefile.am
index a708d4f..b454007 100644
--- a/fence/agents/bullpap/Makefile.am
+++ b/fence/agents/bullpap/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8

include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk

-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/bullpap/fence_bullpap.8 b/fence/agents/bullpap/fence_bullpap.8
deleted file mode 100644
index 1404c75..0000000
--- a/fence/agents/bullpap/fence_bullpap.8
+++ /dev/null
@@ -1,73 +0,0 @@
-.TH fence_bullpap 8
-
-.SH NAME
-fence_bullpap - I/O Fencing agent for Bull FAME architecture controlled by a
-PAP management console.
-
-.SH SYNOPSIS
-.B
-fence_bullpap
-[fIOPTIONfR]...
-
-.SH DESCRIPTION
-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.
-
-fence_bullpap accepts options on the command line as well as from stdin.
-fenced sends the options through stdin when it execs the agent. fence_bullpap
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.bull.com
-
-.SH OPTIONS
-.TP
-fB-afP fIIPaddressfP
-IP address or hostname of the PAP management console.
-.TP
-fB-hfP
-Print out a help message describing available options, then exit.
-.TP
-fB-lfP fIloginfP
-Login with administrative privileges.
-.TP
-fB-dfP fIdomainfP
-This is the domain name of the Bull machine to power-cycle.
-.TP
-fB-ofP fIoptionfP
-Action to perform (on, off, reboot, status).
-.TP
-fB-pfP fIpasswordfP
-Password for login.
-.TP
-fB-SfP fIpathfR
-Full path to an executable to generate the password for login.
-.TP
-fB-qfP
-Quiet operation. Only print out error messages.
-.TP
-fB-VfP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-fIipaddr = < hostname | ip >fR
-IP address or hostname of the PAP management console.
-.TP
-fIlogin= < param >fR
-Login with administrative privileges.
-.TP
-fIdomain = < param >fR
-This is the domain name of the Bull machine to power-cycle.
-.TP
-fIoption = < param >fR
-Action to perform (on, off, reboot, status).
-.TP
-fIpasswd = < param >fR
-Password for login.
-.TP
-fIpasswd_script = < param >fR
-Full path to an executable to generate the password for login.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/bullpap/fence_bullpap.pl b/fence/agents/bullpap/fence_bullpap.pl
index 6915f57..3309c18 100644
--- a/fence/agents/bullpap/fence_bullpap.pl
+++ b/fence/agents/bullpap/fence_bullpap.pl
@@ -20,8 +20,6 @@ my $pname = $_;
$action = "reboot"; # Default fence action
my $bulldir = "/usr/local/bull/NSMasterHW/bin";

-stat($bulldir);
-die "NSMasterHW not installed correctly" if ! -d _;

# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
# "#END_VERSION_GENERATION" It is generated by the Makefile
@@ -44,7 +42,7 @@ sub usage
print " -h usage
";
print " -l <name> Login name
";
print " -d <domain> Domain to operate on
";
- print " -o <string> Action: on, off, reboot (default) or status
";
+ print " -o <string> Action: on, off, reboot (default), status or metadata
";
print " -p <string> Password for login
";
print " -S <path> Script to run to retrieve password
";
print " -q quiet mode
";
@@ -86,6 +84,62 @@ sub version
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 &lt;action&gt;" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a &lt;ip&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l &lt;name&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p &lt;password&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S &lt;script&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="domain" unique="1" required="1">
+ <getopt mixed="-d &lt;domain&gt;" />
+ <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;
@@ -224,6 +278,11 @@ if (@ARGV > 0)
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;
@@ -269,6 +328,9 @@ else
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"; }
diff --git a/fence/agents/cpint/Makefile.am b/fence/agents/cpint/Makefile.am
index c02480a..e9fee26 100644
--- a/fence/agents/cpint/Makefile.am
+++ b/fence/agents/cpint/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8

include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk

-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/cpint/fence_cpint.8 b/fence/agents/cpint/fence_cpint.8
deleted file mode 100644
index e9f1c5d..0000000
--- a/fence/agents/cpint/fence_cpint.8
+++ /dev/null
@@ -1,54 +0,0 @@
-.TH fence_cpint 8
-
-.SH NAME
-fence_cpint - I/O Fencing agent for GFS on s390 and zSeries VM clusters
-
-.SH SYNOPSIS
-.B
-fence_cpint
-[fIOPTIONfR]...
-
-.SH DESCRIPTION
-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.
-fBNOTE:fP 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.
-
-fence_cpint accepts options on the command line as well as from stdin.
-fence_node sends the options through stdin when it execs the agent.
-fence_cpint can be run by itself with command line options which is useful for
-testing.
-
-Vendor URL: http://www.ibm.com
-
-.SH OPTIONS
-.TP
-fB-hfP
-Print out a help message describing available options, then exit.
-.TP
-fB-ufP fIuseridfP
-userid of the virtual machine to fence (required).
-.TP
-fB-qfP
-quiet mode, no output.
-.TP
-fB-VfP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-fIagent = < param >fR
-This option is used by fence_node(8) and is ignored by fence_cpint.
-.TP
-fIuserid = < parm >fP
-userid of the virtual machine to fence (required).
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/cpint/fence_cpint.pl b/fence/agents/cpint/fence_cpint.pl
index dc17eed..d3c016a 100644
--- a/fence/agents/cpint/fence_cpint.pl
+++ b/fence/agents/cpint/fence_cpint.pl
@@ -36,6 +36,7 @@ sub usage
print "
";
print "Options:
";
print " -h usage
";
+ print " -o metadata print XML metadata for fence agent
";
print " -u <string> userid of the virtual machine to fence
";
print " -q quiet mode
";
print " -V Version
";
@@ -66,6 +67,35 @@ sub version
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 &lt;userid&gt;" />
+ <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;
@@ -121,12 +151,17 @@ sub get_options_stdin
}

if (@ARGV > 0){
- getopts("hqu:V") || fail_usage;
+ 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();
diff --git a/fence/agents/drac/Makefile.am b/fence/agents/drac/Makefile.am
index 0a7de40..c9cdeda 100644
--- a/fence/agents/drac/Makefile.am
+++ b/fence/agents/drac/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8

include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk

-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/drac/fence_drac.8 b/fence/agents/drac/fence_drac.8
deleted file mode 100644
index 3660c5a..0000000
--- a/fence/agents/drac/fence_drac.8
+++ /dev/null
@@ -1,105 +0,0 @@
-.TH fence_drac 8
-
-.SH NAME
-fence_drac - fencing agent for Dell Remote Access Card
-
-.SH SYNOPSIS
-.B
-fence_drac
-[fIOPTIONfR]...
-
-.SH DESCRIPTION
-fence_drac is an I/O Fencing agent which can be used with the Dell Remote
-Access Card (DRAC). This card provides remote access to controlling
-power to a server. It logs into the DRAC through the telnet interface of
-the card. By default, the telnet interface is not enabled. To enable the
-interface, you will need to use the racadm command in the racser-devel rpm
-available from Dell. To enable telnet on the DRAC:
-
-[root]# racadm config -g cfgSerial -o cfgSerialTelnetEnable 1
-
-[root]# racadm racreset
-
-fence_drac accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_drac
-can be run by itself with command line options. This is useful for testing
-and for turning outlets on or off from scripts.
-
-Vendor URL: http://www.dell.com
-
-.SH OPTIONS
-.TP
-fB-afP fIIPaddressfR
-IP address or hostname of the switch.
-.TP
-fB-cfP fIcmd_promptfR
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-fB-dfP fIdracversionfR
-Force fence_drac to treat the device as though it was for the specified drac version
-.TP
-fB-DfP fIdumpfilefR
-Debug file of the telnet interaction
-.TP
-fB-hfP
-Print out a help message describing available options, then exit.
-.TP
-fB-lfP fIloginfR
-Login name.
-.TP
-fB-mfP fImodulenamefR
-The module name of the blade when using DRAC/MC firmware.
-.TP
-fB-ofP fIactionfR
-The action required. reboot (default), off, on or status.
-.TP
-fB-pfP fIpasswordfR
-Password for login.
-.TP
-fB-SfP fIpathfR
-Full path to an executable to generate the password for login.
-.TP
-fB-ffP fIsecondsfR
-Wait X seconds before fencing is started
-.TP
-fB-VfP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-fIaction = < param >fR
-The action required. reboot (default), off, on or status.
-.TP
-fIagent = < param >fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-fIcmd_prompt = < param >fr
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-fIdrac_version = < param >fr
-Force fence_drac to treat the device as though it was for the specified drac version.
-.TP
-fIdebug = < dumpfile >fR
-Debug file of the telnet interaction
-.TP
-fIipaddr = < hostname | ip >fR
-IP address or hostname of the switch.
-.TP
-fIlogin = < param >fR
-Login name.
-.TP
-fImodulename = < param >fr
-The module name of the blade when using DRAC/MC firmware.
-.TP
-fIpasswd = < param >fR
-Password for login.
-.TP
-fIpasswd_script = < param >fR
-Full path to an executable to generate the password for login.
-.TP
-fIdelay = < param >fR
-Wait X seconds before fencing is started
-.TP
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/drac/fence_drac.pl b/fence/agents/drac/fence_drac.pl
index e28ed98..5e1b966 100644
--- a/fence/agents/drac/fence_drac.pl
+++ b/fence/agents/drac/fence_drac.pl
@@ -74,7 +74,7 @@ sub usage
print " -h usage
";
print " -l <name> Login name
";
print " -m <modulename> DRAC/MC module name
";
- print " -o <string> Action: reboot (default), off or on
";
+ print " -o <string> Action: reboot (default), off, on or metadata
";
print " -p <string> Login password
";
print " -S <path> Script to run to retrieve password
";
print " -f <seconds> Wait X seconds before fencing is started
";
@@ -130,6 +130,86 @@ sub version
exit 0;
}

+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_drac" shortdesc="fencing agent for Dell Remote Access Card" >
+<longdesc>
+fence_drac is an I/O Fencing agent which can be used with the Dell Remote Access Card (DRAC). This card provides remote access to controlling power to a server. It logs into the DRAC through the telnet interface of the card. By default, the telnet interface is not enabled. To enable the interface, you will need to use the racadm command in the racser-devel rpm available from Dell. To enable telnet on the DRAC:
+
+[root]# racadm config -g cfgSerial -o cfgSerialTelnetEnable 1
+
+[root]# racadm racreset
+</longdesc>
+<vendor-url>http://www.dell.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o &lt;action&gt;" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a &lt;ip&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l &lt;name&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p &lt;password&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S &lt;script&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="cmd_prompt" unique="1" required="0">
+ <getopt mixed="-c &lt;prompt&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Force fence_drac to use cmd_prompt as the command prompt</shortdesc>
+ </parameter>
+ <parameter name="drac_version" unique="1" required="0">
+ <getopt mixed="-d &lt;version&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Force fence_drac to treat the device as though it was for the specified drac version</shortdesc>
+ </parameter>
+ <parameter name="module_name" unique="1" required="0">
+ <getopt mixed="-m &lt;modulename&gt;" />
+ <content type="string"/>
+ <shortdesc lang="en">The module name of the blade when using DRAC/MC firmware.</shortdesc>
+ </parameter>
+ <parameter name="debug" unique="1" required="0">
+ <getopt mixed="-D &lt;dumpfile&gt;" />
+ <content type="string"/>
+ <shortdesc lang="en">Debug file of the telnet interaction</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="1" required="0">
+ <getopt mixed="-f &lt;seconds&gt;" />
+ <content type="string" default="0"/>
+ <shortdesc lang="en">Wait X seconds before fencing is started</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 login
{
@@ -597,6 +677,11 @@ if (@ARGV > 0) {

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;
$address = $opt_a;

diff --git a/fence/agents/egenera/Makefile.am b/fence/agents/egenera/Makefile.am
index 5cbb555..6cd82a6 100644
--- a/fence/agents/egenera/Makefile.am
+++ b/fence/agents/egenera/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8

include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk

-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/egenera/fence_egenera.8 b/fence/agents/egenera/fence_egenera.8
deleted file mode 100644
index 3823d7c..0000000
--- a/fence/agents/egenera/fence_egenera.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_egenera 8
-
-.SH NAME
-fence_egenera - I/O Fencing agent for the Egenera BladeFrame
-
-.SH SYNOPSIS
-.B
-fence_egenera
-[fIOPTIONfR]...
-
-.SH DESCRIPTION
-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 processing 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.
-
-fence_egenera accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_egenera
-can also be run by itself with command line options.
-
-Vendor URL: http://www.egenera.com
-
-.SH OPTIONS
-.TP
-fB-cfP fIcserverfR
-The cserver to ssh to. cserver can be in the form user@hostname to
-specify a different user to login as.
-.TP
-fB-ufP fIuserfR
-Login name. Default login name is 'root'
-.TP
-fB-hfP
-Print out a help message describing available options, then exit.
-.TP
-fB-lfP fIlpanfR
-the lpan to operate on
-.TP
-fB-ofP fIactionfR
-The action required. reboot (default), off, on or status.
-.TP
-fB-pfP fIpserverfR
-the pserver to operate on
-.TP
-fB-ffP fIsecondsfR
-Wait X seconds before fencing is started
-.TP
-fB-qfP
-quite mode. suppress output.
-.TP
-fB-VfP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-fIaction = < param >fR
-The action required. reboot (default), off, on or status.
-.TP
-fIuser = < param >fR
-Login name. Default login name is 'root'
-.TP
-fIagent = < param >fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-fIcserver = < param >fR
-The cserver to ssh to. cserver can be in the form user@hostname to
-specify a different user to login as.
-.TP
-fIlpan = < param >fR
-The lpan to operate on
-.TP
-fIpserver = < param >fR
-The pserver to operate on
-.TP
-fIesh = < param >fR
-The path to the esh command on the cserver (default is /opt/panmgr/bin/esh)
-.TP
-fIdelay = < param >fR
-Wait X seconds before fencing is started
-
-.SH SEE ALSO
-fence(8), fence_node(8), ssh(8)
diff --git a/fence/agents/egenera/fence_egenera.pl b/fence/agents/egenera/fence_egenera.pl
index f09ff32..6270cee 100644
--- a/fence/agents/egenera/fence_egenera.pl
+++ b/fence/agents/egenera/fence_egenera.pl
@@ -74,6 +74,62 @@ sub version
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="1" required="1">
+ <getopt mixed="-o &lt;action&gt;" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="cserver" unique="1" required="1">
+ <getopt mixed="-c &lt;cserver&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">The cserver to ssh to. cserver can be in the form user@hostname to specify a different user to login as.</shortdesc>
+ </parameter>
+ <parameter name="pserver" unique="1" required="1">
+ <getopt mixed="-p &lt;pserver&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">The pserver to operate on.</shortdesc>
+ </parameter>
+ <parameter name="user" unique="1" required="1">
+ <getopt mixed="-u &lt;name&gt;" />
+ <content type="string" default="root" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="lpan" unique="1" required="1">
+ <getopt mixed="-l &lt;lpan&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">The lpan to operate on.</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="1" required="0">
+ <getopt mixed="-f &lt;seconds&gt;" />
+ <content type="string" default="0"/>
+ <shortdesc lang="en">Wait X seconds before fencing is started</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>
+';
+}
+
if (@ARGV > 0)
{
getopts("c:hl:u:qVf:") || fail_usage ;
@@ -83,6 +139,11 @@ if (@ARGV > 0)

fail_usage "Unkown parameter." if (@ARGV > 0);

+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
$cserv = $opt_c if defined $opt_c;
$lpan = $opt_l if defined $opt_l;
$pserv = $opt_p if defined $opt_p;
diff --git a/fence/agents/lib/fence2man.xsl b/fence/agents/lib/fence2man.xsl
index 563b3a4..0fd71be 100644
--- a/fence/agents/lib/fence2man.xsl
+++ b/fence/agents/lib/fence2man.xsl
@@ -17,9 +17,11 @@
<xsl:choose>
<xsl:when test="@name = 'on'">Power on machine.</xsl:when>
<xsl:when test="@name = 'off'">Power off machine.</xsl:when>
+<xsl:when test="@name = 'enable'">Enable fabric access.</xsl:when>
+<xsl:when test="@name = 'disable'">Disable fabric access.</xsl:when>
<xsl:when test="@name = 'reboot'">Reboot machine.</xsl:when>
<xsl:when test="@name = 'monitor'">Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more).</xsl:when>
-<xsl:when test="@name = 'meta-data'">Display the XML metadata describing this resource.</xsl:when>
+<xsl:when test="@name = 'metadata'">Display the XML metadata describing this resource.</xsl:when>
<xsl:when test="@name = 'list'">List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise.</xsl:when>
<xsl:when test="@name = 'status'">This returns the status of the plug/virtual machine.</xsl:when>
<!-- Ehhh -->
diff --git a/fence/agents/mcdata/Makefile.am b/fence/agents/mcdata/Makefile.am
index f9953f5..f1a5939 100644
--- a/fence/agents/mcdata/Makefile.am
+++ b/fence/agents/mcdata/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8

include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk

-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/mcdata/fence_mcdata.8 b/fence/agents/mcdata/fence_mcdata.8
deleted file mode 100644
index c52ffd6..0000000
--- a/fence/agents/mcdata/fence_mcdata.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_mcdata 8
-
-.SH NAME
-fence_mcdata - I/O Fencing agent for McData FC switches
-
-.SH SYNOPSIS
-.B
-fence_mcdata
-[fIOPTIONfR]...
-
-.SH DESCRIPTION
-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.
-
-fence_mcdata accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_mcdata
-can be run by itself with command line options which is useful for testing.
-
-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.
-
-Vendor URL: http://www.brocade.com
-
-.SH OPTIONS
-.TP
-fB-afP fIIPaddressfP
-IP address of the switch.
-.TP
-fB-hfP
-Print out a help message describing available options, then exit.
-.TP
-fB-lfP fIloginfP
-Username name for the switch.
-.TP
-fB-nfP fIportfP
-The port number to disable on the switch.
-.TP
-fB-ofP fIactionfP
-The action required. disable (default) or enable.
-.TP
-fB-pfP fIpasswordfP
-Password for login.
-.TP
-fB-SfP fIpathfR
-Full path to an executable to generate the password for login.
-.TP
-fB-qfP
-Quiet mode: print only error messages.
-.TP
-fB-VfP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-fIagent = < param >fR
-This option is used by fence_node(8) and is ignored by fence_mcdata.
-.TP
-fIipaddr = < hostname | ip >fR
-IP address or hostname of the switch.
-.TP
-fIlogin = < param >fR
-Login name.
-.TP
-fIoption = < param >fR
-The action required. disable (default) or enable.
-.TP
-fIpasswd = < param >fR
-Password for login.
-.TP
-fIpasswd_script = < param >fR
-Full path to an executable to generate the password for login.
-.TP
-fIport = < param >fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/mcdata/fence_mcdata.pl b/fence/agents/mcdata/fence_mcdata.pl
index 7a01d1d..a469a1c 100644
--- a/fence/agents/mcdata/fence_mcdata.pl
+++ b/fence/agents/mcdata/fence_mcdata.pl
@@ -46,7 +46,7 @@ sub usage
print " -h usage
";
print " -l <name> Login name
";
print " -n <num> Port number to disable
";
- print " -o <string> Action: disable (default) or enable
";
+ print " -o <string> Action: disable (default), enable or metadata
";
print " -p <string> Password for login
";
print " -S <path> Script to run to retrieve login password
";
print " -q quiet mode
";
@@ -79,6 +79,64 @@ sub version
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 &lt;action&gt;" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a &lt;ip&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l &lt;name&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p &lt;password&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S &lt;script&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n &lt;id&gt;" />
+ <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;
@@ -153,6 +211,11 @@ if (@ARGV > 0) {

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;
diff --git a/fence/agents/vixel/Makefile.am b/fence/agents/vixel/Makefile.am
index f3e1339..64d6010 100644
--- a/fence/agents/vixel/Makefile.am
+++ b/fence/agents/vixel/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8

include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk

-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/vixel/fence_vixel.8 b/fence/agents/vixel/fence_vixel.8
deleted file mode 100644
index 83db14f..0000000
--- a/fence/agents/vixel/fence_vixel.8
+++ /dev/null
@@ -1,72 +0,0 @@
-.TH fence_vixel 8
-
-.SH NAME
-fence_vixel - I/O Fencing agent for Vixel FC switches
-
-.SH SYNOPSIS
-.B
-fence_vixel
-[fIOPTIONfR]...
-
-.SH DESCRIPTION
-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.
-
-fence_vixel accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_vixel
-can be run by itself with command line options which is useful for testing.
-
-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
-
-Vendor URL: http://www.emulex.com
-
-.SH OPTIONS
-.TP
-fB-afP fIIPaddressfP
-IP address of the switch.
-.TP
-fB-hfP
-Print out a help message describing available options, then exit.
-.TP
-fB-nfP fIportfP
-The port number to remove zoning from on the switch.
-.TP
-fB-pfP fIpasswordfP
-Password for login.
-.TP
-fB-SfP fIpathfR
-Full path to an executable to generate the password for login.
-.TP
-fB-VfP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-fIagent = < param >fR
-This option is used by fence_node(8) and is ignored by fence_vixel.
-.TP
-fIipaddr = < hostname | ip >fR
-IP address or hostname of the switch.
-.TP
-fIpasswd = < param >fR
-Password for login.
-.TP
-fIpasswd_script = < param >fR
-Full path to an executable to generate the password for login.
-.TP
-fIport = < param >fR
-The port number to remove zoning from on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/vixel/fence_vixel.pl b/fence/agents/vixel/fence_vixel.pl
index 470d4c7..59b9ff0 100644
--- a/fence/agents/vixel/fence_vixel.pl
+++ b/fence/agents/vixel/fence_vixel.pl
@@ -34,6 +34,7 @@ sub usage
print "Options:
";
print " -a <ip> IP address or hostname of switch
";
print " -h Usage
";
+ print " -o metadata print XML metadata for fence agent
";
print " -n <num> Port number to disable
";
print " -p <string> Password for login
";
print " -S <path> Script to run to retrieve login password
";
@@ -66,14 +67,68 @@ sub version
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 &lt;port&gt; &lt;comma-separated-list-of-ports-in-the-zone&gt;
+
+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 &lt;ip&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p &lt;password&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S &lt;script&gt;" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n &lt;id&gt;" />
+ <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:S:V") || fail_usage ;
+ getopts("a:hn: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) {
diff --git a/fence/agents/xcat/Makefile.am b/fence/agents/xcat/Makefile.am
index de54526..27c289c 100644
--- a/fence/agents/xcat/Makefile.am
+++ b/fence/agents/xcat/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8

include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk

-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/xcat/fence_xcat.8 b/fence/agents/xcat/fence_xcat.8
deleted file mode 100644
index 719f896..0000000
--- a/fence/agents/xcat/fence_xcat.8
+++ /dev/null
@@ -1,63 +0,0 @@
-.TH fence_xcat 8
-
-.SH NAME
-fence_xcat - I/O Fencing agent for xcat environments
-
-.SH SYNOPSIS
-.B
-fence_xcat
-[fIOPTIONfR]...
-
-.SH DESCRIPTION
-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.
-
-fence_xcat accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_xcat
-can be run by itself with command line options which is useful for testing.
-
-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.
-
-Vendor URL: http://www.xcat.org
-
-.SH OPTIONS
-.TP
-fB-hfP
-Print out a help message describing available options, then exit.
-.TP
-fB-nfP fInodenamefP
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-fB-ofP fIactionfP
-The action required. on, off, reset (default) or stat.
-.TP
-fB-rfP fIrpowerfP
-The path to the rpower binary.
-.TP
-fB-qfP
-Quiet mode: print only error messages.
-.TP
-fB-VfP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-fIagent = < param >fR
-This option is used by fence_node(8) and is ignored by fence_xcat.
-.TP
-fInodename = < param >fR
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-fIaction = < param >fR
-The action required. on, off, reset (default) or stat.
-.TP
-fIrpower = < param >fR
-The path to the rpower binary.
-
-.SH SEE ALSO
-fence(8), fence_node(8), fence_bladecenter(8), nodelist.tab(8), rpower(1), xCAT(1)
diff --git a/fence/agents/xcat/fence_xcat.pl b/fence/agents/xcat/fence_xcat.pl
index 2d8166a..f984ec1 100644
--- a/fence/agents/xcat/fence_xcat.pl
+++ b/fence/agents/xcat/fence_xcat.pl
@@ -38,7 +38,7 @@ sub usage
print "Options:
";
print " -h usage
";
print " -n <name> nodename
";
- print " -o <string> Action: on | off | reset (default) | stat
";
+ print " -o <string> Action: on, off, reset (default), status or metadata
";
print " -r <rpower> rpower command
";
print " -q quiet mode
";
print " -V version
";
@@ -70,6 +70,49 @@ sub version
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 &lt;action&gt;" />
+ <content type="string" default="restart" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="nodename" unique="1" required="1">
+ <getopt mixed="-n &lt;nodename&gt;" />
+ <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 &lt;rpower&gt;" />
+ <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;
@@ -128,10 +171,15 @@ if (@ARGV > 0) {

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)$/;
+ unless $opt_o =~ /^(on|off|reset|stat|status)$/;

} else {
get_options_stdin();
@@ -139,7 +187,7 @@ if (@ARGV > 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)$/;
+ unless $opt_o =~ /^(on|off|reset|stat|status)$/;
}

pipe (RDR,WTR);
@@ -173,7 +221,7 @@ while (<RDR>)
{
$status = $2;

- if (($opt_o eq $2) || ($opt_o eq "stat"))
+ if (($opt_o eq $2) || ($opt_o =~ /stat/i) || ($opt_o =~ /status/i))
{
$found=1;
last;
diff --git a/fence/agents/zvm/Makefile.am b/fence/agents/zvm/Makefile.am
index a75cf66..3ce3d82 100644
--- a/fence/agents/zvm/Makefile.am
+++ b/fence/agents/zvm/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8

include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk

-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/zvm/fence_zvm.8 b/fence/agents/zvm/fence_zvm.8
deleted file mode 100644
index c58d8ae..0000000
--- a/fence/agents/zvm/fence_zvm.8
+++ /dev/null
@@ -1,64 +0,0 @@
-.TH fence_zvm 8
-
-.SH NAME
-fence_zvm - I/O Fencing agent for GFS on s390 and zSeries VM clusters
-
-.SH SYNOPSIS
-.B
-fence_zvm
-[fIOPTIONfR]...
-
-.SH DESCRIPTION
-fence_zvm is an I/O Fencing agent used on a GFS virtual machine in a s390 or zSeries VM cluster.
-It uses the s3270 program to log the specified virtual machine out of VM.
-For fence_zvm to execute correctly, you must have s3270 in your PATH.
-
-fence_zvm accepts options on the command line as well as from stdin.
-fence_node sends the options through stdin when it execs the agent.
-fence_zvm can be run by itself with command line options which is useful
-for testing.
-
-Vendor URL: http://www.ibm.com
-
-.SH OPTIONS
-.TP
-fB-afP fIIPaddressfP
-IP address or hostname of the Physical machine (required).
-.TP
-fB-hfP
-Print out a help message describing available options, then exit.
-.TP
-fB-ufP fIuseridfP
-userid of the virtual machine to fence (required).
-.TP
-fB-pfP fIpasswordfP
-password of the virtual machine to fence (required).
-.TP
-fB-SfP fIpathfR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-fB-qfP
-quiet mode, no output.
-.TP
-fB-VfP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-fIagent = < param >fP
-This option is used by fence_node(8) and is ignored by fence_zvm.
-.TP
-fIipaddr = < hostname | ip >fP
-IP address or hostname of the Physical machine (required).
-.TP
-fIpasswd = < param >fP
-password of the virtual machine to fence (required).
-.TP
-fIpasswd_script = < param >fR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-fIuserid = < param >fP
-userid of the virtual machine to fence (required).
-
-.SH SEE ALSO
-fence(8), fenced(8), fence_node(8)
diff --git a/fence/agents/zvm/fence_zvm.pl b/fence/agent
 

Thread Tools




All times are GMT. The time now is 04:41 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org