Alert Configuration Example in PI/PO Single Stack

Article is a guide on Alert configuration in Process Integration (PI) single stack installation or Process Orchestration (PO) with an step by step example. Before we jump to configuration steps and example, first we will try to understand the architecture of SAP message alerting framework.

SAP replaced the Netweaver Alert Framework which was included until Netweaver release 7.30 with a newer mechanism called Component-Based Message Alerting (CBMA).

To understand the CBMA, let’s first look at what the main features of an alert framework should be.

 

Alert Framework Features:

  1. It should have capabilities to create custom Alert Rules as per business needs.
  2. Ability to identify and collect errors, warnings and other alert messages which are generated in the system.
  3. Functionalities to distribute the identified alerts to selected parties.

 

CBMA Alert Framework Components:

SAP Component Based Message Alerting (CBMA) framework consists of three main components to facilitates the three features above.

  • Central Configuration for Alerts:

Users or IT team can configure Alert Rules and consumers as per their requirement either using Integration Directory (ID) or Netweaver Administrator.

  • Alert Engine:

Local Alert Engines are included in each runtime environment of Integration Engine (IE) and Advance Adapter Engine (AAE) of SAP PI/PO. Alert engine reads the alert event store (PI/PO message error information) and generates alerts if a matching Alert Rule is found for the generated error type. Then it updates the consumer Alert Store defined in the Alert Rule.

  • Alert Consumer:

Consumers receive alerts, generate notifications via SMS, e-mail, etc. Alert Consumer extracts the alerts from respective Alert Store and sends notifications. SAP Solution Manager is a special Alert Consumer with capabilities to process generated alerts and push them to alert inbox.

 

Alert Runtime Process Overview:

When an error occurs in a runtime of a PI message, it adds an error status to the message. When Alert Engine receives this error information or alert events from PI runtime, it checks for matching Alert Rules and configuration to decide if an alert should be generated or not. Alert generation depends on the error status and runtime component configuration of the Alert Rule.

Generated alerts contain information such as error event information, Alert Rule ID, timestamp, etc. Each alert consumer has separate Alert Stores. Alert Engine places created alerts in corresponding consumer Alert Stores. Finally, Alert Consumers retrieve the alerts from the local consumer Alert Store to be distributed to the end users.

 

  • Alert Design Time Process Overview:

Alert configuration Design Time process overview
Alert configuration Design Time process overview

 

  • Alert Runtime Process Overview:

alert-runtime-process-overview-cbma-pi-po
Alert Runtime process overview

 

Step by Step Alert Configuration Example:

Let’s look at a simple e-mail notification configuration step by step. We will send an email notification to an end user on errors that occur in an integration configuration.

 

Step 1: Create Alert Rules.

Alert Rules can be created in either in Integration Directory (ID) or Netweaver Administrator. To create Alert Rules centrally using Netweaver administrator, go to Monitoring home > Configuration and Administration > Message Alert Rule Configuration. Otherwise, create them in ID as below.

create-alert-rule-integration-directory-pi-po
Create Alert Rule in Integration Directory (ID)

 

Step 2: Configure Types of Objects to be Considered for Alert Rule.

You can specify interface related objects such as Integrated Configuration Object (ICO), Configuration Scenario, Communication Component etc. If you select either ICO or configuration scenario, alerts get generated for errors that occur in any stage of message processing pipeline and for all interface components included in ICO.

Set Alert rule type and enable the Alert Rule.

configure-alert-rule-assign-interface-objects
Add interface objects and configure Alert Rule

 

Step 3: Configure Error Sources and Alert Consumer.

Select Error Sources for which the alerts should be generated. Check of uncheck the Error Sources in the the extended tab of the Alert Rule configuration. You can configure alerts to be generated based on either errors which take place in different adapters or other runtime errors such as message mapping.

Include the consumer name where the generated alerts should be placed. This defines the local consumer Alert Store where the alerts generated under this Alert Rule would be placed. Since our aim is to send the alert as an email, let’s include consumer as ALERT-TO-MAIL.

configure-alert-rule-assign-error-types-pi-po
Configure Alert Rule and assign error types and consumer

If you have a requirement to segregate the alerts and send them to multiple users, for example, separation of alerts on a SAP functional area basis, create different consumers which represent each functional area and assign them the correct interfaces in the Alert Rule.

Example:

  • ALERT-TO-MAIL-OTC: Assign Interface Runtime Components of Order to Cash (OTC) functional area to this Alert Rule and Consumer.
  • ALERT-TO-MAIL-P2P: Assign interface Runtime Components of Purchase to Pay (P2P) functional area to this Alert Rule and Consumer.

 

Step 4: Configure Java Mail Client.

This is a one time activity and BASIS team usually creates a default mail client in post installation steps.

But if you need to create one you can do it by maintaining basic settings such as,

  • mail.from
  • mail.smtp.host
  • mail.smtp.password
  • mail.smtp.user.

 

Step 5: Create the Task which Sends Emails Using the Java Mail Client Created in Step 4.

Go to NWA > Operations > Jobs > Java Scheduler > Task and add a new task.

na-java-scheduler-alert-consumer-task-pi-po
Go to NWA Java Scheduler

 

Select consumer job “AddConsumerAlert” or “AlertConsumerJobV2” and set a suitable name for the task. AlertConsumerJobV2 is an updated version of the job and it has more parameters in comparison with the previous version. For example, you can configure email template and set the location of the email template file as a parameter.

