Bug 1386786 - 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.7.0
Assignee: Lucy Fu
QA Contact: Dmitry Misharov
URL:
Whiteboard: alert
Depends On: 1381287
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-19 15:46 UTC by Satoe Imaishi
Modified: 2017-01-12 04:42 UTC (History)
5 users (show)

Fixed In Version: 5.7.0.7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1381287
Environment:
Last Closed: 2017-01-11 19:50:46 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 2 Dmitry Misharov 2016-10-20 14:01:25 UTC
There is still an error for SNMP v1:
ERROR -- : /var/www/miq/vmdb/app/models/miq_snmp.rb:31:in `trap_v1'
SNMP v2 works fine.

Comment 3 Satoe Imaishi 2016-10-21 14:55:36 UTC
Putting back to ON_DEV as the 2nd PR (https://github.com/ManageIQ/manageiq/pull/12089) isn't backported to euwe yet.

Comment 4 CFME Bot 2016-10-21 22:10:48 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/ba2909018ee553e0c6b32177c3e58b86c85739c6

commit ba2909018ee553e0c6b32177c3e58b86c85739c6
Author:     Oleg Barenboim <chessbyte>
AuthorDate: Thu Oct 20 18:33:20 2016 -0400
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Fri Oct 21 18:08:20 2016 -0400

    Merge pull request #12089 from lfu/snmp_trapv1_1381287
    
    Fix the issue that alerts don't send SNMP v1 traps.
    (cherry picked from commit e377ca77d25d38a18b732ea360448bfe0c15e9aa)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1386786

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

Comment 6 Dmitry Misharov 2016-11-01 10:00:45 UTC
Alert
Based On: VM and Instance
What to Evaluate: Nothing
Driving Event: VM Operation: VM Power Off
Notification Frequency: 1 Minute

SNMP Trap

Host: 127.0.0.1
Version: v1
Trap Number: 1

Variable Object ID	Type		Value
1.2.3			OctetString	TESTING

On the appliance I started snmptrapd:
# echo 'disableAuthorization yes' >> /etc/snmp/snmptrapd.conf
# systemctl start snmptrapd.service

Alert successfully triggered, but snmptrapd showed:
# journalctl /usr/sbin/snmptrapd
snmptrapd[17219]: 2016-11-01 05:40:53 192.168.100.193(via UDP: [127.0.0.1]:40688->[127.0.0.1]:162) TRAP, SNMP v2c, community public SNMPv2-SMI::enterprises.33482 Enterprise Specific Trap (1) Uptime: 18:21:45.19 iso.2.3 = STRING: "TESTING"

CFME sends snmp v2 trap instead of v1.

If you send a snmp v1 trap using this command:
# snmptrap -v1 -c public 127.0.0.1 1.3.6.1.4.1.20408.4.1.1.2 127.0.0.1 1 1 123 1.3.6.1.2.1.1.1.0 s test.
snmptrapd log will show:
snmptrapd[17219]: 2016-11-01 05:56:10 localhost [127.0.0.1] (via UDP: [127.0.0.1]:33328->[127.0.0.1]:162) TRAP, SNMP v1, community public SNMPv2-SMI::enterprises.20408.4.1.1.2 Warm Start Trap (1) Uptime: 0:00:01.23 SNMPv2-MIB::sysDescr.0 = STRING: test

Comment 14 Dmitry Misharov 2016-11-03 15:57:04 UTC
Verified in 5.7.0.9-beta2.1.20161101182054_eb0afaa.


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