Description of problem: If an apc switch has too many outlets to display on one single page it requires the user to "Press <ENTER> to continue". The script assumes that there is no such prompt, and will fail with failed: unrecognised menu response Version-Release number of selected component (if applicable): fence-1.32.1-0 How reproducible: always Steps to Reproduce: 1.Get a switch with enough outlets (e.g. 25) 2.Try to fence_apc any outlet on this switch 3. Actual results: fails and returns an error Expected results: should fence the outlet Additional info: This is the relevant part of /tmp/apclog: ------- Device Manager ------------------------------------------------------- - 1- Phase Monitor/Configuration 2- Outlet Restriction Configuration 3- Outlet Control/Config 4- Power Supply Status <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log > 3 ^M------- Outlet Control/Config ------------------------------------------------ - 1- Outlet 1: . ON 2- Outlet 2: . ON 3- Outlet 3: . ON 4- Outlet 4: . ON [...] 21- Outlet 21: junior (atrpms) ON 22- Outlet 22: zerberus (secnet) ON ^M Press <ENTER> to continue...^M ^M 23- Outlet 23: w4 (webserver) ON 24- Outlet 24: zs04 (mailserver) ON 25- Master Control/Config ?- Help, <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log > ^M------- Outlet Control/Config ------------------------------------------------ - 1- Outlet 1: . ON 2- Outlet 2: . ON 3- Outlet 3: . ON 4- Outlet 4: . ON [...] 21- Outlet 21: junior (atrpms) ON 22- Outlet 22: zerberus (secnet) ON ^M Press <ENTER> to continue...^M ^M 23- Outlet 23: w4 (webserver) ON 24- Outlet 24: zs04 (mailserver) ON 25- Master Control/Config ?- Help, <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log > ^M------- Device Manager ------------------------------------------------------- - 1- Phase Monitor/Configuration 2- Outlet Restriction Configuration 3- Outlet Control/Config 4- Power Supply Status <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log > [...]
I've seen this too. I think there needs to be some logic after the "# Identify next option" section of subroutine navigate. This is something I was looking at, but have not had time to get it working: # special mod for AP7941 # if(in outlet control section) # { # if(outlet match) # { # send space; # choose outlet; # goto next; # } # send space; # if(outlet match) # { # choose outlet; # goto next; # } # } if(/--\s*Outlet Control.*(\d+)\s*-\s+Outlet\s+\d{1,2}\D[^\n]*\s(?-i:ON|OFF)\*?\s/ism) { print "DEBUGGING: In outlet control section...\n"; if( ! /--\s*Outlet Control.*(\d+)\s*-\s+Outlet\s+$opt_n\D[^\n]*\s(?-i:ON|OFF)\*?\s/ism) { print "DEBUGGING: Inside 1-22 section\n"; $t->print(""); $t->print($1); } print "DEBUGGING: attempting to lookup in 23-25 section\n"; $t->print(""); if(/--\s*Outlet Control.*(\d+)\s*-\s+Outlet\s+$opt_n\D[^\n]*\s(?-i:ON|OFF)\*?\s/ism) { print "DEBUGGING: Inise 23-25 section\n"; $t->print($1); next; } } # end special mod for AP7941
Created attachment 120667 [details] A patch to fix this problem This patch "should" fix the problem, but as I do not have this kind of hardware laying around I can't tell if it will. Let me know if it works for you. I patched the RPM directly, you should be able to apply them to /sbin/fence_apc manually.
Created attachment 120688 [details] typescript from runtime This is the attachment with the full story on whats going on with the new fence_apc patch.
Created attachment 120689 [details] slighly more legible typescript -- ran through strings. This is the same typescript as above, but ran through strings to make it more readible. Sorry for the redundancy.
The test version of fence_apc_snmp has helped with this issue, but not eliminated it completely yet. There is an intermittent problem with the snmp agent which has been tracked down to a build setting in net-snmp. New version of agent is forthcoming.
New version of snmp script sent. Had meeting with APC representitives, and this issue was raised. We now have a fallback strategy if the latest script is not completely reliable.
The root problem here turns out not to be the script. The customer was logged into the switch intermittantly while fencing was occurring; and APC devices allow only one log in session at a time. The snmp script tested for this issue is a valid solution to the APC devices which have a large number of outlets that do not fit on one screen.
One other note - the standard perl fence agent for APC has been fixed to work with large outlet strips as well as the snmp agent.
Where can I get this fixed perl fence agent? I checked both RHEL4 and FC5 and neither can cope with 24 ports: fence-1.32.18-0 (RHEL4) fence-1.32.17-0.FC5.1 (FC5) Thanks!
Created attachment 128210 [details] snmp apc agent that works on large power strips This first attachment is an snmp version of the agent - the interface is identical to the current perl apc agent. Untar and check out the readme.
Created attachment 128211 [details] fence_apc for many outlets Please let me know how this works out.
I tested it on a 25 port switch. I also tested RHEL4's fence-1.32.25-1 and it worked as well. Thanks!