Date post: | 02-Jan-2016 |
Category: |
Documents |
Upload: | bikash-bhanu-roy |
View: | 152 times |
Download: | 6 times |
Component-Based Message AlertingComponent-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.
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.
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
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.
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).
As a last step you need to define how often should your job be running - in my case it's every 5 mins.
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.
Component Based Message Alerting On As AbapAs well known that Component Based Message Alerting is new feature of PI 7.31 .
I see lots of discussion on this and unclosed thread .There are very few blogs on CBMA .Here i am explaining the CBMA on AS abap .
I am taking very simple scenario that is SOAP to Proxy and configuring the CBMA on as abap .
Created the scenario SOAP to Proxy with simple integration engine Configuration .
Prerequisites:: SAP_XI_ADMINISTRATOR,SAP_XI_CONTENT_ORGANIZER, SAP_XI_CONFIGURATOR, or
SAP_XI_DEVELOPER roles is assigned to the user who is configuring the same .
The system is configured to send mail or sms means <SCOT> is perfect configured .
Step 1 - When you want to use the new component-based message alerting maintain first alert parameter in integration engine configuration
Go to sxmb_adm->integration engine configuration then add two new parameter Category "Monitor" ALERTING_IS_ACTIVE value 1
and ALERTING_TARGET value 1.
Use of parameter ALERTING_IS_ACTIVE is to switch on alerting for this run time engine .
use of parameter ALERTING_TARGET to switch on component-based message alerting .
step 2- Create Alert in ID section
make it Yes on Parameter Enabled and Enabled in parameter Payload in alert .
Step3 - Define alert rule .
go to http://host:port/pimon
Configuration and administration->message alert configuration. here select your alert rule, click on edit then add and define your component from where
you want to trigger alert . As I am selecting configuration scenario .
And finally save the rule .
Step-4 Now we need to create distribution list on abap stack ..
go to SO23 and create distribution list , in distribution list enter e-mail address of users who should be notified when there are alerts .
Step-5 Go to se38 and execute the program SXMSALERT_SEND_VIA_MAIL
Consumer of PI Alert: The name of the local alert consumer added to the alert rule. The default is ALERT-TO-MAIL.
Max chunk size for alerts read: The amount of alerts read by the program from the alert queue in the system. The default value is 5000.
Max detailed records in e-mail: The number of individual message details that would be included in the e-mail notification. The default value is 20.
Distribution List: The name of the distribution list you configured as described above.
save it with any variant name and finally save .
Step-6 Now we need to schedule a background .
Go to sm36 then define a job . Give any appropriate job name click step button provide name of abap program and variant which we just created .
Click start condition and provide appropriate value and finally save and release the job .
You can check it on sm37 for monitor perspective .
Now we are done with configuration .
Testing : when i restart the failed message from sxi_monitor.I get the notification on my mail inbox that ...
1 messages failed for "Alert_Demo" on "is.85.dx1s01"Root cause:
The first 1 messages of that data collection: _ Message1:MsgID: " "Timestamp: " "FromService: " "Interface: " "Namespace: " "ErrCat: "Application"ErrCode: "EXCEPTION_DURING_EXECUTE"ErrText: " "..
Configuring the JavaMail Client Service
The JavaMail Client Service owns a set of properties that allow you to configure the behavior of the service.
Note
The JavaMail Client Service properties starting with mail. define settings for communication with the mail server and you can use them in any mail application. If these properties are set, you do not need to specify this configuration further in the application code.
You can change these properties using SAP NetWeaver Administrator.
More information: Java System Properties
JavaMail Client Service Properties
Property Default Value Description
mail.from [email protected] Specifies the sender of the mail message, that is, the value of the mail from header.
sslCertificate default
Specifies the SSL certificate to be used for authentication if the connection is secure.
The certificate must already be available in the Key Store.
mail.debug false
Specifies if the Session object bound to the naming system has the debug option enabled.
If you set this property to true, the JavaMail Client Service logs debug information.
mail.host localhostSpecifies the default host name for sending and receiving mail. This default value is used if the mail.<protocol>.host property is not set.
mail.store.protocol pop3
Specifies the default store protocol.
The method getStore() of the Session object returns a Store object which implements this protocol.
mail.transport.protocol smtp
Specifies the default transport protocol.
The method getTransport() of the Session object returns a Transport object which implements this protocol.
mail.user
Default user name for connecting to the mail server.
Used if there are no user names set for the specific protocols (mail.<protocol>.user).
mail.passwordDefault password for connecting to the mail server.
Used if there are no passwords set for the specific
JavaMail Client Service Properties
Property Default Value Description
protocols (mail.<protocol>.password).
mail.imap.user Specifies the user name to be used for connecting to the Internet Message Access Protocol (IMAP) server.
mail.imap.password Specifies the password to be used for connecting to the Internet Message Access Protocol (IMAP) server.
mail.imap.host Specifies the host name of the Internet Message Access Protocol (IMAP) server.
mail.imap.port 143
Used if the connect() method does not specify a port explicitly.
If this property is not set, the default IMAP port applies.
mail.imap.proxyauth.userIf the IMAP server supports the PROXYAUTH extension, this property specifies a user name to be used with the PROXYAUTH command.
mail.imap.starttls.enable false
If set to true, the property enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection, before issuing any login commands.
Note
An appropriate trust store must be configured so that the client trusts the certificate of the server.
mail.imaps.userSpecifies the user name to be used for connecting to the secure Internet Message Access Protocol (IMAPS) server.
mail.imaps.passwordSpecifies the password to be used for connecting to the secure Internet Message Access Protocol (IMAPS) server.
mail.imaps.host Specifies the host name of the secure Internet Message Access Protocol (IMAPS) server.
mail.imaps.port 993
Used if the connect() method does not specify a port explicitly.
If this property is not set, the default IMAPS port applies.
mail.imaps.proxyauth.userIf the IMAPS server supports the PROXYAUTH extension, this property specifies a user name to be used with the PROXYAUTH command.
mail.imaps.starttls.enable falseIf set to true, the property enables the use of the STARTTLS command (if supported by the server) to switch
JavaMail Client Service Properties
Property Default Value Descriptionthe connection to a TLS-protected connection, before issuing any login commands.
Note
An appropriate trust store must be configured so that the client trusts the certificate of the server.
mail.pop3.user Specifies the user name to be used for connecting to the Post Office Protocol version 3 (POP3) server.
mail.pop3.password Specifies the password to be used for connecting to the Post Office Protocol version 3 (POP3) server.
mail.pop3.host Specifies the host name of the Post Office Protocol version 3 (POP3) server.
mail.pop3.port 110
Used if the connect() method does not specify a port explicitly.
If this property is not set, the default POP3 port applies.
mail.pop3s.userSpecifies the user name to be used for connecting to the secure the secure Post Office Protocol version 3 (POP3S) server.
mail.pop3s.passwordSpecifies the password to be used for connecting to the secure the secure Post Office Protocol version 3 (POP3S) server.
mail.pop3s.host Specifies the host name of the secure Post Office Protocol version 3 (POP3S) server.
mail.pop3s.port 995
Used if the connect() method does not specify a port explicitly.
If this property is not set, the default POP3S port applies.
mail.smtp.user Specifies the user name to be used for connecting to the Simple Mail Transfer Protocol (SMTP) server.
mail.smtp.password Specifies the password to be used for connecting to the Simple Mail Transfer Protocol (SMTP) server.
mail.smtp.host Specifies the host name of the Simple Mail Transfer Protocol (SMTP) server.
mail.smtp.port 25Used if the connect() method does not specify a port explicitly. If this property is not set, the default SMTP port applies.
JavaMail Client Service Properties
Property Default Value Description
mail.smtp.auth false If set to true, use the AUTH command for authentication.
mail.smtp.submitter Specifies the responsible submitter of the mail message.
mail.smtps.user Specifies the user name to be used for connecting to the secure Simple Mail Transfer Protocol (SMTPS) server.
mail.smtps.password Specifies the password to be used for connecting to the secure Simple Mail Transfer Protocol (SMTPS) server.
mail.smtps.host Specifies the host name of the secure Simple Mail Transfer Protocol (SMTPS) server.
mail.smtps.port 465Used if the connect() method does not specify a port explicitly. If this property is not set, the default SMTPS port applies.
mail.smtps.auth false If set to true, use the AUTH command for authentication.
mail.smtps.submitter Specifies the responsible submitter of the mail message.
mail.nntp.user Specifies the user name for connecting to the Network News Transfer Protocol (NNTP) server.
mail.nntp.password Specifies the password for connecting to the Network News Transfer Protocol (NNTP) server.
mail.nntp.host Specifies the host name of the Network News Transfer Protocol (NNTP) server.
mail.nntp.port 119
Used if the connect() method does not specify a port explicitly.
If this property is not set, the default NNTP port applies.
Related Content