Bug 1608979

Summary: SNMP Alert Script for Pacemaker does not send all the OIDs specified in PACEMAKER-MIB
Product: Red Hat Enterprise Linux 7 Reporter: Ryan <rblough>
Component: pacemakerAssignee: Ken Gaillot <kgaillot>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: high Docs Contact:
Priority: low    
Version: 7.6CC: abeekhof, cluster-maint, ealcaniz, kgaillot, phagara, sbradley
Target Milestone: rc   
Target Release: 7.7   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: pacemaker-1.1.20-1.el7 Doc Type: No Doc Update
Doc Text:
This does not affect enough users to document
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 12:53:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Modified script; enters 0 in the OID fields left blank by the sample script.
none
Proposed alert_snmp.sh.sample to send all OIDs none

Description Ryan 2018-07-26 15:51:11 UTC
Created attachment 1470819 [details]
Modified script; enters 0 in the OID fields left blank by the sample script.

Description of problem:

The /usr/share/pacemaker/alerts/alert_snmp.sh.sample file for using Pacemaker Alerts is not consistent with PACEMAKER-MIB (/usr/share/snmp/mibs/PCMK-MIB.txt). 

Of the three cases:
- node
- fencing
- resource
Only the resource type sends all the OIDs specified in PACEMAKER-MIB. The trapsink expects all the OID fields to be available in every case, so the lack of fields in the node and fencing types is an issue.

Version-Release number of selected component (if applicable):
pacemaker-1.1.16-12.el7_4.7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Configure alerts using the sample script in accordance with this guidance: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/high_availability_add-on_reference/index#s1-alerts-HAAR

2. Test all three types (node, fencing, resource)

3. Observe OIDs of each type

Actual results:
Only the resource type has all the fields available.

Expected results:
All three types have all the fields available, and conforms to PACEMAKER-MIB.

Additional info:
The attached alert_snmp.sh file has been adjusted to enter 0 in the OID fields that are currently left blank by the sample script; it is currently being used by Vodafone.

Comment 3 Ken Gaillot 2018-09-12 14:48:35 UTC
The sample alert agents are provided as examples, and are not directly supported, so the user is correct to modify it to suit their needs. The proposed change makes sense; we can incorporate that into the sample, targeted for the 7.7 release.

Comment 4 Ken Gaillot 2018-09-21 20:39:59 UTC
Fixed in upstream 1.1 branch as of commit 9aa5a070

The new script will be attached here in case anyone would like to try it

Comment 5 Ken Gaillot 2018-09-21 20:42:54 UTC
Created attachment 1485817 [details]
Proposed alert_snmp.sh.sample to send all OIDs

Comment 6 Ken Gaillot 2018-09-21 20:45:42 UTC
The proposed sample script will use 2147483647 (the maximum Integer32 value) for unused numeric OIDs and "n/a" for unused string OIDs. These values are user-configurable via the new trap_ignore_int32 and trap_ignore_string parameters.

Comment 10 Patrik Hagara 2019-03-20 12:40:31 UTC
qa-ack+, sanity only -- will check that a new example alert script is included in package

Comment 12 Patrik Hagara 2019-06-20 16:47:24 UTC
> [root@virt-036 ~]# rpm -q pacemaker
> pacemaker-1.1.20-5.el7.x86_64
> [root@virt-036 ~]# rpm -qf /usr/share/pacemaker/alerts/alert_snmp.sh.sample
> pacemaker-1.1.20-5.el7.x86_64
> [root@virt-036 ~]# wget -O alert_smlp.sh.sample https://bugzilla.redhat.com/attachment.cgi?id=1485817
> [...]
> 2019-06-20 18:43:54 (9.40 MB/s) - ‘alert_smlp.sh.sample’ saved [5839/5839]
> [root@virt-036 ~]# diff -s /usr/share/pacemaker/alerts/alert_snmp.sh.sample alert_smlp.sh.sample     
> Files /usr/share/pacemaker/alerts/alert_snmp.sh.sample and alert_smlp.sh.sample are identical

Marking as VERIFIED SanityOnly in pacemaker-1.1.20-5.el7.x86_64

Comment 14 errata-xmlrpc 2019-08-06 12:53:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2129