Bug 2160206

Summary: RFE: Add sample script for pacemaker alerts that support SNMPv3.
Product: Red Hat Enterprise Linux 8 Reporter: Shane Bradley <sbradley>
Component: pacemakerAssignee: Ken Gaillot <kgaillot>
Status: VERIFIED --- QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact: Steven J. Levine <slevine>
Priority: high    
Version: 8.7CC: cluster-maint, kgaillot, msmazova, sbradley, slevine
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: 8.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pacemaker-2.1.6-1.el8 Doc Type: Enhancement
Doc Text:
.The `alert_snmp.sh.sample` alert agent now supports SNMPv3 The `alert_snmp.sh.sample` alert agent, which is the sample alert agent provided with Pacemaker, now supports the SNMPv3 protocol as well as SNMPv2. With this update, You can copy the `alert_snmp.sh.sample` agent without modification to use SNMPv3 with Pacemaker alerts.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Enhancement
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version: 2.1.6
Embargoed:
Attachments:
Description Flags
Proposed sample SNMP alert agent none

Comment 2 Ken Gaillot 2023-02-28 23:26:09 UTC
Created attachment 1947070 [details]
Proposed sample agent (obsolete)

Comment 3 Ken Gaillot 2023-02-28 23:32:27 UTC
I've attached a proposed fixed sample agent.

The SNMP trap version, community, and options can be set when configuring the alert in pcs, for example:

    pcs alert create path=/srv/alerts/alert_snmp.sh options trap_version=3 \
        trap_community="" trap_options="-l authNoPriv -a MD5 -u testuser -A secret1" \
        meta timestamp-format="%Y-%m-%d,%H:%M:%S.%01N"

Comment 9 Ken Gaillot 2023-03-06 19:37:53 UTC
Created attachment 1948503 [details]
Proposed sample agent

I've attached an updated version of the sample agent that ensures the community is empty if v3 is used.

Comment 10 Ken Gaillot 2023-03-06 19:38:56 UTC
Let me know if the new sample is good

Comment 11 Ken Gaillot 2023-03-09 22:17:32 UTC
Created attachment 1949424 [details]
Proposed sample SNMP alert agent

Comment 12 Ken Gaillot 2023-03-09 22:18:24 UTC
Updated the attached agent again, the previous version wouldn't have worked with SNMP v2c. The current version should work with SNMP v1, v2c, and v3.

Comment 13 Ken Gaillot 2023-03-13 14:11:50 UTC
Latest attached agent has been merged in the upstream main branch as of commit 0f88388. If any issues are found, we can update it again.

Comment 20 Markéta Smazová 2023-06-28 14:49:44 UTC
verified as SanityOnly in pacemaker-2.1.6-1.el8