Description of problem: I ran: /sbin/fence_apc_snmp -a link-apc -n 1:1 -o staus (note staus typo) And got the following output: Error turning outlet off I would have expected the fence agent to error out if it is given an action (-o) it doesn't understand, rather than defaulting to powering off the outlet. I tried this again with a different typo and got different results: [root@link-13 fence]# /sbin/fence_apc_snmp -a marathon-apc -n 6 -o status Outlet "6" - 6 is on [root@link-13 fence]# /sbin/fence_apc_snmp -a marathon-apc -n 6 -o stat Usage: Options: -h Usage -a <ip> IP address or hostname of fence device -u <udpport> UDP port to use (default 161) -c <community> SNMP community (default 'private') -n <num> Outlet name/number to act on -o <string> Action: Reboot (default), On, Off and Status -v Verbose mode - write to /tmp/apclog -V Version Error in packet. Reason: (genError) A general failure occured snmpset failed
fence-1.32.57-1
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
Created attachment 310155 [details] New version of apc snmp agent Please try this
Not good -- I ran the command below and it powered off my node! [root@marathon-01 tmp]# ./fence_apc_snmp -a marathon-apc -n 1 -o bogus Usage: Options: -h Usage -a <ip> IP address or hostname of fence device -u <udpport> UDP port to use (default 161) -c <community> SNMP community (default 'private') -n <num> Outlet name/number to act on -o <string> Action: Reboot (default), On, Off and Status -v Verbose mode - write to /tmp/apclog -V Version
Still fails, it once again powered off the node on port one: [root@taft-01 tmp]# fence_apc_snmp -V 1.32.62 Copyright (C) Red Hat, Inc. 2004 All rights reserved. (built Mon Jul 21 16:43:35 EDT 2008) [root@taft-01 tmp]# fence_apc_snmp -a marathon-apc -n 1 -o bogus Usage: Options: -h Usage -a <ip> IP address or hostname of fence device -u <udpport> UDP port to use (default 161) -c <community> SNMP community (default 'private') -n <num> Outlet name/number to act on -o <string> Action: Reboot (default), On, Off and Status -v Verbose mode - write to /tmp/apclog -V Version Looking in the APC log the apc is getting the commands to turn that port off, then on when I gave the "-o bogus" 07/21/2008 15:23:07 Switched Rack PDU: Outlet #1 (marathon-01) on. 07/21/2008 15:23:07 Switched Rack PDU: Outlet #1 (marathon-01) off.
The problem with the fence script is that there is a sys.exit(3) in a try..except block. See how it doesn't work as expected in some example code: $ cat tryexit.py import sys try: print "try" sys.exit(3) except: print "except" $ python tryexit.py try except
verified w/fence-1.32.63-1
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2008-0801.html