Job definition and parameters can be viewed from the Job Definition tab.

Follow the Java Scheduler Task creation configuration wizard.

create-consumer-alert-task-netweaver-administrator
Create alert consumer task in Netweaver Administrator

 

Then configure the properties and details of the task. Configure consumer as “ALERT-TO-MAIL” and emailTo as the email address of the user who should receive the notification.

configure-alert-consumer-task
Configure alert consumer task. Set consumer, Mail From, Mail To

 

Set the start time and the frequency of the job. I have set the frequency as every 5 minutes.

set-configure-alert-consumer-task-start-time-frequence
Set frequency of the alert consumer task

 

Result:

I stopped the receiver file channel of the Integration Scenario to create couple of messages with errors.

error-message-event-alerts-pi-po
message monitor error message

 

message-error-event-detail-alerts-pi-po
Message error detail

 

Go to Java Scheduler > Jobs and find the Consumer Job you created. You can find the number of alerts consumed by the AlertConsumer task in the task log.

alert-consumer-java-job-pi-po
Alert consumer java job has consumed the 2 Alerts generated

If you need any clarifications on steps described here, please do not hesitate to leave a comment below.

TECH GADGETS I USE EVERY DAY

These are some of the tech gadgets I use every day. If you make a purchase through these links I will earn a small comission at absolutely no extra cost to you.

31 thoughts on “Alert Configuration Example in PI/PO Single Stack

  1. gurudatta says:

    HI,
    How can i Transport the Alert consumer group
    for ex:for speciific interface i have created ALERT-TO-TEST as a consumer..how do i transport this from DEV–QUALITY?

  2. Vivek says:

    Hi ,

    I have configured Alerts through Component Based Alert Monitoring(CBMA). But neither any logs can be seen nor any alert is getting triggered. Please help.

  3. Shashidhar says:

    It means no need solman to monitor ?

    We are getting multiple front end response time and schedule job alerts for sap pi in solman 7.2

    Suggest me to provide the solution for fixing these issues.

  4. sirisha says:

    hello Shashidhar,

    Your blogs are very informative. Thank you.
    I have a doubt regarding CBMA mechanism which we do in SAP PO system.Can you please let me know what settings we need to do in task creation , so that i will receive only 1 alert for 1 failed message. Is there any settings that i should do while creating alert rule in NWA/ID.
    Thanks,
    Sirisha.

  5. Varun says:

    Hi Isuru,
    Thanks for the detailed blog.
    We are using SAP PI 7.11 and in our scenario we pull the data from SQL tables on sender side. The details related to SQL connection , SQL queries etc . are set in sender communication channel. Can we use SAP PI Alert mechanism in our scenario ? For instance if SQL server is not available or is down then PI will not be able to pull data. So is in this case we can use PI alert mechanism and if yes how it can be done?.

    Thanks in Advance.

    Regards,

    Varun

  6. mayank yadav says:

    Hi Isuru ,

    How can I ensure that Alerts generated by known exceptions like socket & other time out errors for FTP(file.ftp.FTPEx: 421,425,550), SFTP,HTTP channels do not create incidents and thereby increase our workload in Prod.Since these errors are creating incidents in Consumer ,we dont want that these alerts trigger and Consumer reads these errors and create Incident no.The conditions are below:
    If “ErrorText” value contains one of the following texts, please DO NOT create ticket:
    • com.sap.aii.adapter.file.ftp.FTPEx: 421 Unexpected reply codeProxy is closed
    • com.sap.aii.adapter.file.ftp.FTPEx: 425 Unexpected reply codeCant open data connection.
    • com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeThe network path was not found.
    • com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeThe process cannot access the file because it is being used by another process.
    • com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeThe system cannot find the file specified.
    • java.net.ConnectException: A remote host refused an attempted connect operation. (Connection refused)
    • java.net.SocketTimeoutException: Accept timed out
    • Exception received: com.jcraft.jsch.JSchException: Session.connect: java.net.SocketTimeoutException: Read timed out
    • Exception received: com.jcraft.jsch.JSchException: timeout: socket is not established

    Please suggest any feasible solution asap.

    Regards,
    Mayank

    • Alex Wiebe says:

      Ditto on this problem. We’re trying to get alerts when a specific channel cannot connect (an SFTP Sender for example). But cannot add a channel directly to an alert only a business system/component. And if we add a channel to a config scenario, it adds the business system/component as well. This results in too many false positives – as any error with any channel in that system/component triggers the alert.

      • Isuru Fernando says:

        Hello Alex,

        Using standard configuration of CBMA framework you cannot filter alerts by individual communication channels. We can only select error sources by category, adapter type and other runtime components. You maybe need to check other advanced options such as this.

        Hope you will be able to solve your problem!

        Cheers,
        Isuru

  7. Joel says:

    I see that in the Task creation you indicated a GMAIL address. I just want to confirm if the Java mail client has been configured with GMAIL settings as well. This is the only thing I am not clear in this steps. Thank you.

  8. Nikhil Pitkar says:

    Hello,
    Its an excellent blog.

    I have a query without NWDS, how can we CRUD (Create read Update Delete) tables in SAP PI(not PO) 7.5 Single Stack

  9. sonali says:

    Hi Isuru,

    Is there any way to test the alert using any report rather than stopping the channel or making a change in the PI interface? We have already alert set up in the production system anyhow, suddenly few of the DL members stopped getting alert.

    Thanks in advance!!!
    Sonali

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest tips and tricks on SAP!