Red Hat Bugzilla – Bug 1459586
RFE: Improve handling of unknown devices by fence_eaton_snmp
Last modified: 2018-04-02 07:55:21 EDT
=== Description of problem:
When the fence_eaton_snmp is used against device not supported
by it as seen from the source code of the agent it crashes with python
traceback. A simple listing of supported devices would be a better output
so we can distinguish between "potentially broken fence agent" and "unsupported device".
From the code it looks that we would just need to check if the supported OIDs are present.
=== Version-Release number of selected component (if applicable):
=== How reproducible:
=== Steps to Reproduce:
1. Run command below against unsupported EATON device
fence_eaton_snmp --ip=192.168.X.X --community=public --username=admin --password=admin --plug=1 --action=status --verbose
=== Actual results:
/usr/bin/snmpwalk -m '' -Oeqn -v '1' -c 'public' '192.168.X.X:161' '.184.108.40.206.220.127.116.11.0'
Traceback (most recent call last):
File "/usr/sbin/fence_eaton_snmp", line 235, in <module>
File "/usr/sbin/fence_eaton_snmp", line 231, in main
result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)
File "/usr/share/fence/fencing.py", line 974, in fence_action
status = get_multi_power_fn(tn, options, get_power_fn)
File "/usr/share/fence/fencing.py", line 880, in get_multi_power_fn
plug_status = get_power_fn(tn, options)
File "/usr/sbin/fence_eaton_snmp", line 128, in get_power_status
File "/usr/sbin/fence_eaton_snmp", line 91, in eaton_resolv_port_id
File "/usr/sbin/fence_eaton_snmp", line 83, in eaton_set_device
device = agents_dir[eaton_type]
=== Expected results:
Message in below style:
The device that you are trying to connect doesn't look to be supported by this fencing agent.
Following devices were tested with this agentto work:
- Eaton ePDU Managed - SNMP v1
EATON | Powerware ePDU model: Managed ePDU (PW104MA0UB99), firmware: 01.01.01
- Eaton ePDU Switched - SNMP v1
EATON | Powerware ePDU model: Switched ePDU (IPV3600), firmware: 2.0.K
=== Additional info:
The list of tested devices is from the fencing agent itself.