Created attachment 1947070 [details] Proposed sample agent (obsolete)
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"
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.
Let me know if the new sample is good
Created attachment 1949424 [details] Proposed sample SNMP alert agent
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.
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.
verified as SanityOnly in pacemaker-2.1.6-1.el8