fence-agents: RHEL6 - fencing-agents: Add metadata output for fence agents in perl

Marek GrĂ¡c marx at fedoraproject.org
Tue Feb 21 13:39:26 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6a0643acb9929a89396ed2b19b04e46491366bfa
Commit:        6a0643acb9929a89396ed2b19b04e46491366bfa
Parent:        36884392cb77980d63f8d284684c0a8f3a67b483
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Thu Nov 24 14:33:40 2011 +0100
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Tue Feb 21 14:37:42 2012 +0100

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(-)

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
-[\fIOPTION\fR]...
-
-.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-a\fP \fIhost\fP
-IP address or hostname to connect to.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Username name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The name of the outlet to act upon.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. This can be on, off, status or reboot (default)
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-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\n";
     print " -h             usage\n";
     print " -l string      user name\n";
-    print " -o string      action: on,off,status or reboot (default)\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";
@@ -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
-[\fIOPTION\fR]...
-
-.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-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required.  disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-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\n";
     print "  -l <name>        Login name\n";
     print "  -n <num>         Port number to operate on\n";
-    print "  -o <string>      Action:  disable (default) or enable\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 password\n";
     print "  -q               quiet mode\n";
@@ -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:o:p: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
-[\fIOPTION\fR]...
-
-.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-a\fP \fIIPaddress\fP
-IP address or hostname of the PAP management console.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login with administrative privileges.
-.TP
-\fB-d\fP \fIdomain\fP
-This is the domain name of the Bull machine to power-cycle.
-.TP
-\fB-o\fP \fIoption\fP
-Action to perform (on, off, reboot, status).
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet operation.  Only print out error messages.
-.TP
-\fB-V\fP
-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\n";
 	print "  -l <name>        Login name\n";
 	print "  -d <domain>      Domain to operate on\n";
-	print "  -o <string>      Action:  on, off, reboot (default) or status\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";
@@ -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
-[\fIOPTION\fR]...
-
-.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-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-u\fP \fIuserid\fP
-userid of the virtual machine to fence (required).
-.TP
-\fB-q\fP
-quiet mode, no output.
-.TP
-\fB-V\fP
-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 "\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";
@@ -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
-[\fIOPTION\fR]...
-
-.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-a\fP \fIIPaddress\fR
-IP address or hostname of the switch.
-.TP
-\fB-c\fP \fIcmd_prompt\fR
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-\fB-d\fP \fIdracversion\fR
-Force fence_drac to treat the device as though it was for the specified drac version
-.TP
-\fB-D\fP \fIdumpfile\fR
-Debug file of the telnet interaction
-.TP
-\fB-h\fP 
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-m\fP \fImodulename\fR
-The module name of the blade when using DRAC/MC firmware.
-.TP
-\fB-o\fP \fIaction\fR
-The action required.  reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-f\fP \fIseconds\fR
-Wait X seconds before fencing is started
-.TP
-\fB-V\fP
-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\n";
 	print "  -l <name>        Login name\n";
 	print "  -m <modulename>  DRAC/MC module name\n";
-	print "  -o <string>      Action: reboot (default), off or on\n";
+	print "  -o <string>      Action: reboot (default), off, on or metadata\n";
 	print "  -p <string>      Login password\n";
 	print "  -S <path>        Script to run to retrieve password\n";
 	print "  -f <seconds>     Wait X seconds before fencing is started\n";
@@ -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
-[\fIOPTION\fR]...
-
-.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-c\fP \fIcserver\fR
-The cserver to ssh to.  cserver can be in the form user at hostname to
-specify a different user to login as.
-.TP
-\fB-u\fP \fIuser\fR
-Login name. Default login name is 'root'
-.TP
-\fB-h\fP 
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlpan\fR
-the lpan to operate on
-.TP
-\fB-o\fP \fIaction\fR
-The action required.  reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpserver\fR
-the pserver to operate on
-.TP
-\fB-f\fP \fIseconds\fR
-Wait X seconds before fencing is started
-.TP
-\fB-q\fP
-quite mode.  suppress output.
-.TP
-\fB-V\fP
-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 at 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 at 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:o:p: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
-[\fIOPTION\fR]...
-
-.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-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Username name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required.  disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-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\n";
     print "  -l <name>        Login name\n";
     print "  -n <num>         Port number to disable\n";
-    print "  -o <string>      Action:  disable (default) or enable\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";
@@ -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
-[\fIOPTION\fR]...
-
-.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-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fIport\fP
-The port number to remove zoning from on the switch.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-V\fP
-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:\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";
@@ -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:p:S:V") || fail_usage ;
+    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) {
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
-[\fIOPTION\fR]...
-
-.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-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fInodename\fP
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-\fB-o\fP \fIaction\fP
-The action required.  on, off, reset (default) or stat.
-.TP
-\fB-r\fP \fIrpower\fP
-The path to the rpower binary.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-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:\n";
     print "  -h               usage\n";
     print "  -n <name>        nodename\n";
-    print "  -o <string>      Action:  on | off | reset (default) | stat\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";
@@ -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
-[\fIOPTION\fR]...
-
-.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-a\fP \fIIPaddress\fP
-IP address or hostname of the Physical machine (required).
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-u\fP \fIuserid\fP
-userid of the virtual machine to fence (required).
-.TP
-\fB-p\fP \fIpassword\fP
-password of the virtual machine to fence (required).
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-\fB-q\fP
-quiet mode, no output.
-.TP
-\fB-V\fP
-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/agents/zvm/fence_zvm.pl
index f90125a..e6386e4 100644
--- a/fence/agents/zvm/fence_zvm.pl
+++ b/fence/agents/zvm/fence_zvm.pl
@@ -40,6 +40,7 @@ sub usage
     print "Options:\n";
     print "  -a <ip>          IP address or hostname of the physical s390\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 "  -p <string>      Password\n";
     print "  -S <path>        Script to run to retrieve login password\n";
@@ -73,6 +74,48 @@ sub version
   exit 0;
 }
 
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_zvm" shortdesc="I/O Fencing agent for GFS on s390 and zSeries VM clusters" >
+<longdesc>
+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.
+</longdesc>
+<vendor-url>http://www.ibm.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="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="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="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 do_read
 {
@@ -282,12 +325,17 @@ sub get_options_stdin
 }
 
 if (@ARGV > 0){
-    getopts("a:hp:S:qr:u:V") || fail_usage;
+    getopts("a:hp:S:qr:u: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 '-a' flag specified." unless defined $opt_a;
 
     if (defined $opt_S) {
diff --git a/make/fencemanperl.mk b/make/fencemanperl.mk
new file mode 100644
index 0000000..74c1508
--- /dev/null
+++ b/make/fencemanperl.mk
@@ -0,0 +1,7 @@
+%.8: $(TARGET) $(top_srcdir)/fence/agents/lib/fence2man.xsl
+	set -e && \
+		perl $(TARGET) -o metadata > .$@.tmp && \
+	xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
+
+clean-man:
+	rm -f *.8 .*.8.tmp


More information about the cluster-commits mailing list