[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH] fence_na: Add support for XML metadata output



Adding a skelet for XML metadata output so fence_na can be used with corosync.

Resolves: rhbz#864028
---
 fence/agents/node_assassin/fence_na.lib.in |   57 ++++++++++++++++++++++++++++
 fence/agents/node_assassin/fence_na.pl     |    6 +++
 2 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/fence/agents/node_assassin/fence_na.lib.in b/fence/agents/node_assassin/fence_na.lib.in
index 67d5367..dec734a 100644
--- a/fence/agents/node_assassin/fence_na.lib.in
+++ b/fence/agents/node_assassin/fence_na.lib.in
@@ -918,4 +918,61 @@ sub _make_hash_reference
 	_add_hash_reference($href, $_href);
 }
 
+sub show_metadata
+{
+	print <<METADATA;
+<?xml version="1.0" ?>
+<resource-agent name="fence_na.py" shortdesc="Fence agent for Node Assassin over telnet" >
+<longdesc>fence_na is an I/O Fencing agent which can be used with the Node Assassin network power switch. It logs into device via telnet and reboots a specified outlet. Lengthy telnet/ssh connections should be avoided while a GFS cluster  is  running  because  the  connection will block any necessary fencing actions.</longdesc>
+<vendor-url>http://www.altavee.ca/w/Node_Assassin_v1.1.4</vendor-url>
+<parameters>
+	<parameter name="action" unique="0" required="1">
+		<getopt mixed="-o &lt;action&gt;" />
+		<content type="string" default="reboot" />
+		<shortdesc lang="en">Fencing Action</shortdesc>
+	</parameter>
+	<parameter name="ipaddr" unique="0" required="1">
+		<getopt mixed="-a &lt;ip&gt;" />
+		<content type="string" />
+		<shortdesc lang="en">IP Address or Hostname</shortdesc>
+	</parameter>
+	<parameter name="login" unique="0" required="1">
+		<getopt mixed="-l &lt;name&gt;" />
+		<content type="string" />
+		<shortdesc lang="en">Login Name</shortdesc>
+	</parameter>
+	<parameter name="passwd" unique="0" required="0">
+		<getopt mixed="-p &lt;password&gt;" />
+		<content type="string" />
+		<shortdesc lang="en">Login password or passphrase</shortdesc>
+	</parameter>
+	<parameter name="port" unique="0" required="1">
+		<getopt mixed="-n;" />
+		<content type="string" />
+		<shortdesc lang="en">Physical plug number</shortdesc>
+	</parameter>
+	<parameter name="version" unique="0" required="0">
+		<getopt mixed="-V" />
+		<content type="boolean" />
+		<shortdesc lang="en">Display version information and exit</shortdesc>
+	</parameter>
+	<parameter name="help" unique="0" required="0">
+		<getopt mixed="-h" />
+		<content type="boolean" />
+		<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="list" />
+	<action name="monitor" />
+	<action name="metadata" />
+</actions>
+</resource-agent>
+METADATA
+}
+
 1;
diff --git a/fence/agents/node_assassin/fence_na.pl b/fence/agents/node_assassin/fence_na.pl
index bc7fb00..bdcaf69 100644
--- a/fence/agents/node_assassin/fence_na.pl
+++ b/fence/agents/node_assassin/fence_na.pl
@@ -106,6 +106,12 @@ foreach my $i (1..$conf->{'system'}{na_num})
 }
 
 die "Exiting on errors.\n" if $bad;
+
+if ($conf->{na}{action} eq "metadata") {
+	show_metadata();
+	do_exit($conf, $log, 0);
+}
+
 my @ny=("no", "yes");
 record($conf, $log, "Node Assassin: . [$conf->{na}{ipaddr}].\n");
 record($conf, $log, "TCP Port: ...... [$conf->{na}{tcp_port}].\n");
-- 
1.7.7.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]