From: Jan Pokorný Date: Thu, 28 Feb 2013 22:37:07 +0100 Subject: [Cluster-devel] [PATCH 1/2] Node Assassin: add support for metadata In-Reply-To: <1362087428-566-1-git-send-email-jpokorny@redhat.com> References: <1362087428-566-1-git-send-email-jpokorny@redhat.com> Message-ID: <1362087428-566-2-git-send-email-jpokorny@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To be honest, untested. Signed-off-by: Jan Pokorn? --- fence/agents/node_assassin/fence_na.lib.in | 50 ++++++++++++++++++++++++++++++ fence/agents/node_assassin/fence_na.pl | 9 +++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/fence/agents/node_assassin/fence_na.lib.in b/fence/agents/node_assassin/fence_na.lib.in index 67d5367..84d3bf2 100644 --- a/fence/agents/node_assassin/fence_na.lib.in +++ b/fence/agents/node_assassin/fence_na.lib.in @@ -918,4 +918,54 @@ sub _make_hash_reference _add_hash_reference($href, $_href); } + +sub print_metadata +{ +print ' + + +fence_na is an I/O Fencing agent for Node Assassin, open hardware, open source cluster fence device. + +http://nodeassassin.org + + + + Operation to perform. Valid operations: on, off, reboot, status, list, metadata, release, boot or shutdown + + + + Node Assassin IP or name to talk to + + + + Login name used to log into the Node Assassin(s) + + + + Password needed to access the Node Assassin(s) + + + + Script to retrieve password (not implemented) + + + + Suppress output + + + + + + + + + + + + + + +'; +} + 1; diff --git a/fence/agents/node_assassin/fence_na.pl b/fence/agents/node_assassin/fence_na.pl index bc7fb00..249bc55 100644 --- a/fence/agents/node_assassin/fence_na.pl +++ b/fence/agents/node_assassin/fence_na.pl @@ -140,9 +140,16 @@ if (($conf->{na}{login} ne $conf->{'system'}{username}) or ($conf->{na}{passwd} # What do? # ############################################################################### +record($conf, $log, "Action: ........ [$conf->{na}{action}].\n") if $conf->{'system'}{debug}; + +if ($conf->{na}{action} eq "metadata") +{ + print_metadata(); + do_exit($conf, $log, 0); +} + # When asked to 'monitor' or 'list'. being multi-port, this will return a CSV # of nodes and their aliases where found in the config file. -record($conf, $log, "Action: ........ [$conf->{na}{action}].\n") if $conf->{'system'}{debug}; if (($conf->{na}{action} eq "monitor") or ($conf->{na}{action} eq "list")) { record($conf, $log, "Calling the 'show_list' function.\n") if $conf->{'system'}{debug}; -- 1.7.11.7