How to Monitor SAP System Connection Health and Create Alert Mechanism?

Your Java system (WebLogic, SOA Suite, OSB… etc.) is connecting to SAP and you want to monitor remote SAP systems and calculate its response times…

WLSDM for WebLogic
WLSDM for WebLogic

--

Monitoring SAP System’s Response Times
Output: Response Time Chart of SAP System (millisecond)

As a Middleware Administrator, you may need to monitor the status of SAP due to a potential exception that you cannot predict. In order to do this, you may need to connect to the SAP system somehow. In this blog post, we’re going to show you how to monitor SAP through to Oracle WebLogic and Java aspects.

You are able to connect to the SAP system using the WebLogic SAP Resource Adapter. However, if you want to monitor SAP Up/Down status and the SAP response time or to receive alarms for anomalies, there is no tool capable of doing that monitoring.

Wait…! Except WLSDM :)

At the end of this technical blog post, you are going to able to monitor SAP systems through Oracle WebLogic and Java aspect. If the SAP system goes down or up an ALERT would be sent via WLSDM, and also if the SAP System slows down a response time ALERT also going to be sent, too.

Here is the path to setup an end-to-end SAP monitoring System.

  1. Creating the JAR file
  2. Creating Shell Script to run JAR file
  3. WLSDM Integration
  4. Setting Up ALERT Configuration
  5. About SAP Systems
  6. About SAP JCO3

1. Creating the JAR File

We have developed a JAR file to connect, monitor, and calculate the response times of the SAP system. The Java class of this JAR file, which we called SAPHealthCheck, is as shown follows.

SAPHealthCheck.java

CustomDestinationProviderMap.java

In this JAR library, we get the SAP system information, which we will connect, from a separate properties file. You can save this file within the project.

config.properties:

config.properties file
Content of config.properties file

Codes and JAR is available at GitHub

Go to GitHub Repository and Download Resource Files

https://github.com/mfevzikorkutata/SAPMonitoringHealthCheck

2. Creating Shell Script to Execute JAR File

We can run the JAR file of the developed JAVA Class on Linux as follows.

The dev_jco_rfc.trc command is automatically created in the directory where the script is located and suppresses an error message when the SAP status is down. Only when it’s “down”. With this “echo >” command, we permanently delete this message. (We are deleting the content, not the file.).

Then we send the output of the running script to a text file and make WLSDM read this file.

NOTE: In order not to run it manually, we put this script in crontab and set it to run every 2 minutes.

With the help of WLSDM, we do not need to manually examine the status of SAP. Because, thanks to the script we have embedded in WLSDM, we receive alerts about the status of SAP. So how do we do this?

We can do this using “Generic DevOps”, one of the most important features of WLSDM. Using the Generic DevOps feature, we can log an MBean with shell/batch commands or SQL queries. Is WLSDM limited to that? Of course not. We also need to watch this MBean we recorded. We can also use Smart Dashboard, another feature of WLSDM. With the created Custom Smart Dashboard, we can see the chart of the script running in MBean that we saved.

As a result, we can summarize the benefits of WLSDM in 3 steps:

1. Save a script as MBean using the Generic DevOps feature of WLSDM.

2. Create a Custom Smart Dashboard and follow this process with charts.

3. Get SAP status from alerts

3. WLSDM Integration

3.1. Login to WebLogic console and go to WLSDM Console.

Oracle WebLogic Console + WLSDM Console

3.2. Go to “Configuration > Monitoring & Diagnostics”.

WLSDM Console > Configuration > Monitoring & Diagnostics

3.3. Click the “New User DevOps MBean” button in WLSDM “page operation” menu.

New User DevOps MBean

3.4. Choose “Embedded Script” from the drop-down list then select target server.

Choose Embedded Script

3.5. Since we get the status information from output.txt in the script we run, we give WLSDM the command to read the output.txt

cat /data/weblogic/scripts/SAPMonitoring/output.txt

cat output.txt

3.6. Create a new dashboard or add MBean Chart to an existing Dashboard.

Create New Chart

3.7. Alert Configuration

Navigate to “Monitoring > Custom Dashboard” Click the “Metric & ChartOptions” to adjust alert and other operations.

Alarm Configuration of Response Times:

SAP Response Time Alarm Configuration

Alarm Configuration of Up or Down:

SAP System UP or Down

Result-1: Is SAP System UP or DOWN?

UP_DOWN Status | 1: UP , 0:DOWN

Result-2: Is SAP Response Time is Fast or Slow?

SAP_Response_Time (millisecond)

Result-3: SAP “UP or DOWN” Alert (Responsive HTML Email)

UP or DOWN Responsive HTML Alert (Responsive HTML Email)

Result-4: SAP Response Time Alert

SAP Response Time HTML Alert (Responsive HTML Email)

What is SAP?

SAP (Systems Applications and Products) is a widely used enterprise resource planning (ERP) software. SAP creates a centralized system for businesses that allows each department to access and share common data to create a better working environment for every employee in the company. SAP is the most used ERP software in the IT world and includes hundreds of fully integrated modules that cover almost the entirety of business management.

Importance of SAP and Monitoring SAP Externally: What Does SAP Do and Why It’s Important?

SAP collects and processes data from all functions in a business on a single platform. Many businesses choose SAP because it allows each department to communicate comfortably with each other. The success of any business relies on effective communication and data exchange across its functions, and SAP is an effective way to support these efforts.

SAP Structure

SAP Structure

What is Resource Adapter?

The resource adapter is a system library specific to the Enterprise Information System (EIS) and provides connectivity to the EIS. The resource adapter is similar to a JDBC driver that provides a connection to a database management system. Between a resource adapter and the EIS, the interface is specific to the underlying EIS; It can be a local interface. The resource adapter is attached/deployed to an application server such as WebLogic Server and provides seamless connectivity between EIS, application server and enterprise application server and enterprise application.

Oracle WebLogic Server Deployment

The Oracle Application Adapter for SAP R/3 is deployed in an Oracle WebLogic Server container during installation. All client applications run in Oracle WebLogic Server environment. In a J2CA deployment, Common Client Interface (CCI) integrates an Oracle WebLogic Server client application with a resource adapter.

Deployment of the SAP Adapter

Deployment of SAP Adapter

SAP JCO3

SAP Java Connector (SAP JCo) is a development library that enables a Java application to communicate with SAP systems via SAP’s RFC protocol.

Download WLSDM

https://wlsdm.com/download

Authors:

  • M.Fevzi Korkutata
  • Mustafa Şensoy
  • Salih Özdemir
  • Alper Bulut

--

--