Component-Based Message Alerting (CBMA) is the new way of sending alerts on SAP PI (either single or double stack) without the use of any additional components. CBMA is made of three componets:

a) Central configuration for creating alerts – alerts can be created in Integration Directory or in Netweaver Administrator

b) Alert Engine – which is supposed to evaluate rules and create alerts

c) Alert receivers (consumers) – components which can receive alerts from the Alert Engine

This first article about Component-Based Message Alerting will show how to create a typical alert configuration with an e-mail consumer which means that once the alert will get generated an e-mail with alert data will be distributed to the alert receivers.

Step 1 – Create alerts in Integration Directory

At first you need to specify a new alert rule and assign PI objects to that rule as shown in Figure below.

/wp-content/uploads/2012/03/content_0_85064.png

Specify alert severity, if the alert rule is enabled (or disabled) and if the payload should be included in the alert message.

Step 2

Specify which types of alerts should be included in the alert rule like for example all alerts from a single adapter type (file or jdbc), etc. You also need to specify an alert receiver (consumer) which in our case will be an e-mail service. Alert consumer does not need to be an e-mail service it can also be Solution manager or any other third party consumer (custom created), please refere to further reading section for other types of alert consumers. Once the alert is generated an e-mail will be distributed to the alert receiver.

/wp-content/uploads/2012/03/content_1_85065.png

Step 3

Configure alert consumer for e-mail notifications. There is a new JavaMail Client Service which needs to be configured on the in order to be able to consume alert messages on the JAVA stack. In order to make it work you need to set a few parameters there like smtp server, user, password and host for the e-mail server which will be distributing alert e-mails.

You can configure it with the use of Netweaver admin: Configuration -> Infrastructure -> Java System Properties -> Services – Java Mail Client

In the properties tab configure at least parameters like:

– mail.from

– mail.smtp.host

– mail.smtp.password

– mail.smtp.user

/wp-content/uploads/2012/03/component_based_alerts_5_85017.png

For more info on the parameters please have a look at: Configuring the JavaMail Client Service

Step 4

The last thing you need to do is to schedule a job that will be running and creating alert notifications from the generated alerts.

Open SAP Netweaver admin: Operations -> Jobs -> Java Scheduler -> Job Definitions

Next you need to add a new task for AlertConsumerJob job as shown in the Figure below.

/wp-content/uploads/2012/03/component_based_alerts_2_85036.png

Then you can fill out the necessary details in the task parameters (like from and to e-mail and consumer specified in the Integration Directory).

/wp-content/uploads/2012/03/component_based_alerts_3_85039.png

As a last step you need to define how often should your job be running – in my case it’s every 5 mins.

/wp-content/uploads/2012/03/component_based_alerts_4_85040.png

And you’re done with the configuration – now you just need to wait for alert to be generated on your PI system. 

Alert check at consumer’s inbox

Once the alert will be raised your configured alert receiver should receive an e-mail with the alert data similar to the one below.

/wp-content/uploads/2012/03/component_based_alerts_1_85042.png

Next episodes:

In the next episodes of about this topic I will try to concentrate more on other Component-Based Message Alerting topics like:

– error handling with alert configuration

– other consumer types

Further Reading:

Presentation for Component-Based Message Alerting with Solution Manager:

http://wiki.sdn.sap.com/wiki/display/TechOps/Using+component-based+message+alerting

To report this post you need to login first.

83 Comments

