Bug 1381287 - Alerts don't send SNMP traps
Summary: Alerts don't send SNMP traps
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Control
Version: 5.7.0
Hardware: All
OS: All
medium
medium
Target Milestone: GA
: 5.8.0
Assignee: Lucy Fu
QA Contact: Dmitry Misharov
URL:
Whiteboard: alert
: 1381500 (view as bug list)
Depends On:
Blocks: 1386786 1386792
TreeView+ depends on / blocked
 
Reported: 2016-10-03 15:00 UTC by Dmitry Misharov
Modified: 2017-06-12 17:24 UTC (History)
4 users (show)

Fixed In Version: 5.8.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1386786 1386792 (view as bug list)
Environment:
Last Closed: 2017-06-12 17:24:45 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dmitry Misharov 2016-10-03 15:00:14 UTC
Description of problem:
Alerts don't send SNMP traps.

Version-Release number of selected component (if applicable):
5.7.0.3.20160927165516_075d0f3

How reproducible:
Always

Steps to Reproduce:
1. Enable "Notifier" role.
2. Create an alert with following parameters:
Based On: VM and Instance
What to Evaluate: Nothing
Driving Event: VM Operation: VM Power Off
Notification Frequency: 1 Minute
Send SNMP Trap
Host: localhost
Version: v2
Trap Object ID: info

Variable Object ID      Type      Value
1.2.3 	                Integer   1

3. Create VM and Instance alert profile.
4. Add the alert to the alert profile.
5. Assign the alert profile to "The Enterprise".
6. Power off a VM.


Actual results:
SNMP trap is not sent, there is an error in the log:
ERROR -- : /var/www/miq/vmdb/app/models/miq_snmp.rb:75:in `trap_v2' - for SNMP v2
ERROR -- : /var/www/miq/vmdb/app/models/miq_snmp.rb:75:in `trap_v2' - for SNMP v1

Expected results:
SNMP trap should be sent.

Comment 2 Dmitry Misharov 2016-10-04 06:20:44 UTC
There was wrong copypaste in the first comment, should be:
ERROR -- : /var/www/miq/vmdb/app/models/miq_snmp.rb:31:in `trap_v1' - for SNMP v1

Comment 4 CFME Bot 2016-10-18 11:10:57 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/e42a5311358b8b70f2d0e75ee5ea74353bfa24fe

commit e42a5311358b8b70f2d0e75ee5ea74353bfa24fe
Author:     Lucy Fu <lufu>
AuthorDate: Mon Oct 17 14:19:19 2016 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Mon Oct 17 14:21:10 2016 -0400

    Fix the issue that alerts don't send SNMP traps.
    
    Private methods can only be called without an explicit receiver.
    https://bugzilla.redhat.com/show_bug.cgi?id=1381287

 app/models/miq_snmp.rb       | 16 ++++++++--------
 spec/models/miq_snmp_spec.rb | 12 ++++++++++++
 2 files changed, 20 insertions(+), 8 deletions(-)
 create mode 100644 spec/models/miq_snmp_spec.rb

Comment 5 Lucy Fu 2016-10-18 13:21:51 UTC
*** Bug 1381500 has been marked as a duplicate of this bug. ***

Comment 6 CFME Bot 2016-10-19 03:42:11 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/5c08fab4970337d274b35a49bbb64956efa42036

commit 5c08fab4970337d274b35a49bbb64956efa42036
Author:     Oleg Barenboim <chessbyte>
AuthorDate: Tue Oct 18 06:07:45 2016 -0500
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Tue Oct 18 22:38:10 2016 -0500

    Merge pull request #11988 from lfu/snmp_trap_1381287
    
    Fix the issue that alerts don't send SNMP traps.
    (cherry picked from commit f62e14ec595b242db2a53cb910b6708049c1bb36)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1381287

 app/models/miq_snmp.rb       | 18 +++++++++---------
 spec/models/miq_snmp_spec.rb | 12 ++++++++++++
 2 files changed, 21 insertions(+), 9 deletions(-)
 create mode 100644 spec/models/miq_snmp_spec.rb

Comment 9 CFME Bot 2016-10-20 22:36:00 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/a33cd9b6bbb2d6115a10be63b92854b59d707f00

commit a33cd9b6bbb2d6115a10be63b92854b59d707f00
Author:     Lucy Fu <lufu>
AuthorDate: Thu Oct 20 17:33:08 2016 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Thu Oct 20 17:33:28 2016 -0400

    Fix the issue that alerts don't send SNMP v1 traps.
    
    Private methods can only be called without an explicit receiver.
    https://bugzilla.redhat.com/show_bug.cgi?id=1381287

 app/models/miq_snmp.rb       |  6 +++---
 spec/models/miq_snmp_spec.rb | 11 +++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

Comment 10 Dmitry Misharov 2017-03-08 12:55:24 UTC
Verified in 5.8.0.4.20170307183144_745a3d9. SNMP alerts is sent correctly.


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