コード例 #1
0
def main():
    device_opt = ["ipaddr", "login", "passwd", "no_login", "no_password", \
            "port", "snmp_version", "snmp"]

    atexit.register(atexit_handler)

    all_opt["switch"]["default"] = 1
    all_opt["power_wait"]["default"] = 2
    all_opt["snmp_version"]["default"] = "1"
    all_opt["community"]["default"] = "private"
    options = check_input(device_opt, process_input(device_opt))

    # Plug indexing start from zero on ePDU Managed, so we substract '1' from
    # the user's given plug number.
    # For Switched ePDU, we will add this back again later.
    if options.has_key("--plug") and options["--plug"].isdigit():
        options["--plug"] = str(int(options["--plug"]) - 1)

    docs = {}
    docs["shortdesc"] = "Fence agent for Eaton over SNMP"
    docs["longdesc"] = "fence_eaton_snmp is an I/O Fencing agent \
which can be used with the Eaton network power switch. It logs \
into a device via SNMP and reboots a specified outlet. It supports \
SNMP v1 and v3 with all combinations of  authenticity/privacy settings."

    docs["vendorurl"] = "http://powerquality.eaton.com"
    show_docs(options, docs)

    # Operate the fencing device
    result = fence_action(FencingSnmp(options), options, set_power_status,
                          get_power_status, get_outlets_status)

    sys.exit(result)
コード例 #2
0
def main():
	device_opt = ["fabric_fencing", "ipaddr", "login", "passwd", "no_login", "no_password", \
		       "port", "snmp_version", "snmp"]

	atexit.register(atexit_handler)

	all_opt["snmp_version"]["default"] = "2c"

	options = check_input(device_opt, process_input(device_opt))

	docs = {}
	docs["shortdesc"] = "Fence agent for IF MIB"
	docs["longdesc"] = "fence_ifmib is an I/O Fencing agent \
which can be used with any SNMP IF-MIB capable device. \
\n.P\n\
It was written with managed ethernet switches in mind, in order to \
fence iSCSI SAN connections. However, there are many devices that \
support the IF-MIB interface. The agent uses IF-MIB::ifAdminStatus \
to control the state of an interface."
	docs["vendorurl"] = "http://www.ietf.org/wg/concluded/ifmib.html"
	show_docs(options, docs)

	# Operate the fencing device
	result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)

	sys.exit(result)
コード例 #3
0
def main():
    device_opt = [
        "ipaddr", "login", "passwd", "no_login", "no_password", "port",
        "snmp_version", "snmp"
    ]

    atexit.register(atexit_handler)

    options = check_input(device_opt, process_input(device_opt))

    docs = {}
    docs["shortdesc"] = "Fence agent for Intel Modular"
    docs["longdesc"] = "fence_intelmodular is an I/O Fencing agent \
which can be used with Intel Modular device (tested on Intel MFSYS25, should \
work with MFSYS35 as well). \
\n.P\n\
Note: Since firmware update version 2.7, SNMP v2 write support is \
removed, and replaced by SNMP v3 support. So agent now has default \
SNMP version 3. If you are using older firmware, please supply -d \
for command line and snmp_version option for your cluster.conf."

    docs["vendorurl"] = "http://www.intel.com"
    show_docs(options, docs)

    # Operate the fencing device
    result = fence_action(FencingSnmp(options), options, set_power_status,
                          get_power_status, get_outlets_status)

    sys.exit(result)
コード例 #4
0
ファイル: fence_ibmblade.py プロジェクト: sbauza/fence-agents
def main():
    device_opt = ["ipaddr", "login", "passwd", "no_login", "no_password", \
            "port", "snmp_version", "snmp"]

    atexit.register(atexit_handler)

    all_opt["snmp_version"]["default"] = "1"

    options = check_input(device_opt, process_input(device_opt))

    docs = {}
    docs["shortdesc"] = "Fence agent for IBM BladeCenter over SNMP"
    docs["longdesc"] = "fence_ibmblade is an I/O Fencing agent \
which can be used with IBM BladeCenter chassis. It issues SNMP Set \
request to BladeCenter chassis, rebooting, powering up or down \
the specified Blade Server."

    docs["vendorurl"] = "http://www.ibm.com"
    show_docs(options, docs)

    # Operate the fencing device
    result = fence_action(FencingSnmp(options), options, set_power_status,
                          get_power_status, get_outlets_status)

    sys.exit(result)
