BATMN is a tool used to send alerts to Shell Event Management (formerly OneBSM, currently Moogsoft AIOps Enterprise). It can be configured to automatically create a ServiceNow incident ticket, or trigger a notification in SNS, or both, or neither - user's choice. It is important to note that submitted values are not validated by BATMN. So make sure that configuration items, assignment groups or SNS distribution lists are correct!
C:\Program Files (x86)\Shell\BATMN\BATMN.exe {options}
perl /opt/shell/BATMN/batmn.pl {options}
Option Code | Name | Mandatory | Notes |
---|---|---|---|
-a {Class}
|
Class | Yes |
Moogsoft field: Valid Options
|
-n {Environment}
|
Environment | Yes |
Valid Options
public and pubdev options send to the same Moogsoft environments as prod and test respectively,
but are designed for senders that are NOT on the Shell internal network (e.g. public cloud deployments).
|
-m "Message Text"
|
Description |
Yes (SHELL_AP) No (SHELL_EV) |
Moogsoft field: |
-p
|
Use Proxy | No |
Only applies when using |
-h or -?
|
Help | No | Show help message and exit without sending any event. |
SHELL_AP Options | |||
-b "NotifyGroup={SNS Group1;...;SNS Groupn}"
|
SNS Recipient | Yes |
Moogsoft field: |
SHELL_EV Options | |||
-r {Severity}
|
Severity | No |
Moogsoft field: If this option is not set, the resulting alert will have a severity level of Indeterminate in Moogsoft - we recommend explicitly setting this value Valid Options
|
-i
|
Get Information | No |
Invokes BATSIGNL after sending the alert and will return alert, situation and incident ticket information in the form of a JSON string.
Important: While this is not enforced, it is essential that the This option will cause BATMN to wait for up to 2 minutes until BATSIGNL has completed its work |
SHELL_EV -b Options Options must be specified in the form of Option1=Value1;Option2=Value2;
|
|||
Asset={Configuration Item}
|
ServiceNow Configuration Item | No |
Moogsoft field: Used as part of the event signature The |
Element={Configuration Item}
|
ServiceNow Configuration Item | No |
Moogsoft field: Used as part of the event signature The |
Assignment={ServiceNow Assignment Group}
|
ServiceNow Assignment Group | No |
Moogsoft field: Used as part of the event signature Required if a ServiceNow incident ticket is desired Will assign a ServiceNow incident ticket to the specified group. The Assignment Group specified is not validated, and if invalid may result in no incident ticket created. |
ExternalId={String}
|
External ID Reference | No |
Moogsoft field: Used as a reference value known to the caller - particularly useful if one wants to keep track of alert information |
NotifyGroup={SNS Group1;...;SNSGroupn}
|
SNS Distribution List | No |
Moogsoft field: |
SourceRule={String}
|
Event Source Rule | No |
Moogsoft field: Used as part of the event signature Used as part of the event description if no description is provided |
ElementState={String}
|
Element State | No |
Moogsoft field: Used as part of the event description if no description is provided |
StateValue={String}
|
State Value | No |
Moogsoft field: Used as part of the event description if no description is provided |
Priority={String}
|
Priority | No |
Moogsoft field: |
URL={String}
|
URL | No |
Moogsoft field: |
OriginId={String}
|
URL | No |
Moogsoft field: |
CF3={String}
|
CF3 | No |
Moogsoft field: |
Cause={String}
|
Cause | No |
Moogsoft field: |
Description={String}
|
Long Description | No |
Moogsoft field: |
All others | Extra Info | No |
Moogsoft field: |
BATSIGNL is a tool used to find and update alerts in the Shell Event Management (formerly OneBSM, currently Moogsoft AIOps Enterprise). If an incident ticket is associated to a Moogsoft alert or situation, it can also be found and updated (via the Moogsoft situation to ServiceNow incident ticket synchronization API).
C:\Program Files (x86)\Shell\BATMN\BATSIGNL.exe {options}
perl /opt/shell/BATMN/batsignl.pl {options}
Option Code | Name | Mandatory | Notes |
---|---|---|---|
-n {Environment}
|
Environment | Yes |
Valid Options
public and pubdev options send to the same Moogsoft environments as prod and test respectively,
but are designed for senders that are NOT on the Shell internal network (e.g. public cloud deployments).
|
-m {Mode}
|
Mode | Yes |
Valid Options
|
-a {AlertID (numeric)} -s {SituationID (numeric)} -e {ExternalID} -i {IncidentTicket}
|
Search Criteria | No | One can use multiple search criteria on the same read or update request if desired. The data returned is the combined result of each individual search. |
-t "Text Message"
|
Message | No |
Only applicable in update mode Will use the message specified in the collaboration thread entry |
-f {File Path}
|
Add File Contents | No |
Only applicable in update mode Will append the contents of the specified file to the collaboration thread entry |
-h or -?
|
Help | No | Show help message and exit without doing any work. |
-x
|
Resolving Step | No |
Only applicable in update mode Will mark the collaboration thread entry as a resolving step in Moogsoft and will be noted as such for future similar situations. This will also mark the content of the thread entry as the incident ticket resolution in ServiceNow, if applicable. |
-w {Timeout}
|
Timeout | No |
Only applicable in read mode In read mode, BATSIGNL will wait until the search returns either an incident ticket or a reason why it wasn't. This limits how long BATSIGNL will keep checking, and will return whatever it has available once the timeout expires.Default value is 120 seconds |
-v
|
Verbose | No | Returns detailed logging which could be useful for troubleshooting purposes. Please note that this option may interfere with the normal operation of tools/scripts that read the output of BATSIGNL. |
In read mode, BATSIGNL returns a JSON string which contains the following elements
Element | Data Type | Notes |
---|---|---|
alert_info
|
Array of integers | List of all alert IDs that are associated with the search criteria |
situation_info
|
Array of integers | List of all Moogsoft situation IDs that are associated with the search criteria |
incident_info
|
Array of strings | List of all ServiceNow Incident Tickets that are associated with the search criteria |
messages
|
Array of strings | Usually at least one message describing if the access key was successfully verified. If multiple search criteria are used there will be messages related to this. |
query_field
query_op
query_value
|
String |
Contains the first processed search criterion. If multiple criteria are submitted, the others will be listed in the messages area.
|
incident_errors
|
Array of Objects |
This contains the list of alerts which did not qualify to create a ServiceNow ticket. Each entry is an object with the following fields:
|
Here are some typical use cases for BATMN:
Trigger an alert which will generate a ServiceNow ticket for Server, waits for the incident ticket to be created. Note that BATMN automatically generates an external ID value which allows its retrieval by BATSIGNL.
perl batmn.pl -n test -a SHELL_EV -b "Element=amsdc1-s-#####.europe.shell.com;Assignment=MyTeamAssignment" -r MAJOR -i
{"messages":["Registration Checked Successfully"],"alert_info":["960508"],"incident_errors":[],"incident_info":["INC0124381"],"query_field":"external_id","query_value":"1894319-gmorepo1.sga-res.com:1625177031","query_op":"=","situation_info":["286332"]}
If one wants to inquire about a potential ServiceNow incident ticket without using the -i
option in BATMN, it is recommended to set the ExternalID -b option field with a known unique value
perl batmn.pl -n test -a SHELL_EV -b "externalid=THISISASPECIALTestIdJustForYou;Asset=Shell Availability Engine UAT" -r MAJOR
perl batsignl.pl -n test -m read -e "THISISASPECIALTestIdJustForYou"
{"messages":["Registration Checked Successfully"],"alert_info":["960505"],"incident_errors":[{"ci":"Shell Availability Engine UAT","reason":"Sev[3] Cls[SHELL_EV] Mgr[BATMN] Src[] AG[]","alert_id":960505}],"incident_info":[],"query_field":"external_id","query_value":"THISISASPECIALTestIdJustForYou","query_op":"=","situation_info":["286330"]}
BATMN will return JSON containing the alert, situation and incident ticket information. See the documentation for BATSIGNL for more details.