From ef3d19b4b524fcb406d1d927ceadfd9343c22717 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:27:16 +0100 Subject: [PATCH 01/24] first commit --- .../alerts_to_snmp/BMC-CONTROLMEM-MIB.txt | 461 ++++++++++++++++++ .../alerts_to_snmp/README.md | 105 ++++ .../alerts_to_snmp/alerts_to_snmp.sh | 54 ++ 3 files changed, 620 insertions(+) create mode 100644 helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/BMC-CONTROLMEM-MIB.txt create mode 100644 helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md create mode 100644 helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/alerts_to_snmp.sh diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/BMC-CONTROLMEM-MIB.txt b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/BMC-CONTROLMEM-MIB.txt new file mode 100644 index 00000000..e4881d78 --- /dev/null +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/BMC-CONTROLMEM-MIB.txt @@ -0,0 +1,461 @@ +BMC-CONTROLEM-MIB DEFINITIONS ::= BEGIN + +-- controlmemMIB MODULE-IDENTITY +-- LAST-UPDATED "200509251533Z" +-- ORGANIZATION "BMC Software" +-- CONTACT-INFO +-- "Contorl-M/Enterprise Manager development group at BMC Software" +-- DESCRIPTION +-- "Control-M/Enterprise Manager MIB" +-- REVISION "200509251533Z" +-- DESCRIPTION +-- "Initial version." +-- ::= { enterprises 1031 9 } + +IMPORTS + enterprises + FROM RFC1155-SMI + OBJECT-TYPE + FROM RFC-1212 + TRAP-TYPE + FROM RFC-1215; + +--MIB module for Control-M/Enterprise Manager traps + +bmc OBJECT IDENTIFIER ::= { enterprises 1031 } + +controlmemMIB OBJECT IDENTIFIER ::= { bmc 9} + +--Control-M/Enterprise Manager Alert entity + +controlmAlert OBJECT IDENTIFIER ::= { controlmemMIB 1 } + +alertTrapUpdateType OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..1)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert update type + 'I' Insert - new alert + 'U' Update existing alert" + ::= { controlmAlert 1 } + + +alertTrapAlertId OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..20)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert id + Unique alert identifier" + ::= { controlmAlert 2 } + + +alertTrapControlM OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..20)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Control-M server name" + ::= { controlmAlert 3 } + + +alertTrapMemName OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..30)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job member name" + ::= { controlmAlert 4 } + + +alertTrapOrderId OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..5)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job order id" + ::= { controlmAlert 5 } + + +alertTrapSeverity OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..1)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert severity + 'R' - regular + 'U' - urgent + 'V' - very urgent" + ::= { controlmAlert 6 } + + +alertTrapTime OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..14)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert creation time (YYYYMMDDhhmmss)" + ::= { controlmAlert 8 } + + +alertTrapStatus OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..11)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert status (Not_Noticed, Noticed or Handled)" + ::= { controlmAlert 7 } + + +alertTrapNodeId OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..50)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job node id" + ::= { controlmAlert 16 } + + +alertTrapJobName OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..64)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job name" + ::= { controlmAlert 15 } + + +alertTrapMessage OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert message" + ::= { controlmAlert 11 } + + +alertTrapApplication OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..20)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job application name" + ::= { controlmAlert 14 } + + +alertTrapGroup OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..20)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job sub application name" + ::= { controlmAlert 13 } + + +alertTrapType OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..1)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert type + B - BIM alert type + R or empty - regular alert type" + ::= { controlmAlert 17 } + + +alertTrapClosedFromEM OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..1)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Closed from Control-M/Enterprise Manager + Y - yes + N or empty - no" + ::= { controlmAlert 18 } + + +alertTrapTicketNumber OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..15)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Remedy ticket number" + ::= { controlmAlert 19 } + + +alertTrapRunCounter OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..11)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job's run counter" + ::= { controlmAlert 20 } + + +alertTrapUser OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..16)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Last updated by, user name" + ::= { controlmAlert 9 } + + +alertTrapUpdateTime OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..14)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Last time the alert was updated (YYYYMMDDhhmmss)" + ::= { controlmAlert 10 } + + +alertTrapOwner OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..8)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The user who runs the job" + ::= { controlmAlert 12 } + +alertTrapNotes OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..100)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert notes" + ::= { controlmAlert 21 } + + + +alertTrap TRAP-TYPE + ENTERPRISE controlmAlert + VARIABLES { + alertTrapUpdateType, + alertTrapAlertId, + alertTrapControlM, + alertTrapMemName, + alertTrapOrderId, + alertTrapSeverity, + alertTrapStatus, + alertTrapTime, + alertTrapUser, + alertTrapUpdateTime, + alertTrapMessage, + alertTrapOwner, + alertTrapGroup, + alertTrapApplication, + alertTrapJobName, + alertTrapNodeId, + alertTrapType, + alertTrapClosedFromEM, + alertTrapTicketNumber, + alertTrapRunCounter, + alertTrapNotes} + DESCRIPTION + "" + ::= 10 + + +controlmxAlert OBJECT IDENTIFIER ::= { controlmemMIB 2 } + +xAlertTrapCallType OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..20)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert update type + 'I' Insert - new alert + 'U' Update existing alert" + ::= { controlmxAlert 2 } + +xAlertTrapSerial OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..20)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Serial number" + ::= { controlmxAlert 3 } + +xAlertTrapCompType OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..20)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert id + Unique alert identifier" + ::= { controlmxAlert 4 } + + +xAlertTrapCompMachine OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Control-M server name" + ::= { controlmxAlert 5 } + + +xAlertTrapCompName OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..32)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job member name" + ::= { controlmxAlert 6 } + + +xAlertTrapMessageId OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..20)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job order id" + ::= { controlmxAlert 7 } + + +xAlertTrapXSeverity OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..1)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert severity + '0' - Undefined + '1' - Severe + '2' - Error + '3' - Warning" + ::= { controlmxAlert 8 } + + +xAlertTrapMessage OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert creation time (YYYYMMDDhhmmss)" + ::= { controlmxAlert 9 } + + +xAlertTrapXTime OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..14)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert status (Not_Noticed, Noticed or Handled)" + ::= { controlmxAlert 10 } + + +xAlertTrapXTimeOFLast OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..14)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job node id" + ::= { controlmxAlert 11 } + + +xAlertTrapCounter OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..64)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job name" + ::= { controlmxAlert 12 } + + +xAlertTrapStatus OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..11)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert message" + ::= { controlmxAlert 13 } + + +xAlertTrapNote OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job application name" + ::= { controlmxAlert 14 } + + +xAlertTrapKey1 OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job group name" + ::= { controlmxAlert 15 } + + +xAlertTrapKey2 OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Alert type + B - BIM alert type + R or empty - regular alert type" + ::= { controlmxAlert 16 } + + +xAlertTrapKey3 OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Closed from Control-M/Enterprise Manager + Y - yes + N or empty - no" + ::= { controlmxAlert 17 } + + +xAlertTrapKey4 OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Remedy ticket number" + ::= { controlmxAlert 18 } + + +xAlertTrapKey5 OBJECT-TYPE + SYNTAX OCTET STRING (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Job's run counter" + ::= { controlmxAlert 19 } + + +xAlertTrap TRAP-TYPE + ENTERPRISE controlmxAlert + VARIABLES { + xAlertTrapCallType, + xAlertTrapSerial, + xAlertTrapCompType, + xAlertTrapCompMachine, + xAlertTrapCompName, + xAlertTrapMessageId, + xAlertTrapXSeverity, + xAlertTrapMessage, + xAlertTrapXTime, + xAlertTrapXTimeOFLast, + xAlertTrapCounter, + xAlertTrapStatus, + xAlertTrapNote, + xAlertTrapKey1, + xAlertTrapKey2, + xAlertTrapKey3, + xAlertTrapKey4, + xAlertTrapKey5} + DESCRIPTION + "" + ::= 10 + + + +END \ No newline at end of file diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md new file mode 100644 index 00000000..12d9716b --- /dev/null +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md @@ -0,0 +1,105 @@ +## Description + +This shell script ([**alerts_to_snmp**](alerts_to_snmp)) sends Helix Control-M alerts data as SNMP (v1) traps. + +As an example, the alert data is saved into a file, but this could be replaced by any other action (e.g. sending the alert data as a JSON payload via a webhook). + +## Pre-requisites + +- Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see http://www.net-snmp.org). +- The provided MIB file ([**BMC-CONTROLMEM-MIB**](BMC-CONTROLMEM-MIB.txt)) must be loaded in the SNMP destination host. + +## Instructions + +Before using the script, update the following variables: + +- **destination** : define the SNMP destination host(s). Use commas (,) as delimiter for multiple hosts, and colon (:) to use a specific port (default port is 162). Example: + + ``destination=myhost1,myhost2:2001,192.168.1.37`` + +- **alert_updates** : select whether you want to send or not updates of existing alerts (which happens when the alert "Status", "Urgency" or "Comment" are updated in Helix Control-M). + +Do NOT modify the *base_oid* and *field_names* variables. + +## Additional information + +- The SNMP v1 trap definition in the "snmptrap" command line contains the community (*public*), the destination host, the enterprise-OID (as defined in the MIB file), the agent (IP address of the system generating the trap, empty to use the default value), the generic-trap number ("6" for traps defined in a custom MIB file), the specific-trap ("10" as defined in the MIB file for the TRAP-TYPE macro) and the sysUpTime of the generating application (empty to use the system generated value). + +- The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific OID, the type ("s" for string) and the value. + +- The script sends in a SNMP trap all the alert fields received from Helix Control-M, including the "notes" field. Refer to the [**Alerts Template reference**](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. + +- The script uses the default alert field names for Helix Control-M. Therefore, it is NOT required to use a custom template to change the alert fields to their old names in Control-M (as explained in ["Changing Field Names After Migrating from Onpremises ControlM"](https://documents.bmc.com/supportu/API/Helix/en-US/Documentation/API_Services_RunServices_Alerts_Template_reference.htm#ChangingFieldNamesAfterMigratingfromOnpremisesControlM)). This means that Control-M users migrating to Helix Control-M can use the script without the need to modify the default alerts template. + +- This is an example of all the data generated in the SNMP v1 trap: + +Message Type: Trap1Message +Time Received: 04/02/2024 17:52:49 +SNMP Version: One +Origin Address/Port: 192.168.1.37:50775 +Destination Address/Port: 192.168.1.37:161 +Community: public +Variable IIDs and Values: + 1.3.6.1.4.1.1031.9.1.1 (alertTrapUpdateType): I + 1.3.6.1.4.1.1031.9.1.2 (alertTrapAlertId): 25101 + 1.3.6.1.4.1.1031.9.1.3 (alertTrapControlM): IN01 + 1.3.6.1.4.1.1031.9.1.4 (alertTrapMemName): + 1.3.6.1.4.1.1031.9.1.5 (alertTrapOrderId): 0e4oe + 1.3.6.1.4.1.1031.9.1.6 (alertTrapSeverity): V + 1.3.6.1.4.1.1031.9.1.7 (alertTrapStatus): Not_Noticed + 1.3.6.1.4.1.1031.9.1.8 (alertTrapTime): 20240204165241 + 1.3.6.1.4.1.1031.9.1.9 (alertTrapUser): + 1.3.6.1.4.1.1031.9.1.10 (alertTrapUpdateTime): + 1.3.6.1.4.1.1031.9.1.11 (alertTrapMessage): Ended not OK + 1.3.6.1.4.1.1031.9.1.12 (alertTrapOwner): ctmagent + 1.3.6.1.4.1.1031.9.1.13 (alertTrapGroup): + 1.3.6.1.4.1.1031.9.1.14 (alertTrapApplication): dfe-demos + 1.3.6.1.4.1.1031.9.1.15 (alertTrapJobName): dfe-job-01 + 1.3.6.1.4.1.1031.9.1.16 (alertTrapNodeId): zzz-linux-agent-0 + 1.3.6.1.4.1.1031.9.1.17 (alertTrapType): R + 1.3.6.1.4.1.1031.9.1.18 (alertTrapClosedFromEM): + 1.3.6.1.4.1.1031.9.1.19 (alertTrapTicketNumber): + 1.3.6.1.4.1.1031.9.1.20 (alertTrapRunCounter): 00001 + 1.3.6.1.4.1.1031.9.1.21 (alertTrapNotes): +Agent IP:192.168.182.60 +Enterprise: 1.3.6.1.4.1.1031.9.1 +Generic Trap: 6 +Specific Trap: 10 + + +XXX format `: : [...]`, as in the following example: + +\ +The script parses the input data and converts it to JSON format, starting with the "*alertFields*" key and followed by an array containing all the alert fields and their corresponding values - as in the example below. This is the same JSON structure as the one received when connecting to the External Alerts service via a WebSocket client. + + { + "alertFields" : [ + {"eventType" : "I"}, + {"id" : "2193"}, + {"server" : "IN01"}, + {"fileName" : ""}, + {"runId" : "00q2e"}, + {"severity" : "V"}, + {"status" : "0"}, + {"time" : "20221126150057"}, + {"user" : ""}, + {"updateTime" : ""}, + {"message" : "Ended not OK"}, + {"runAs" : "ctmagent"}, + {"subApplication" : ""}, + {"application" : "my-demos"}, + {"jobName" : "my-sample-job"}, + {"host" : "zzz-linux-agent-1"}, + {"type" : "R"}, + {"closedByControlM" : ""}, + {"ticketNumber" : ""}, + {"runNo" : "00001"}, + {"notes" : ""} + ] + } + +## Versions + +| Date | Updated by | Changes | +| - | - | - | +| 2024-02-04 | David Fernández | First release | diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/alerts_to_snmp.sh b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/alerts_to_snmp.sh new file mode 100644 index 00000000..48368fd6 --- /dev/null +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/alerts_to_snmp.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# BMC Helix Control-M - External Alert Management service +# +# Sends Helix Control-M alerts as SNMP (v1) traps +# +# Author : David Fernandez (david_fernandez@bmc.com) +# Version : 0.4 (04/02/2024) +# +# Notes : - Requires "snmptrap" (from "net-snmp-utils" package - see http://www.net-snmp.org) +# - The MIB file (BMC-CONTROLMEM-MIB) must be loaded in the SNMP destination host +# + +# SNMP destination host(s) +# Use commas (,) as delimiter for multiple hosts, and colon (:) to use a specific port (default 162) +# Example: myhost1,myhost2:2001,192.168.1.37 +destination=192.168.1.37 + +# SNMP base OID for Alerts (as defined in BMC-CONTROLMEM-MIB) - DO NOT MODIFY +base_oid=1.3.6.1.4.1.1031.9.1 + +# Send updates of existing alerts? (Y/N) +alert_updates="Y" + +# Declare array with all the alert field names +# Leave as is to use the default fields for HCTM alerts +field_names=("eventType" "id" "server" "fileName" "runId" "severity" "status" "time" "user" "updateTime" "message" "runAs" "subApplication" "application" "jobName" "host" "type" "closedByControlM" "ticketNumber" "runNo" "notes") + +# If alert updates are not needed, exit if "call_type" = "U" +if [ $alert_updates == "N" ] ; then + if [ $2 == "U" ] ; then exit 0 ; fi +fi + +# Parse fields names and values +num_fields=${#field_names[@]} +for i in ${!field_names[@]}; do + name1=${field_names[$i]} + name2=${field_names[$i+1]} + if [ $i != $((num_fields-1)) ] ; then + value=`echo $* | grep -oP "(?<=${name1}: ).*(?= ${name2}:)"` + else + # if last field, capture until EOL + value=`echo $* | grep -oP "(?<=${name1}: ).*(?)"` + fi + # Create the list of SNMP values to pass as parameters + # adding OID + type (s = string) + value + field_number=$((i+1)) + snmp_values=$snmp_values" "$base_oid.$field_number" s "\"$value\" +done + +# Send the SNMP trap(s) +for i in ${destination//,/ } ; do + bash -c "snmptrap -v 1 -c public $i $base_oid '' 6 10 '' $snmp_values" +done From dea67e856b6f25d526655860606710dc9a427ae6 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:35:46 +0100 Subject: [PATCH 02/24] updates --- .../alerts_to_snmp/README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md index 12d9716b..b60b993c 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md @@ -1,39 +1,40 @@ ## Description -This shell script ([**alerts_to_snmp**](alerts_to_snmp)) sends Helix Control-M alerts data as SNMP (v1) traps. +This shell script ([**alerts_to_snmp**](alerts_to_snmp.sh)) sends Helix Control-M alerts data as SNMP (v1) traps. As an example, the alert data is saved into a file, but this could be replaced by any other action (e.g. sending the alert data as a JSON payload via a webhook). ## Pre-requisites -- Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see http://www.net-snmp.org). +- Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see [net-snmp.org](http://www.net-snmp.org)). + - The provided MIB file ([**BMC-CONTROLMEM-MIB**](BMC-CONTROLMEM-MIB.txt)) must be loaded in the SNMP destination host. ## Instructions Before using the script, update the following variables: -- **destination** : define the SNMP destination host(s). Use commas (,) as delimiter for multiple hosts, and colon (:) to use a specific port (default port is 162). Example: +- **destination** : define the SNMP destination host(s). Use commas ( , ) as delimiter for multiple hosts, and colon ( : ) to use a specific port (default port is 162). Example: ``destination=myhost1,myhost2:2001,192.168.1.37`` - **alert_updates** : select whether you want to send or not updates of existing alerts (which happens when the alert "Status", "Urgency" or "Comment" are updated in Helix Control-M). -Do NOT modify the *base_oid* and *field_names* variables. +Do NOT modify the "*base_oid*" and "*field_names*" variables. ## Additional information -- The SNMP v1 trap definition in the "snmptrap" command line contains the community (*public*), the destination host, the enterprise-OID (as defined in the MIB file), the agent (IP address of the system generating the trap, empty to use the default value), the generic-trap number ("6" for traps defined in a custom MIB file), the specific-trap ("10" as defined in the MIB file for the TRAP-TYPE macro) and the sysUpTime of the generating application (empty to use the system generated value). +- The SNMP v1 trap definition in the "snmptrap" command line contains the `community` (*public*), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). -- The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific OID, the type ("s" for string) and the value. +- The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. -- The script sends in a SNMP trap all the alert fields received from Helix Control-M, including the "notes" field. Refer to the [**Alerts Template reference**](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. +- The script sends all the alert fields received from Helix Control-M in the SNMP trap, including the "*notes*" field. Refer to the [**Alerts Template reference**](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. -- The script uses the default alert field names for Helix Control-M. Therefore, it is NOT required to use a custom template to change the alert fields to their old names in Control-M (as explained in ["Changing Field Names After Migrating from Onpremises ControlM"](https://documents.bmc.com/supportu/API/Helix/en-US/Documentation/API_Services_RunServices_Alerts_Template_reference.htm#ChangingFieldNamesAfterMigratingfromOnpremisesControlM)). This means that Control-M users migrating to Helix Control-M can use the script without the need to modify the default alerts template. +- The script uses the default alert field names for Helix Control-M. Therefore, it is NOT required to use a custom template to change the alert fields to their old names in Control-M (as detailed in ["Changing Field Names After Migrating from Onpremises ControlM"](https://documents.bmc.com/supportu/API/Helix/en-US/Documentation/API_Services_RunServices_Alerts_Template_reference.htm#ChangingFieldNamesAfterMigratingfromOnpremisesControlM)). This means that Control-M users migrating to Helix Control-M can use the script without the need to modify the default alerts template. - This is an example of all the data generated in the SNMP v1 trap: -Message Type: Trap1Message + Message Type: Trap1Message Time Received: 04/02/2024 17:52:49 SNMP Version: One Origin Address/Port: 192.168.1.37:50775 From 3c467effd7185b63f08966ebeda5d1b11722c5e4 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:39:07 +0100 Subject: [PATCH 03/24] update link --- .../alerts_to_snmp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md index b60b993c..2702f684 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md @@ -6,7 +6,7 @@ As an example, the alert data is saved into a file, but this could be replaced b ## Pre-requisites -- Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see [net-snmp.org](http://www.net-snmp.org)). +- Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see [net-snmp.org](http://www.net-snmp.org){:target="_blank"}). - The provided MIB file ([**BMC-CONTROLMEM-MIB**](BMC-CONTROLMEM-MIB.txt)) must be loaded in the SNMP destination host. From 928bdccb2bb7bd420caa765aace0ea2179a686a2 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:40:03 +0100 Subject: [PATCH 04/24] link testing --- .../alerts_to_snmp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md index 2702f684..fa373508 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md @@ -6,7 +6,7 @@ As an example, the alert data is saved into a file, but this could be replaced b ## Pre-requisites -- Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see [net-snmp.org](http://www.net-snmp.org){:target="_blank"}). +- Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see [net-snmp.org](http://www.net-snmp.org/){:target="_blank"}). - The provided MIB file ([**BMC-CONTROLMEM-MIB**](BMC-CONTROLMEM-MIB.txt)) must be loaded in the SNMP destination host. From 1a92a45191839cc3db7615202b82f141f4509e57 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:41:36 +0100 Subject: [PATCH 05/24] updates --- .../alerts_to_snmp/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md index fa373508..867a240e 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md @@ -6,7 +6,7 @@ As an example, the alert data is saved into a file, but this could be replaced b ## Pre-requisites -- Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see [net-snmp.org](http://www.net-snmp.org/){:target="_blank"}). +- Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see [net-snmp.org](http://www.net-snmp.org/)). - The provided MIB file ([**BMC-CONTROLMEM-MIB**](BMC-CONTROLMEM-MIB.txt)) must be loaded in the SNMP destination host. @@ -16,7 +16,7 @@ Before using the script, update the following variables: - **destination** : define the SNMP destination host(s). Use commas ( , ) as delimiter for multiple hosts, and colon ( : ) to use a specific port (default port is 162). Example: - ``destination=myhost1,myhost2:2001,192.168.1.37`` + ``destination=myhost1,myhost2:2001,192.168.1.37`` - **alert_updates** : select whether you want to send or not updates of existing alerts (which happens when the alert "Status", "Urgency" or "Comment" are updated in Helix Control-M). From aa3d54f170d7f7ea14477c006dcac19aff97a686 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:49:27 +0100 Subject: [PATCH 06/24] updates --- .../alerts_to_snmp/README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md index 867a240e..514853f9 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md @@ -16,25 +16,24 @@ Before using the script, update the following variables: - **destination** : define the SNMP destination host(s). Use commas ( , ) as delimiter for multiple hosts, and colon ( : ) to use a specific port (default port is 162). Example: - ``destination=myhost1,myhost2:2001,192.168.1.37`` + ``destination=myhost1,myhost2:2001,192.168.1.37`` - **alert_updates** : select whether you want to send or not updates of existing alerts (which happens when the alert "Status", "Urgency" or "Comment" are updated in Helix Control-M). -Do NOT modify the "*base_oid*" and "*field_names*" variables. - ## Additional information - The SNMP v1 trap definition in the "snmptrap" command line contains the `community` (*public*), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). - The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. -- The script sends all the alert fields received from Helix Control-M in the SNMP trap, including the "*notes*" field. Refer to the [**Alerts Template reference**](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. +- The script sends all the alert fields received from Helix Control-M in the SNMP trap, including the "*notes*" field. Refer to the ["Alerts Template reference"](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. - The script uses the default alert field names for Helix Control-M. Therefore, it is NOT required to use a custom template to change the alert fields to their old names in Control-M (as detailed in ["Changing Field Names After Migrating from Onpremises ControlM"](https://documents.bmc.com/supportu/API/Helix/en-US/Documentation/API_Services_RunServices_Alerts_Template_reference.htm#ChangingFieldNamesAfterMigratingfromOnpremisesControlM)). This means that Control-M users migrating to Helix Control-M can use the script without the need to modify the default alerts template. - This is an example of all the data generated in the SNMP v1 trap: - Message Type: Trap1Message +``` +Message Type: Trap1Message Time Received: 04/02/2024 17:52:49 SNMP Version: One Origin Address/Port: 192.168.1.37:50775 @@ -66,11 +65,11 @@ Agent IP:192.168.182.60 Enterprise: 1.3.6.1.4.1.1031.9.1 Generic Trap: 6 Specific Trap: 10 - +``` XXX format `: : [...]`, as in the following example: -\ + The script parses the input data and converts it to JSON format, starting with the "*alertFields*" key and followed by an array containing all the alert fields and their corresponding values - as in the example below. This is the same JSON structure as the one received when connecting to the External Alerts service via a WebSocket client. { From 9fd8910e505863ed196cd686d578fc35031d5d23 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:54:47 +0100 Subject: [PATCH 07/24] updates --- .../alerts_to_snmp/README.md | 36 ++----------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md index 514853f9..6e824f01 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md @@ -22,7 +22,7 @@ Before using the script, update the following variables: ## Additional information -- The SNMP v1 trap definition in the "snmptrap" command line contains the `community` (*public*), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). +- The SNMP v1 trap definition in the "snmptrap" command line contains the `community` ("public"), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). - The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. @@ -32,7 +32,7 @@ Before using the script, update the following variables: - This is an example of all the data generated in the SNMP v1 trap: -``` + ``` Message Type: Trap1Message Time Received: 04/02/2024 17:52:49 SNMP Version: One @@ -65,39 +65,9 @@ Agent IP:192.168.182.60 Enterprise: 1.3.6.1.4.1.1031.9.1 Generic Trap: 6 Specific Trap: 10 -``` - + ``` XXX format `: : [...]`, as in the following example: - -The script parses the input data and converts it to JSON format, starting with the "*alertFields*" key and followed by an array containing all the alert fields and their corresponding values - as in the example below. This is the same JSON structure as the one received when connecting to the External Alerts service via a WebSocket client. - - { - "alertFields" : [ - {"eventType" : "I"}, - {"id" : "2193"}, - {"server" : "IN01"}, - {"fileName" : ""}, - {"runId" : "00q2e"}, - {"severity" : "V"}, - {"status" : "0"}, - {"time" : "20221126150057"}, - {"user" : ""}, - {"updateTime" : ""}, - {"message" : "Ended not OK"}, - {"runAs" : "ctmagent"}, - {"subApplication" : ""}, - {"application" : "my-demos"}, - {"jobName" : "my-sample-job"}, - {"host" : "zzz-linux-agent-1"}, - {"type" : "R"}, - {"closedByControlM" : ""}, - {"ticketNumber" : ""}, - {"runNo" : "00001"}, - {"notes" : ""} - ] - } - ## Versions | Date | Updated by | Changes | From 404561cc4d2610fa38a816ad6fe8e8a5d056dc4f Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:09:40 +0100 Subject: [PATCH 08/24] updates --- .../alerts_to_snmp/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md index 6e824f01..2631aa0f 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md @@ -1,8 +1,8 @@ ## Description -This shell script ([**alerts_to_snmp**](alerts_to_snmp.sh)) sends Helix Control-M alerts data as SNMP (v1) traps. +This shell script ([**alerts_to_snmp**](alerts_to_snmp.sh)) sends Helix Control-M alerts data as SNMP traps. -As an example, the alert data is saved into a file, but this could be replaced by any other action (e.g. sending the alert data as a JSON payload via a webhook). +It parses the alert data coming from Helix Control-M (via the External Alerts service) and sends it as a SNMP v1 trap. This can be useful for integration with any application which supports incoming SNMP traps, and especially for customers migrating from Control-M which were using its SNMP notification capabilities. ## Pre-requisites @@ -30,9 +30,9 @@ Before using the script, update the following variables: - The script uses the default alert field names for Helix Control-M. Therefore, it is NOT required to use a custom template to change the alert fields to their old names in Control-M (as detailed in ["Changing Field Names After Migrating from Onpremises ControlM"](https://documents.bmc.com/supportu/API/Helix/en-US/Documentation/API_Services_RunServices_Alerts_Template_reference.htm#ChangingFieldNamesAfterMigratingfromOnpremisesControlM)). This means that Control-M users migrating to Helix Control-M can use the script without the need to modify the default alerts template. -- This is an example of all the data generated in the SNMP v1 trap: +This is an example of all the data and details from the generated SNMP v1 trap: - ``` +``` Message Type: Trap1Message Time Received: 04/02/2024 17:52:49 SNMP Version: One @@ -65,8 +65,7 @@ Agent IP:192.168.182.60 Enterprise: 1.3.6.1.4.1.1031.9.1 Generic Trap: 6 Specific Trap: 10 - ``` -XXX format `: : [...]`, as in the following example: +``` ## Versions From cf5e56292d3ce2ba30bb1a54757438b2f83dc06e Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:10:47 +0100 Subject: [PATCH 09/24] dir name update --- .../{alerts_to_snmp => alerts-to-snmp}/BMC-CONTROLMEM-MIB.txt | 0 .../{alerts_to_snmp => alerts-to-snmp}/README.md | 0 .../{alerts_to_snmp => alerts-to-snmp}/alerts_to_snmp.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename helix-control-m/2-external-monitoring-tools-examples/{alerts_to_snmp => alerts-to-snmp}/BMC-CONTROLMEM-MIB.txt (100%) rename helix-control-m/2-external-monitoring-tools-examples/{alerts_to_snmp => alerts-to-snmp}/README.md (100%) rename helix-control-m/2-external-monitoring-tools-examples/{alerts_to_snmp => alerts-to-snmp}/alerts_to_snmp.sh (100%) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/BMC-CONTROLMEM-MIB.txt b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/BMC-CONTROLMEM-MIB.txt similarity index 100% rename from helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/BMC-CONTROLMEM-MIB.txt rename to helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/BMC-CONTROLMEM-MIB.txt diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md similarity index 100% rename from helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/README.md rename to helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/alerts_to_snmp.sh b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/alerts_to_snmp.sh similarity index 100% rename from helix-control-m/2-external-monitoring-tools-examples/alerts_to_snmp/alerts_to_snmp.sh rename to helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/alerts_to_snmp.sh From 4b7b7c6be6bec38a561f4595b39892a432bcd911 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:16:40 +0100 Subject: [PATCH 10/24] updates --- .../alerts-to-snmp/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index 2631aa0f..ed8fbff7 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -8,7 +8,7 @@ It parses the alert data coming from Helix Control-M (via the External Alerts se - Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see [net-snmp.org](http://www.net-snmp.org/)). -- The provided MIB file ([**BMC-CONTROLMEM-MIB**](BMC-CONTROLMEM-MIB.txt)) must be loaded in the SNMP destination host. +- The provided [**MIB file**](BMC-CONTROLMEM-MIB.txt) (BMC-CONTROLMEM-MIB.txt) must be loaded in the SNMP destination host. ## Instructions @@ -22,13 +22,15 @@ Before using the script, update the following variables: ## Additional information +- The script uses the default alert field names for Helix Control-M. Therefore, it is NOT required to use a custom template to change the alert fields to their old names in Control-M (as detailed in ["Changing Field Names After Migrating from Onpremises ControlM"](https://documents.bmc.com/supportu/API/Helix/en-US/Documentation/API_Services_RunServices_Alerts_Template_reference.htm#ChangingFieldNamesAfterMigratingfromOnpremisesControlM)). This means that Control-M users migrating to Helix Control-M can use the script without the need to modify the default alerts template. + - The SNMP v1 trap definition in the "snmptrap" command line contains the `community` ("public"), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). - The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. - The script sends all the alert fields received from Helix Control-M in the SNMP trap, including the "*notes*" field. Refer to the ["Alerts Template reference"](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. -- The script uses the default alert field names for Helix Control-M. Therefore, it is NOT required to use a custom template to change the alert fields to their old names in Control-M (as detailed in ["Changing Field Names After Migrating from Onpremises ControlM"](https://documents.bmc.com/supportu/API/Helix/en-US/Documentation/API_Services_RunServices_Alerts_Template_reference.htm#ChangingFieldNamesAfterMigratingfromOnpremisesControlM)). This means that Control-M users migrating to Helix Control-M can use the script without the need to modify the default alerts template. +\ This is an example of all the data and details from the generated SNMP v1 trap: @@ -37,7 +39,7 @@ Message Type: Trap1Message Time Received: 04/02/2024 17:52:49 SNMP Version: One Origin Address/Port: 192.168.1.37:50775 -Destination Address/Port: 192.168.1.37:161 +Destination Address/Port: 192.168.1.37:162 Community: public Variable IIDs and Values: 1.3.6.1.4.1.1031.9.1.1 (alertTrapUpdateType): I From 948582b42d7a1218e7271b670b21f2bff29fed33 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:28:44 +0100 Subject: [PATCH 11/24] updates --- .../alerts-to-snmp/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index ed8fbff7..c85b524f 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -6,7 +6,9 @@ It parses the alert data coming from Helix Control-M (via the External Alerts se ## Pre-requisites -- Requires the **snmptrap** command line utility, which comes included in the "net-snmp-utils" package (see [net-snmp.org](http://www.net-snmp.org/)). +- Requires the **snmptrap** command line utility, which comes included in the "*net-snmp-utils*" package (see [net-snmp.org](http://www.net-snmp.org/)). It must be installed with any dependent packages, i.e. with "yum" package manager: + + ``# yum install net-snmp-utils`` - The provided [**MIB file**](BMC-CONTROLMEM-MIB.txt) (BMC-CONTROLMEM-MIB.txt) must be loaded in the SNMP destination host. @@ -24,14 +26,13 @@ Before using the script, update the following variables: - The script uses the default alert field names for Helix Control-M. Therefore, it is NOT required to use a custom template to change the alert fields to their old names in Control-M (as detailed in ["Changing Field Names After Migrating from Onpremises ControlM"](https://documents.bmc.com/supportu/API/Helix/en-US/Documentation/API_Services_RunServices_Alerts_Template_reference.htm#ChangingFieldNamesAfterMigratingfromOnpremisesControlM)). This means that Control-M users migrating to Helix Control-M can use the script without the need to modify the default alerts template. +- The script sends all the alert fields received from Helix Control-M in the SNMP trap, including the "*notes*" field. Refer to the ["Alerts Template reference"](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. + - The SNMP v1 trap definition in the "snmptrap" command line contains the `community` ("public"), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). - The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. -- The script sends all the alert fields received from Helix Control-M in the SNMP trap, including the "*notes*" field. Refer to the ["Alerts Template reference"](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. - \ - This is an example of all the data and details from the generated SNMP v1 trap: ``` From f03d22dd61681cc16f3d5498f054e9f292f9d922 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:30:35 +0100 Subject: [PATCH 12/24] updates --- .../alerts-to-snmp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index c85b524f..f3470059 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -6,7 +6,7 @@ It parses the alert data coming from Helix Control-M (via the External Alerts se ## Pre-requisites -- Requires the **snmptrap** command line utility, which comes included in the "*net-snmp-utils*" package (see [net-snmp.org](http://www.net-snmp.org/)). It must be installed with any dependent packages, i.e. with "yum" package manager: +- Requires the **snmptrap** command line utility, which comes included in the "*net-snmp-utils*" package (see [net-snmp.org](http://www.net-snmp.org/)). As an example, to install it with "yum" package manager: ``# yum install net-snmp-utils`` From 32cf57522012ffba0d33a5318e571b1d73f72f1a Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:31:33 +0100 Subject: [PATCH 13/24] updates --- .../alerts-to-snmp/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index f3470059..53929498 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -10,6 +10,10 @@ It parses the alert data coming from Helix Control-M (via the External Alerts se ``# yum install net-snmp-utils`` +``` +# yum install net-snmp-utils +``` + - The provided [**MIB file**](BMC-CONTROLMEM-MIB.txt) (BMC-CONTROLMEM-MIB.txt) must be loaded in the SNMP destination host. ## Instructions From af7092c3c29b9217ecbb98a08f9d0fc7c6c4e454 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:32:57 +0100 Subject: [PATCH 14/24] updates --- .../alerts-to-snmp/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index 53929498..534fcf2f 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -8,11 +8,9 @@ It parses the alert data coming from Helix Control-M (via the External Alerts se - Requires the **snmptrap** command line utility, which comes included in the "*net-snmp-utils*" package (see [net-snmp.org](http://www.net-snmp.org/)). As an example, to install it with "yum" package manager: - ``# yum install net-snmp-utils`` - -``` -# yum install net-snmp-utils -``` + ``` + # yum install net-snmp-utils + ``` - The provided [**MIB file**](BMC-CONTROLMEM-MIB.txt) (BMC-CONTROLMEM-MIB.txt) must be loaded in the SNMP destination host. From d5b200badd0566242635bd1a4f6e3d58eddc155e Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:34:54 +0100 Subject: [PATCH 15/24] updates --- .../alerts-to-snmp/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index 534fcf2f..d7459cbb 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -18,9 +18,7 @@ It parses the alert data coming from Helix Control-M (via the External Alerts se Before using the script, update the following variables: -- **destination** : define the SNMP destination host(s). Use commas ( , ) as delimiter for multiple hosts, and colon ( : ) to use a specific port (default port is 162). Example: - - ``destination=myhost1,myhost2:2001,192.168.1.37`` +- **destination** : define the SNMP destination host(s). Use commas ( , ) as delimiter for multiple hosts, and colon ( : ) to use a specific port (default port is 162). Example: ``destination=myhost1,myhost2:2001,192.168.1.37`` - **alert_updates** : select whether you want to send or not updates of existing alerts (which happens when the alert "Status", "Urgency" or "Comment" are updated in Helix Control-M). @@ -37,7 +35,7 @@ Before using the script, update the following variables: \ This is an example of all the data and details from the generated SNMP v1 trap: -``` + ``` Message Type: Trap1Message Time Received: 04/02/2024 17:52:49 SNMP Version: One @@ -70,7 +68,7 @@ Agent IP:192.168.182.60 Enterprise: 1.3.6.1.4.1.1031.9.1 Generic Trap: 6 Specific Trap: 10 -``` + ``` ## Versions From c2e5f600194ad0ca300183bca1bdc49bb25f710f Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:37:29 +0100 Subject: [PATCH 16/24] updates --- .../alerts-to-snmp/README.md | 41 +++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index d7459cbb..7ebd54cb 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -6,7 +6,7 @@ It parses the alert data coming from Helix Control-M (via the External Alerts se ## Pre-requisites -- Requires the **snmptrap** command line utility, which comes included in the "*net-snmp-utils*" package (see [net-snmp.org](http://www.net-snmp.org/)). As an example, to install it with "yum" package manager: +- Requires the **snmptrap** command line utility, which comes included in the "*net-snmp-utils*" package (see [net-snmp.org](http://www.net-snmp.org/)). As an example, to install it with "yum" package manager (any other required packages are installed too): ``` # yum install net-snmp-utils @@ -33,9 +33,44 @@ Before using the script, update the following variables: - The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. \ -This is an example of all the data and details from the generated SNMP v1 trap: +- This is an example of all the data and details from the generated SNMP v1 trap: ``` + Message Type: Trap1Message + Time Received: 04/02/2024 17:52:49 + SNMP Version: One + Origin Address/Port: 192.168.1.37:50775 + Destination Address/Port: 192.168.1.37:162 + Community: public + Variable IIDs and Values: + 1.3.6.1.4.1.1031.9.1.1 (alertTrapUpdateType): I + 1.3.6.1.4.1.1031.9.1.2 (alertTrapAlertId): 25101 + 1.3.6.1.4.1.1031.9.1.3 (alertTrapControlM): IN01 + 1.3.6.1.4.1.1031.9.1.4 (alertTrapMemName): + 1.3.6.1.4.1.1031.9.1.5 (alertTrapOrderId): 0e4oe + 1.3.6.1.4.1.1031.9.1.6 (alertTrapSeverity): V + 1.3.6.1.4.1.1031.9.1.7 (alertTrapStatus): Not_Noticed + 1.3.6.1.4.1.1031.9.1.8 (alertTrapTime): 20240204165241 + 1.3.6.1.4.1.1031.9.1.9 (alertTrapUser): + 1.3.6.1.4.1.1031.9.1.10 (alertTrapUpdateTime): + 1.3.6.1.4.1.1031.9.1.11 (alertTrapMessage): Ended not OK + 1.3.6.1.4.1.1031.9.1.12 (alertTrapOwner): ctmagent + 1.3.6.1.4.1.1031.9.1.13 (alertTrapGroup): + 1.3.6.1.4.1.1031.9.1.14 (alertTrapApplication): dfe-demos + 1.3.6.1.4.1.1031.9.1.15 (alertTrapJobName): dfe-job-01 + 1.3.6.1.4.1.1031.9.1.16 (alertTrapNodeId): zzz-linux-agent-0 + 1.3.6.1.4.1.1031.9.1.17 (alertTrapType): R + 1.3.6.1.4.1.1031.9.1.18 (alertTrapClosedFromEM): + 1.3.6.1.4.1.1031.9.1.19 (alertTrapTicketNumber): + 1.3.6.1.4.1.1031.9.1.20 (alertTrapRunCounter): 00001 + 1.3.6.1.4.1.1031.9.1.21 (alertTrapNotes): + Agent IP:192.168.182.60 + Enterprise: 1.3.6.1.4.1.1031.9.1 + Generic Trap: 6 + Specific Trap: 10 + ``` + +``` Message Type: Trap1Message Time Received: 04/02/2024 17:52:49 SNMP Version: One @@ -68,7 +103,7 @@ Agent IP:192.168.182.60 Enterprise: 1.3.6.1.4.1.1031.9.1 Generic Trap: 6 Specific Trap: 10 - ``` +``` ## Versions From 686a6bd9ecf15a99554870ccace7236c6a99cef0 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:38:35 +0100 Subject: [PATCH 17/24] updates --- .../alerts-to-snmp/README.md | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index 7ebd54cb..70a73a01 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -32,7 +32,6 @@ Before using the script, update the following variables: - The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. -\ - This is an example of all the data and details from the generated SNMP v1 trap: ``` @@ -70,41 +69,6 @@ Before using the script, update the following variables: Specific Trap: 10 ``` -``` -Message Type: Trap1Message -Time Received: 04/02/2024 17:52:49 -SNMP Version: One -Origin Address/Port: 192.168.1.37:50775 -Destination Address/Port: 192.168.1.37:162 -Community: public -Variable IIDs and Values: - 1.3.6.1.4.1.1031.9.1.1 (alertTrapUpdateType): I - 1.3.6.1.4.1.1031.9.1.2 (alertTrapAlertId): 25101 - 1.3.6.1.4.1.1031.9.1.3 (alertTrapControlM): IN01 - 1.3.6.1.4.1.1031.9.1.4 (alertTrapMemName): - 1.3.6.1.4.1.1031.9.1.5 (alertTrapOrderId): 0e4oe - 1.3.6.1.4.1.1031.9.1.6 (alertTrapSeverity): V - 1.3.6.1.4.1.1031.9.1.7 (alertTrapStatus): Not_Noticed - 1.3.6.1.4.1.1031.9.1.8 (alertTrapTime): 20240204165241 - 1.3.6.1.4.1.1031.9.1.9 (alertTrapUser): - 1.3.6.1.4.1.1031.9.1.10 (alertTrapUpdateTime): - 1.3.6.1.4.1.1031.9.1.11 (alertTrapMessage): Ended not OK - 1.3.6.1.4.1.1031.9.1.12 (alertTrapOwner): ctmagent - 1.3.6.1.4.1.1031.9.1.13 (alertTrapGroup): - 1.3.6.1.4.1.1031.9.1.14 (alertTrapApplication): dfe-demos - 1.3.6.1.4.1.1031.9.1.15 (alertTrapJobName): dfe-job-01 - 1.3.6.1.4.1.1031.9.1.16 (alertTrapNodeId): zzz-linux-agent-0 - 1.3.6.1.4.1.1031.9.1.17 (alertTrapType): R - 1.3.6.1.4.1.1031.9.1.18 (alertTrapClosedFromEM): - 1.3.6.1.4.1.1031.9.1.19 (alertTrapTicketNumber): - 1.3.6.1.4.1.1031.9.1.20 (alertTrapRunCounter): 00001 - 1.3.6.1.4.1.1031.9.1.21 (alertTrapNotes): -Agent IP:192.168.182.60 -Enterprise: 1.3.6.1.4.1.1031.9.1 -Generic Trap: 6 -Specific Trap: 10 -``` - ## Versions | Date | Updated by | Changes | From 04b6edf7108f45f449e003ba707fa4061f486fde Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:44:50 +0100 Subject: [PATCH 18/24] version 1.0 --- .../alerts-to-snmp/README.md | 2 +- .../alerts-to-snmp/alerts_to_snmp.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index 70a73a01..982529a0 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -73,4 +73,4 @@ Before using the script, update the following variables: | Date | Updated by | Changes | | - | - | - | -| 2024-02-04 | David Fernández | First release | +| 2024-02-05 | David Fernández | First release | diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/alerts_to_snmp.sh b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/alerts_to_snmp.sh index 48368fd6..19af0f8c 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/alerts_to_snmp.sh +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/alerts_to_snmp.sh @@ -5,7 +5,7 @@ # Sends Helix Control-M alerts as SNMP (v1) traps # # Author : David Fernandez (david_fernandez@bmc.com) -# Version : 0.4 (04/02/2024) +# Version : 1.0 (05/02/2024) # # Notes : - Requires "snmptrap" (from "net-snmp-utils" package - see http://www.net-snmp.org) # - The MIB file (BMC-CONTROLMEM-MIB) must be loaded in the SNMP destination host From 519e7fcd1ae8d7cac1361287779d7fdff0d621ec Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:46:58 +0100 Subject: [PATCH 19/24] fix readme --- .../alerts-to-snmp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index 982529a0..9f6c93ce 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -24,7 +24,7 @@ Before using the script, update the following variables: ## Additional information -- The script uses the default alert field names for Helix Control-M. Therefore, it is NOT required to use a custom template to change the alert fields to their old names in Control-M (as detailed in ["Changing Field Names After Migrating from Onpremises ControlM"](https://documents.bmc.com/supportu/API/Helix/en-US/Documentation/API_Services_RunServices_Alerts_Template_reference.htm#ChangingFieldNamesAfterMigratingfromOnpremisesControlM)). This means that Control-M users migrating to Helix Control-M can use the script without the need to modify the default alerts template. +- The script uses the default alert field names for Helix Control-M. Therefore, it is NOT required to use a custom template to change the alert fields to their old names in Control-M (as detailed in ["Changing Field Names After Migrating from On-premises Control-M"](https://documents.bmc.com/supportu/API/Helix/en-US/Documentation/API_Services_RunServices_Alerts_Template_reference.htm#ChangingFieldNamesAfterMigratingfromOnpremisesControlM)). This means that Control-M users migrating to Helix Control-M can use the script without the need to modify the default alerts template. - The script sends all the alert fields received from Helix Control-M in the SNMP trap, including the "*notes*" field. Refer to the ["Alerts Template reference"](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. From 5d9c5d932128189af2888801cd9d3218f0660e08 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:53:47 +0100 Subject: [PATCH 20/24] updates --- .../alerts-to-snmp/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index 9f6c93ce..a4afcf9e 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -32,6 +32,12 @@ Before using the script, update the following variables: - The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. +- This is an example of the "snmptrap" command line created by the script (showing only the first 2 alert fields - out of 21): + + ``` + snmptrap -v 1 -c public mysnmphost 1.3.6.1.4.1.1031.9.1 '' 6 10 '' 1.3.6.1.4.1.1031.9.1.1 s I 1.3.6.1.4.1.1031.9.1.2 s 25101 [...] + ``` + - This is an example of all the data and details from the generated SNMP v1 trap: ``` From 31350cdd14639fbb6c6a7678866f77f2d8659d2f Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:56:48 +0100 Subject: [PATCH 21/24] updates --- .../alerts-to-snmp/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index a4afcf9e..34dbe6c5 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -28,8 +28,6 @@ Before using the script, update the following variables: - The script sends all the alert fields received from Helix Control-M in the SNMP trap, including the "*notes*" field. Refer to the ["Alerts Template reference"](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. -- The SNMP v1 trap definition in the "snmptrap" command line contains the `community` ("public"), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). - - The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. - This is an example of the "snmptrap" command line created by the script (showing only the first 2 alert fields - out of 21): @@ -38,6 +36,8 @@ Before using the script, update the following variables: snmptrap -v 1 -c public mysnmphost 1.3.6.1.4.1.1031.9.1 '' 6 10 '' 1.3.6.1.4.1.1031.9.1.1 s I 1.3.6.1.4.1.1031.9.1.2 s 25101 [...] ``` + - The SNMP v1 trap definition in the "snmptrap" command line contains the `community` ("public"), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). + - This is an example of all the data and details from the generated SNMP v1 trap: ``` From 32dbbda2de6939d43ddb3068ea533385a545f218 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:57:50 +0100 Subject: [PATCH 22/24] updates --- .../alerts-to-snmp/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index 34dbe6c5..81484423 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -28,8 +28,6 @@ Before using the script, update the following variables: - The script sends all the alert fields received from Helix Control-M in the SNMP trap, including the "*notes*" field. Refer to the ["Alerts Template reference"](https://docs.bmc.com/docs/saas-api/alerts-template-reference-1144242602.html)) for more details. -- The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. - - This is an example of the "snmptrap" command line created by the script (showing only the first 2 alert fields - out of 21): ``` @@ -38,6 +36,8 @@ Before using the script, update the following variables: - The SNMP v1 trap definition in the "snmptrap" command line contains the `community` ("public"), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). + - The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. + - This is an example of all the data and details from the generated SNMP v1 trap: ``` From e0f584db289c82b07a99e09dc4bc5937f9b80d4d Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Mon, 5 Feb 2024 02:01:17 +0100 Subject: [PATCH 23/24] updates --- .../alerts-to-snmp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md index 81484423..f39ba5c1 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/README.md @@ -34,7 +34,7 @@ Before using the script, update the following variables: snmptrap -v 1 -c public mysnmphost 1.3.6.1.4.1.1031.9.1 '' 6 10 '' 1.3.6.1.4.1.1031.9.1.1 s I 1.3.6.1.4.1.1031.9.1.2 s 25101 [...] ``` - - The SNMP v1 trap definition in the "snmptrap" command line contains the `community` ("public"), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). + - The SNMP v1 trap definition contains the `community` ("public"), the destination `host`, the `enterprise-OID` (as defined in the MIB file), the `agent` (IP address of the system generating the trap, empty to use the default value), the `generic-trap` number ("6" for traps defined in a custom MIB file), the `specific-trap` ("10" as defined in the MIB file for the TRAP-TYPE macro) and the `sysUpTime` of the generating application (empty to use the system generated value). - The "snmptrap" command line is then completed by adding all the alert fields, passed as the payload of the trap. Each of them include the specific `OID`, the `type` ("s" for string) and the `value`. From 2a76dbf64476fe606a5fa13342ad0467df3d81b6 Mon Sep 17 00:00:00 2001 From: davidctm <77340645+davidctm@users.noreply.github.com> Date: Tue, 30 Apr 2024 14:51:10 +0200 Subject: [PATCH 24/24] Update alerts_to_snmp.sh --- .../alerts-to-snmp/alerts_to_snmp.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/alerts_to_snmp.sh b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/alerts_to_snmp.sh index 19af0f8c..352027c7 100644 --- a/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/alerts_to_snmp.sh +++ b/helix-control-m/2-external-monitoring-tools-examples/alerts-to-snmp/alerts_to_snmp.sh @@ -4,9 +4,6 @@ # # Sends Helix Control-M alerts as SNMP (v1) traps # -# Author : David Fernandez (david_fernandez@bmc.com) -# Version : 1.0 (05/02/2024) -# # Notes : - Requires "snmptrap" (from "net-snmp-utils" package - see http://www.net-snmp.org) # - The MIB file (BMC-CONTROLMEM-MIB) must be loaded in the SNMP destination host #