コード例 #5
0
def main():
    global PORT_OID

    device_opt = ["fabric_fencing", "ipaddr", "login", "passwd", "no_login", "no_password", \
            "port", "snmp_version", "snmp"]

    atexit.register(atexit_handler)

    options = check_input(device_opt, process_input(device_opt))

    docs = {}
    docs["shortdesc"] = "Fence agent for Cisco MDS"
    docs["longdesc"] = "fence_cisco_mds is an I/O Fencing agent \
which can be used with any Cisco MDS 9000 series with SNMP enabled device."

    docs["vendorurl"] = "http://www.cisco.com"
    show_docs(options, docs)

    if not options["--action"] in ["list", "monitor"]:
        PORT_OID = cisco_port2oid(options["--plug"])

    # Operate the fencing device
    result = fence_action(FencingSnmp(options), options, set_power_status,
                          get_power_status, get_outlets_status)

    sys.exit(result)
コード例 #6
0
def main():
	device_opt = ["ipaddr", "login", "passwd", "no_login", "no_password", \
		       "port", "snmp_version", "snmp"]

	atexit.register(atexit_handler)

	all_opt["snmp_version"]["default"] = "1"
	all_opt["community"]["default"] = "private"

	options = check_input(device_opt, process_input(device_opt))

        ## Support for -n [switch]:[plug] notation that was used before
	if ("--plug" in options) and (-1 != options["--plug"].find(":")):
		(switch, plug) = options["--plug"].split(":", 1)
		if switch.isdigit() and plug.isdigit():
			options["--switch"] = switch
			options["--plug"] = plug

	if "--switch" not in options:
		options["--switch"] = "1"

	docs = {}
	docs["shortdesc"] = "Fence agent for APC, Tripplite PDU over SNMP"
	docs["longdesc"] = "fence_apc_snmp is an I/O Fencing agent \
which can be used with the APC network power switch or Tripplite PDU devices.\
It logs into a device via SNMP and reboots a specified outlet. It supports \
SNMP v1, v2c, v3 with all combinations of  authenticity/privacy settings."
	docs["vendorurl"] = "http://www.apc.com"
	show_docs(options, docs)

	# Operate the fencing device
	result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)

	sys.exit(result)
コード例 #7
0
ファイル: fence_ipdu.py プロジェクト: xtavras/fence-agents
def main():
    global device

    device_opt = ["ipaddr", "login", "passwd", "no_login", "no_password", \
            "port", "snmp_version", "snmp"]

    atexit.register(atexit_handler)

    all_opt["snmp_version"]["default"] = "3"
    all_opt["community"]["default"] = "private"
    all_opt["switch"]["default"] = "1"
    device = IBMiPDU

    options = check_input(device_opt, process_input(device_opt))

    docs = {}
    docs["shortdesc"] = "Fence agent for iPDU over SNMP"
    docs["longdesc"] = "fence_ipdu is an I/O Fencing agent \
which can be used with the IBM iPDU network power switch. It logs \
into a device via SNMP and reboots a specified outlet. It supports \
SNMP v3 with all combinations of authenticity/privacy settings."

    docs["vendorurl"] = "http://www.ibm.com"
    show_docs(options, docs)

    # Operate the fencing device
    result = fence_action(FencingSnmp(options), options, set_power_status,
                          get_power_status, get_outlets_status)

    sys.exit(result)
コード例 #8
0
ファイル: fence_emerson.py プロジェクト: xtavras/fence-agents
def main():
    device_opt = ["ipaddr", "login", "passwd", "no_login", "no_password", \
            "port", "snmp_version", "snmp"]

    atexit.register(atexit_handler)

    all_opt["power_wait"]["default"] = "5"
    options = check_input(device_opt, process_input(device_opt))

    docs = {}
    docs["shortdesc"] = "Fence agent for Emerson over SNMP"
    docs["longdesc"] = "fence_emerson is an I/O Fencing agent \
	which can be used with MPX and MPH2 managed rack PDU."

    docs["vendorurl"] = "http://www.emersonnetworkpower.com"
    show_docs(options, docs)

    # Operate the fencing device
    result = fence_action(FencingSnmp(options), options, set_power_status,
                          get_power_status, get_outlets_status)

    sys.exit(result)