You must be Logged on to comment or reply to a post.

    1. Michal Krawczyk Post author

      Hi Prateek,

      not that I know – I don’t even know if this will be downported to 7.3…

      but with 7.11 there is no single stack option so you’re free to use ABAP stack at it’s always there – with 7.3 you can have a single stack and no alert framework… unless you use another ABAP stack (like Solman).

      Regards,

      Michal Krawczyk

      (0) 
  1. Jason Scott

    Hi Michal, Just wondering how you think this compares to using a central monitornig server (CEN) for alerting (we don’t have 7.31 to play with)?

    i.e. For AEX 7.3 we can use an abap stack (solman for example) as CEN for alerting. What benefits do you see over this with the Component Based Alerting?

    Regards,

    Jason.

    (0) 
    1. Michal Krawczyk Post author

      Hi Jason,

      >>>What benefits do you see over this with the Component Based Alerting?

      1. no need for an ABAP stack anymore

      2. very simple API for adding new alert consumers and for getting the notifications (will blog on that soon after I migrate all my old blogs to the new SOA space).

      BTW

      we also had a presentation on that in GSIG for PI so you can get some more details from your local SAP PI user group representative.  Soon we might have some more on that at the GSIG too as this is one of the “most useful” features of 7.31

      Regards,

      Michal Krawczyk

      (0) 
      1. Jason Scott

        Thanks Michal. Not requiring an abap stack is an obvious one. In saying that I can’t imagane working somewhere with PI and no abap stacks available.   😉

        The other points look good. Look forward to getting my hands on 7.31 soon….

        (0) 
        1. Michal Krawczyk Post author

          >>>In saying that I can’t imagane working somewhere with PI and no abap stacks available

          but I guess you can without Solman 🙂 anyway API seems to be the best feature as you can finally pull the alerts from any other tool which the company is using without the need to use solman – just my view

          Regards,

          Michal Krawczyk

          (0) 
  2. Adam Smith

    Hi Michal,

    Are there any special authorisations r function units,  or special CTC templates required to be able to use the default local consumer on JAVA AS? 

    Im trying to configure CBMA on our 7.31 PO system: I have created and activated a rule and I have scheduled the AlertConsumerJob with consumer “ALERT-TO-MAIL”.

    However , I don’t see that my rule has the consumer “ALERT-TO-MAIL” and I also don’t have an option ( in either NWA or ID ) to add a consumer to the rule. ( in your screen shots you have a “plus” sign to be able to add a consumer to a rule” )

    I then went looking for the  RegisterConumer web service , but could find find that on our system at all. 

    Any idea what I might be missing?

    Kind Regards

    Adam

    (0) 
    1. Adam Smith

      …Ok So this is what i was missing:

      – To be able to add the ALERT-TO-MAIL consumer in ID , one needs to : ” To enable the adding of new consumers, you need to activate the  Edit  Add Consumer  option
      ”   ( Although this seems to only be avialable in ID and not in NWA )

      – RegisterConsumer is an operation of the service AlertRuleIn.

      Regards

      Adam

      (0) 
      1. Shabarish Vijayakumar

        Quick question, how can I enable the default consumer and also how can I create a new consumer? Is it because of missing CTC configuration?

        For some reason in ID, the edit button to add consumer is disabled. Nor can I find the default ALERT-TO-MAIL consumer.

        Adam Smith wrote:

                               

        …Ok So this is what i was missing:

        – To be able to add the ALERT-TO-MAIL consumer in ID , one needs to : ” To enable the adding of new consumers, you need to activate the  Edit  Add Consumer  option
        ”   ( Although this seems to only be avialable in ID and not in NWA )

         

                           

        (0) 
  3. Pratibha Sethi

    Many thanks for the informative blog Michal!

    I was wondering if there is any option in 7.31 where you can alert based on certain criterias.For example, in my scenario I am sending multiple information to the target system (e.g. Rota, Patient information, acknowledgement) but I would like to raise alerts only when the message type is Acknowledgement.

    Can you please let me know how to handle such situation?

    Regards,

    Pratibha

    (0) 
  4. Rahul Dutta

    Hi,

    We tried to implement Component Based Message Alerting following the steps which you have mentioned in your blog. Ours is PI 7.31 dual stack. However, after setting up the job with my own user id, I am getting the below error inside the log of Jobs tab :

    javax.jms.JMSSecurityException: You do not have permissions: action alertingVP.queue and instance:name alertingVP.queue

    action consumer

    instance jms/queue/xi/monitoring/alert/ALERT-TO-MAIL

    Please let us know what permission is required to set up the job.

    Thanks,

    Rahul

    (0) 
  5. Rashmi Joshi

    Hi Micheal,

    Nice blog… We have PI7.31 dual stack…. Can I use Alert Rule in dual stack?? Will it give alert mails in inbox as here its dual stack not aback stack…..

    Please reply…

    Regards,

    Rashmi

    (0) 
  6. Nitin Rao

    Hi Michal,

    Indeed its a good knowledge share. We are using PI 7.31 dual stack, we will make sure we deploy this. Waiting for your next episodes 🙂

    Regards,

    Nitin

    (0) 
  7. sabitha gangishetty

    Hi Michal,

    Nice blog. We have implemented the same and facing the error as

    javax.mail.messagingException: Could not connect to SMTP host : XX.XXX.XX.XX ,port : 25, response:421

    We are using the default consumer ALERT-TO-MAIL.

    Please suggest if any settings to  be done.

    And mentioned the default mail ID in To address as “mymail@sap.com

    Regards,

    Sabitha

    (0) 
  8. Sep Gong

    Hi Michal,

    I saw the Payload in Alert is enabled above.

    I want to know where we can find the payload.

    It is attached as one document in the mail or just one link is given in the mail.

    I am working on the alert configuration, but I didn’t get the message payload, even I have enabled “Payload in Alert” in Alert Rule,

    Thanks,

    Sep

    (0) 
    1. Adam Smith

      Hi Sep,

      I know Michal is a busy guy and I happen to know the answer to your question:

      That “Payload in Alert”checkbox is a little misleading…by checking that check box you don’t get the whole payload in the alert, what you do get is the values of fields which you have defined as User Defined Searches for the interfaces for which you are defining alerts.

      Regards

      Adam

      (0) 
  9. Markus Schalk

    Hi guys,

    at first, thanks a lot for this great blog Michael, indeed i liked it very much. You and William are my favorite contributors on SCN 😉 .

    We are preparing migration to PO right now, and we want to start with a generic alert rule which informs us about any error happening on PO, before we are digging deeper in SolMan. But how can we do this? As far is i have seen, you are forced to add object information (iFlow, BC, BS…) to rule, when you want to receive alerts about e. g. failed receiver determination. Any idea how it is possible to generate a “default rule” which alerts everything?

    We could add for instance all iFlows by hand, but this is not very convenient!

    Kind regards,

    Markus

    (0) 
    1. Philipp Domeratzki

      Hi Markus,

      in order to create a default alert rule for every Integration Scenario, you can select the Checkbox “Create Default Rule” when you create a new rule in Integration Builder. (Right click on Alert Rule -> New Alert Rule -> Then select the Checkbox in the wizard).

      Kind regards,

      Philipp Domeratzki

      (0) 
      1. Markus Schalk

        Hi Domeratzki,

        thanks for your help, i found it already in NWA. You can create the default rule there as well. And it works 😉 …

        Kind regards,

        Markus

        (0) 
      1. JUS JLC

        Hi, Sep:

        Many thanks but I don’t want to watch alerts in my mail (we dont have any mail server) . I need to watch alerts on the Java stack or on the abap stack (I prefer on the abap, ALRTDISP transaction or other  )  and that other users can watch it too.

        ¿Do you Know how?  7.31 version

        Regards,

        (0) 
  10. YRV isa

    Michal,

    Is there any option to edit existing alert tasks? I need to add more mail IDs to existing alert tasks.

    Operations -> Jobs -> Java Scheduler -> Job Definitions

    in Tasks tab…

    Since I was not able to add new Mail IDs, I am removing the alert and recreating with new mail IDs.

    This is awkward… I guess there are some other options to do it… What do you say!

    Thanks…

    (0) 
  11. suresh enchoor

    Hi Michael,

            Great Blog! Finding time to help others is even more awesome. I am trying to find a way to change the subject and Body of the emails because the standard error message is not user friendly and not legible. I don’t see an option in your blog either to do so. So could you tell me what is the way to change the body or Subject?

    Regards

    Suresh Enchoor

    (0) 
  12. Vijay J

    Hi Michael,

    Thanks for blog. I am getting below error after all steps I followed :

    This error i saw in Job log. And i did not receive any email.

    com.sap.engine.services.jndi.persistent.exceptions720.NameNotFoundException: Path to object does not exist. First

    missing component is [jms], the whole lookup name is [jmsqueues/alertingVP/jms/queue/xi/monitoring/alert/ALERT-TO-MAIL]

    Pls advise

    Rgds

    (0) 
    1. Srinivasa Reddy

      Hi,

      If you got that error, it means no alerts generated for  consumer name ALERT-TO-MAIL and JMS queue  not formed…Once any alert generates, then the JMS Queue forms and alerts can be read from the queue and the job will trigger mails..

      (0) 
  13. Saurabh Kumbhare

    Hi Michal,

    Why is necessary to configure the JAVAMail client service. I am using PI 7.3 dual stack and with scheduling of background job RSCONNECT and SXMSALERT_SEND_VIA_MAIL, I am automatically getting mails in my inbox.

    Do you mean to say that JAVAMail client service is only needed when we have a single stack PI system ?

    Regards

    Saurabh

    (0) 
  14. Ven A

    Hi Michal/Adam,

    Indeed its a nice blog and veryuseful.

    But how could we set the recipients different based on the many alert rules created and ofcourse the consumer we are using is the same i.e. ALERT-TO-MAIL.

    Please suggest.

    Thanks

    VR

    (0) 
  15. Vijayashankar Konam

    Michal,

    I am little bit late in coming to this blog. However, could you please add the prerequisite that the component based alerting needs to be enabled in the system in order to get the alerts generated and forwarded to the respective JMS queues? The link to configure is here.

    Thanks,

    VJ

    (0) 
  16. Karthi Sivaprakasam

    Hello Michal,

    I am 1 of ur follower. Sorry, I was trying to start a discussion directly, but i could’nt. Hence I am passing my query thro this Tip….

    I need to set an Alert for the messages which comes into PI queue with more than 5 MB size.

    We have already set a Queue (XBTL) which handles the messages that are coming with  > 5 MB size. Now we have to get an email alert if there is a message coming into PI with >5MB size irrespective of interface/status.

    Kindly let me know how to achieve this!?

    PI system: SAP PI 7.0 ; PRODUCTION system.

    Regards

    KarthiSP

    (0) 
  17. Juan Francisco Zurita Duque Duque

    Hi Michal Krawczyk,

    There is one part of the Alert configuration that I have not been able to understand, regarding the relationship between and Alert Rule and the Job Task.

    Lets say we define 2 alerts for two different scenarios.

    The recipients of this alerts are two different support organizations.

    But the email address parameter is part of the Scheduled Job Task, which has no direct link to one or the other Alert Rule.

    How do I relate email distribution list to one Alert and one to the other?

    Or I am misunderstanding the capabilities of the default ALERT-TO-MAIL component.

    (0) 
  18. Harshit Agarwal

    Hi Michael,

    Thanks for the blog. It helped me working on alerts in single stack.

    I had 1 query. After setting up this alert, can I edit it at later stage? Eg. I was trying to add more email IDs in the ‘mail to’ but I do not get the edit/modify option. Is this user role issue.

    Thanks

    Harshit

    (0) 
    1. Tibin Joseph

      Hi Harishit,

      Please help me out..How do u made it working?

      I am trying to configure the steps in PI 7.4 and I can observe the things I have explained in Alert Configuration in PI 7.4 Guidance Required   after Configuring.Can I able to see the Alerts in Run time Workbench>Alert Inbox?…How to make it working. Because I just want to check whether the alerts are triggering in PI side internally .

      Regards,

      Tibin

      (0) 
  19. Baskar Gopalakrishnan

    Hi Michael,

                     Thanks for the blog, I’m planning to upgrade PI 7.3 to PI 7.4(dual stack). Unfortunately my client still wants to retain dual stack for some existing interfaces.  can I able to use CBMA in 7.4 dual stack  (at least for ICO related interfaces?  Please advice.

    (0) 
  20. Jens Schwendemann

    Hi Michal / All,

    short question to get my head around this. When having a PI 7.4 AEX and a proxy receiver system NW ABAP 7.4:

    Is it possible to use CBMA for creating alerts of the proxy receiver directly?

    I know I could use Alerting Framework with setup like here but is there a “native” way?

    (0) 
  21. Daniel Valdivia

    Hi Michal, Thank you very much for sharing your knowledge with us . I have the following questions:

    1. I have performed all steps according to the blog but fail the errors of message mapping not send, other errors if displayed in the mail.
    2. Is there a way to change the structure of mail alert ?. I have seen that in version 7.31 there job “AlertConsumerJobV2 “which has the description “Simple alert consuming solution for generation of emails . Enhances and Replaces the job AlertConsumerJob. It offers additional parameters and the Possibility to use an email template” and is necessary to pass the parameter EmailTemplateFile. Thank you very much for your support.

    Regards,

    Daniel Valdivia

    (0) 
  22. Sayanti Mukherjee

    Hello Michal,

    Thanks for this nice blog. I have configured the Alert in NWA as per your blog and it is working fine.

    But my client has the requirement to add the File name in the Alert Mail.

    Please help me to add the File Name from Dynamic Configuration

    Capture.PNG

    Thanks,

    Sayanti Mukherjee

    (0) 
    1. Marc Goodman

      Hi Sayanti,

      It’s been a while since this was posted but I was wondering if you managed to resolve the filename in email content?

      Kind regards,

      Marc

      (0) 
  23. Prathap Sinha

    Hello Michal,

    I have created the AlertRules and assigned the custom Consumer and ICO for it.

    What if ICO is shared by more than 1 interface(In my case it is shared by 4 Interfaces).

    Do we need to add Communication Component, Service Interface etc in addition to ICO to the AlertRule?Please help.

    Regards,

    Prathap.

    (0) 
  24. Shiva Kumar

    Hello Michal,

    I have following requirement,so can you please confirm if we can achieve this either in PI7.1/7.3/7.4

    Requirement:-

    PI Alerts need to be routed to 2 different group ids’ (ex Group1 and Group 2)

    Group 1: should receive alerts during 9 AM to 9 PM only

    Group 2: should receive alerts during 9 PM to 9 AM only

    i.e., can we configure time based routing of alerts to differnt groups/persons.

    Regards,

    Shiva.

    (0) 
  25. K Ramesh

    Hi Michal. Thank for the great blog. My requirement is instead of Message monitoring URL which is present in the mail  payload have to be attached in the mail. i’m using PO 7.4. please advise how it can be achievable. Regards Ramesh

    (0) 
  26. Siva C

    Hi Michael,

    Thanks for the blog, indeed a nice one.

    We are with PI7.4 dual stack. implemented CBAM following two your blogs.

    As per AlertConsumerJob the alerts are generated, but unfortunately they not arrived into my inbox.

    No logs are found except JOB (Job AlertConsumerJob (ID: bb8d1f129c9e11e5bd5f000000979d16, JMS ID: ID:5DF8010000000E12-00000000003B) ended on Mon, 7 Dec 2015 15:55:28:920 AEDT) NWA log viewer.


    Where/how can i trace where it went wrong?

    JobLog.jpg

     

    Thanks in advance,

    Regards,
    Siva.

    (0) 
    1. ambuj mishra

      In step 3 while configuring java mail client, set mail.debug “true” and check the log what went wrong while triggering your alerts to email inbox.

      (0) 
  27. Venkat Yadavalli

    Hi Michal and others,

    I followed this blog to create alerts in my PO 7.5 system.

    SMTP parameters were set, Default Consumer Used. Alert consumer job running.

    I generate the error event,and can seee in log, but the alert consumer job is not picking it and forwarding to my email.

    Strange is the job completes some times and again Error times.

    When completed, i see below in log.

    “0 alerts were processed” and Successfully performed an alert consumer task.

    When error,

    javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client

    Has anyone faced this one.

    Thanks & Best Regards

    VY

    (0) 
  28. Shibashis Roy

    Hi Michal,

    We are using PI 7.31 single stack.

    I have a very specific requirement on CBMA alert mechanism. In our case we are facing temporary channel failure and due to this we are facing lots of alert mails. This channels gets automatically up after sometime and messages started to flowing normally.

    I understand we can set the suppress to avoid duplicate errors during this temporary downtime, but is there any other option available by which we can trigger alert only after checking the channel status for a certain time and then if it fails say for 5 min, it will throw an alert.

    (0) 

Leave a Reply