RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1459586 - RFE: Improve handling of unknown devices by fence_eaton_snmp
Summary: RFE: Improve handling of unknown devices by fence_eaton_snmp
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: fence-agents
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-07 14:08 UTC by Ondrej Faměra
Modified: 2020-12-14 08:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-08-06 14:23:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3397261 0 None None None 2018-04-02 11:55:21 UTC

Description Ondrej Faměra 2017-06-07 14:08:36 UTC
=== 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):
fence-agents-eaton-snmp-4.0.11-47.el7_3.5.x86_64

=== How reproducible:
Always.

=== 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' '.1.3.6.1.2.1.1.2.0'

.1.3.6.1.2.1.1.2.0 .1.3.6.1.4.1.534.6.6.7

Traceback (most recent call last):
  File "/usr/sbin/fence_eaton_snmp", line 235, in <module>
    main()
  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
    eaton_resolv_port_id(conn, options)
  File "/usr/sbin/fence_eaton_snmp", line 91, in eaton_resolv_port_id
    eaton_set_device(conn)
  File "/usr/sbin/fence_eaton_snmp", line 83, in eaton_set_device
    device = agents_dir[eaton_type[0][1]]
KeyError: None

=== 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.


Note You need to log in before you can comment on or make changes to this bug.