public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* fence-agents: master - fencing: #508722 - Fence agent for HP iLO 2 MP
@ 2009-07-30 11:12 Marek Grác
0 siblings, 0 replies; only message in thread
From: Marek Grác @ 2009-07-30 11:12 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=7ba70e33140d9346d98f78a93dc97c37e065bf8f
Commit: 7ba70e33140d9346d98f78a93dc97c37e065bf8f
Parent: 4fa914ea8252924d607c663f113a11e4dc362aa3
Author: Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate: Thu Jul 30 13:07:00 2009 +0200
Committer: Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Thu Jul 30 13:07:00 2009 +0200
fencing: #508722 - Fence agent for HP iLO 2 MP
New fence agent for HP iLO2 MP used in Blade Servers. It uses SMASH
interface over telnet/ssh. fence_ilo uses RIBCL over SSL what is not
supported on these machines.
---
fence/agents/Makefile.am | 1 +
fence/agents/ilo_mp/Makefile.am | 12 ++++++
fence/agents/ilo_mp/fence_ilo_mp.py | 66 +++++++++++++++++++++++++++++++++++
3 files changed, 79 insertions(+), 0 deletions(-)
diff --git a/fence/agents/Makefile.am b/fence/agents/Makefile.am
index 453993f..aea77ac 100644
--- a/fence/agents/Makefile.am
+++ b/fence/agents/Makefile.am
@@ -15,6 +15,7 @@ SUBDIRS = alom \
ibmblade \
ifmib \
ilo \
+ ilo_mp \
intelmodular \
ipmilan \
ldom \
diff --git a/fence/agents/ilo_mp/Makefile.am b/fence/agents/ilo_mp/Makefile.am
new file mode 100644
index 0000000..c961ba3
--- /dev/null
+++ b/fence/agents/ilo_mp/Makefile.am
@@ -0,0 +1,12 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+TARGET = fence_ilo_mp
+
+EXTRA_DIST = $(TARGET).py
+
+sbin_SCRIPTS = $(TARGET)
+
+include $(top_srcdir)/make/fencebuild.mk
+
+clean-local:
+ rm -f $(TARGET)
diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py
new file mode 100644
index 0000000..511ff4b
--- /dev/null
+++ b/fence/agents/ilo_mp/fence_ilo_mp.py
@@ -0,0 +1,66 @@
+#!/usr/bin/python
+
+##
+## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
+##
+#####
+
+import sys, re, pexpect, socket
+sys.path.append("@FENCEAGENTSLIBDIR@")
+from fencing import *
+
+#BEGIN_VERSION_GENERATION
+FENCE_RELEASE_NAME=""
+REDHAT_COPYRIGHT=""
+BUILD_DATE=""
+#END_VERSION_GENERATION
+
+def get_power_status(conn, options):
+ conn.send("show /system1\n")
+ conn.log_expect(options, "EnabledState=(.*)", POWER_TIMEOUT)
+
+ status = conn.match.group(1)
+
+ if status.startswith("Enabled"):
+ return "on"
+ else:
+ return "off"
+
+def set_power_status(conn, options):
+ if options["-o"] == "on":
+ conn.send("start /system1\n")
+ else:
+ conn.send("stop -f /system1\n")
+ return
+
+def main():
+ device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
+ "action", "ipaddr", "login", "passwd", "passwd_script",
+ "secure", "cmd_prompt", "ipport", "login_eol_lf",
+ "separator", "inet4_only", "inet6_only" ]
+
+ atexit.register(atexit_handler)
+
+ options = check_input(device_opt, process_input(device_opt))
+ if 0 == options.has_key("-c"):
+ options["-c"] = "MP>"
+
+ show_docs(options)
+
+ conn = fence_login(options)
+ conn.send("SMCLP\n")
+
+ ##
+ ## Fence operations
+ ####
+ fence_action(conn, options, set_power_status, get_power_status)
+
+ try:
+ conn.send("exit\n")
+ except exceptions.OSError:
+ pass
+ except pexpect.ExceptionPexpect:
+ pass
+
+if __name__ == "__main__":
+ main()
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-30 11:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-30 11:12 fence-agents: master - fencing: #508722 - Fence agent for HP iLO 2 MP Marek Grác
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).