Skip to content

SMS alerts not working

SMS alerts not working in SMS.

4 min read Updated SS RS

SMS alerts not working#

Case 1: Property file Issue#

The error is as below in A1EH (A1 Event Handler) logs:

2023-09-04 17:51:08.151 [a1-event-handler-msg-thread 0] ERROR
c.a.a.p.notificationsink.Notifier:118 - SMS could not sent for account id 'IT-
Payments', name 'EarlyWarning Open'
IMB logs
2023-09-04 11:46:04 - INFO c.a.a.i.b.util.CacheScheduledService - Incident creation
is disabled.
2023-09-04 11:46:04 - INFO c.a.a.incident.broker.util.ETLCache - Update external
details cache method is called.
2023-09-04 11:46:04 - TRACE c.a.a.incident.broker.util.ETLCache -
updateExternalConfigurations() method is called
2023-09-04 11:46:04 - ERROR c.a.a.i.broker.util.MySqlService - Error while parsing the
external configuration data. ExternalConfig{value='<password>', name='itsm.password',
valueType=Encrypted}
java.lang.IllegalArgumentException: Illegal base64 character 40

Solution:

Change the sender_id in properties file, the SMS alerts starts working.

Case 2: Instance Issues#

The SMS alerts were not generating for the URL availability.

Solution:

Multiple instances were configured for the host. After removing the extra instances, the issue was resolved.

Case 3: Error Log Analysis#

  1. A1EH Logs:
    1. Timestamp: 2023-09-04 17:51:08.151
    2. Error noted: SMS could not be sent for account id 'Sample-Account', name 'Early Warning Open'.
  2. IMB Logs:
    1. Timestamps: 2023-09-04 11:46:04
    2. Logs indicate:
      • Incident creation disabled.
      • External details cache being updated.
      • Error in parsing external configuration data with a specific base64 character issue in the 'itsm.password'.

Solution:

  1. The issue was traced back to a change in the sender_id used for sending SMS alerts. This change was made by the end user without prior notification to the Product Development (PD) team.
  2. After updating the new sender_id in the properties file, the SMS alerts resumed functioning properly.

Trim SMS Template Variables to Max 30 Characters for Success#

If the value in variables exceeds 30 characters as per the rules and regulation/guidelines for SMS Triggering at Bank Side, so values in variables must be trimmed to 30 characters if exceeded and then need to push for SMS Alert.

If variable length does not exceeds 30 SMS are getting triggered and delivered but if it exceeds SMS are getting triggered from our end but does not gets delivered as SMS Template fails.

Solution:

Update the given sms-preprocessing-groovy file in conf folder in Incident broke.

Map<String, String> preProcessing(Map<String, String> bind) {
  Map<String, String> map = [:]
  map.putAll(bind)
  map.put("MobileNumber", bind.getOrDefault("MobileNumber", "").replace("'", ""))
  String msg = bind.getOrDefault("MessageContent", "").replace("Lower Threshold:",
"Lower:").replace("Upper Threshold:", "Upper:")
  msg = getExtractedMessage(msg, "KPI_Name:", "Threshold:", 30)
  msg = getExtractedMessage(msg, "Instance_Name:", "KPI_Name:", 30)
  map.put("MessageContent", msg)
  map
}
String getExtractedMessage(def msg, def propertyName, def nextProperty, def maxLength)
{
  def start = msg.indexOf(propertyName)
  def end = msg.indexOf(nextProperty)

  def currentValue = msg.substring(start+propertyName.length(), end-2)
  def newValue = (currentValue.length() > maxLength) ?currentValue.substring(0,
maxLength-1):currentValue
  def updatedMsg = msg.replace(currentValue, newValue)
  updatedMsg
}

Enable SMS Via ACL#

Json file as below:

URL: https://push3.aclgateway.com/v1/enterprises/messages.json
o Header
Content-type: application/JSON
o Body
{
    "appid": "SENDERID",
    "userId": "SENDERID",
    "pass": "<<Password>>",
    "contenttype": "1",
    "from": "<<Header>>",
    "to": "<<Mobile number>>",
    "alert": "1",
    "selfid": "true",
    "dlrreq": "true",
    "S": "1",
    "dpi":"<<PE ID>>",
    "dtm": "<<DLT Temp ID>>",
    "tc":"<<DLT Temp category>>",
    "auth":"<<Internal Dept Name>>"
    "text": "Test Msg"
}

URL: https://push3.aclgateway.com/v1/enterprises/messages.json
o Header
Content-type: application/JSON
o Body
{
    "appid": "SENDERID",
    "userId": "SENDERID",
    "pass": "<<Password>>",
    "contenttype": "1",
    "from": "<<Header>>",
    "to": "<<Mobile number>>",
    "alert": "1",
    "selfid": "true",
    "dlrreq": "true",
    "s": "1",
    "auth":"<<Internal Dept Name>>"
    "text": "Test Msg"
}

Solution: Below consul keys needs to be changed:

service/incident-management-broker/sms_gateway_headers:Content-Type@@ application/json
service/incident-management-
broker/sms_gateway_url:https://push3.aclgateway.com/v1/enterprises/messages.json

Null sms-preprocessing.groovy and sms-postprocessing.groovy files

  1. Change the sms-post-data.template as payload given
  2. Add the below in incident-management-broker.nomad file "push3.aclgateway.com:192.0.2.43",
  3. Add the below in /etc/hosts 192.0.2.43 push3.aclgateway.com
  4. Import the certificate in cacert as we were facing cert error (aclgatewaycom.cer given by ACL vendor)
/opt/JAVA_LINUX/bin/keytool -import -trustcacerts -keystore
/opt/appnomic/Appsone_Service/data/cert/cacerts -storepass changeit -noprompt -alias
acl_gatewaycom_cer_file -file aclgatewaycom.cer

SMS Service Issue Post Upgrade#

Following an upgrade from Heal 1x to Heal 2x, the SMS service became non-functional.

RCA: Error logs from the IMB (Incident Management Broker) indicated a failure in SMS data posting to the server, with a `403 Unauthorized` response received:

ERROR c.a.a.i.broker.sink.WebserviceSink - SMS posted data on server, received
response code: 403, body: <solace-error-response>...

Solution: The issue was due to a mismatch in the consul key value for `service/incident-management-broker/sms_gateway_headers`. After decoding the base64 password, it was found to be incorrect.

The resolution involved clearing the existing container, restarting the IMB, and updating `IMB conf.properties` with the correct password. This resolved the SMS service issue.

SMS Alerts Issue in Heal 2.3.0#

Error while posting SMS alerts:

java.lang.IllegalArgumentException: Illegal base64 character 22

Solution:

Updated the external_configurations table's value field to NULL.

Next — Alerting depends on the detection and delivery pipeline, so continue with Event Detector Issues, Redis Issues and Data Receiver Issues, or return to the Troubleshooting Overview.