Custom metric to detect if hardware ID is missing

From availability perspective, you want to detect as quickly as possible if you are suffering from missing hardware ID.

You can create a custom monitoring metric to measure and act on this.

Creation of the custom metric for missing hardware ID

Create a custom metric following the steps in this blog. The template to be adjusted is the technical instance SAP ABAP 7.10 and higher template.

Don’t forget to tick it on for monitoring otherwise it is not active.

In expert mode create a custom metric.

Create technical name Z_METRIC_MSG_SRV_HW_ID_MISSING:

In the data collection:

Data to enter: RFC on diagnostics agent (push). Select ABAP System Log Stats. Filter on message number Q16. This indicates missing hardware ID. For more information on system log messages, read this blog.

Define the threshold for alerting:

And assign the metric to the ABAP Instance not available alert group or to a custom created alert group:

Msg Server hardware ID missingChecks for Syslog message Q16. Threshold Red for 1.

Custom metric to check OS signal

In some cases the OS system will give critical signals to the SAP system that are visible in the ABAP system log. An example is the signal 11.

When this happens, the system is in trouble and you as admin need to check fast to see what is going on to stop the system from full collapse, crash or very poor performance.

You can create a custom monitoring metric to measure and act on this.

Creation of the custom metric for OS signal detection

Create a custom metric following the steps in this blog. The template to be adjusted is the technical instance SAP ABAP 7.10 and higher template.

Don’t forget to tick it on for monitoring otherwise it is not active.

In expert mode create a custom metric.

Create technical name Z_METRIC_OS_SIGNAL_RECEIVED:

In the data collection:

Data to enter: RFC on diagnostics agent (push). Select ABAP System Log Stats. Filter on MSG_ID QoE. This captures severe errors for OS signals.

Define the threshold for alerting:

And assign the metric to the system message alert group:

Detecting long running DIA process

In some exceptional cases you can have a DIA process that runs for a long time without action and still occupies the resources.

You can create a custom monitoring metric to measure and act on this.

Creation of the custom metric for detecting long running DIA processes

Create a custom metric following the steps in this blog. The template to be adjusted is the technical system SAP ABAP 7.10 and higher template.

Don’t forget to tick it on for monitoring otherwise it is not active.

In expert mode create a custom metric.

Create technical name Z_METRIC_LONGRUN_DIA_WP_36HRS:

Now setup the definition for the data collection:

It is using the Push.

And set the usage:

Last but not least: you need to set the alerting threshold:

The alert is raised if a single DIA work process is running longer than 36 hours.

Save the custom metric and make sure the template reassignment is done to activate the custom metric for your systems.

Health monitoring overview

Health monitoring can be used to monitor special use cases:

Health monitoring

Health monitoring can be started with the FIORI tile:

The overview screen opens:

From the overview you can immediately zoom to the error by clicking on the red bar:

Configuration and Alerts

Each scenario needs to be configured. For the configuration per scenario read the separate detailed blogs:

  • SLL certificate monitoring
  • OS process monitoring
  • URL availability monitoring
  • Per scenario you can choose to create an alert in case of issues. The alert is then send to the central Alert overview.

    Monitoring Specific ABAP Dumps in System Monitoring of ABAP System

    In System Monitoring of ABAP systems in Focused Run, with the standard monitoring template, we can monitor the frequency of ABAP dumps.

    For monitoring if there are dumps of a specific type we have to create a custom metric. In this blog we explain how.

    For creating a custom metric in the monitoring template, open the Template Maintenance App in the Advanced System Management area of Focused Run Launch-pad.

    Note: You can’t add a custom metric to a SAP delivered standard template. For that you will have to copy the standard template to your own custom template.

    Open your custom ABAP instance level template in edit mode.

    Switch to expert mode for template maintenance.

    Click on Create –> Metric to create a custom metric.

    Provide a Name, a Technical Name and metric type in the Overview tab as shown below.

    In the Data collection tab enter details as shown below. Here for the parameter Error_ID you can provide the ID of the specific ABAP dump that you want to monitor.

    Navigate to Threshold tab to specify the Threshold type and Threshold. For instance in this example we have specify the threshold to rate the metric as reed if there is 1 or more of the specific dump.

    Now you can click on Next and then Finish button to save the metric.

    Next you need to create a custom alert to generate a specific alert for this specific dump.

    In the expert mode maintenance go to the Create button and then from the drop down select Alert.

    Enter the details as shown below and click on Next button.

    Then in the Assignments tab you will see the custom metric you just created. Select the check box for this metric and click on Finish to save the alert.

    Now your custom metric is ready together with alerting active.

    To activate this template update on all managed systems navigate to Managed Objects tab for the template and click on Apply and Activate button.

    Now you can see custom metric under instance level in system monitoring.

    ABAP system monitoring detecting resource exhaustion

    From availability perspective, you want to detect as quickly as possible if you are suffering from resource exhaustion.

    You can create a custom monitoring metric to measure and act on this.

    Creation of the custom metric for resource exhaustion

    Create a custom metric following the steps in this blog. The template to be adjusted is the technical instance SAP ABAP 7.10 and higher template.

    Don’t forget to tick it on for monitoring otherwise it is not active.

    In expert mode create a custom metric.

    Create technical name Z_EXHAUST:

    In the data collection:

    Data to enter: RFC on diagnostics agent (push). Select ABAP System Log Stats. Filter on message number Q40. This is the message for resources exhausted. For more information on system log messages, read this blog.

    Set the usage to monitoring:

    Define the threshold for alerting:

    And assign the metric to the ABAP Instance not available alert group:

    ABAP system monitoring detecting PRIV modes

    When you system has too many PRIV modes, it is about to fall over. This situation must be detected and acted upon.

    You can create a custom monitoring metric to measure and act on this.

    Creation of the custom metric for detecting PRIV modes

    Create a custom metric following the steps in this blog. The template to be adjusted is the technical system SAP ABAP 7.10 and higher template.

    Don’t forget to tick it on for monitoring otherwise it is not active.

    In expert mode create a custom metric.

    Create technical name Z_METRIC_DIA_WP_PRIV:

    Now setup the definition for the data collection:

    This will collect the PRIV dialog processes in percentage.

    Mark the custom metric as relevant for monitoring:

    And set the usage:

    Last but not least: you need to set the alerting threshold:

    Save the custom metric and make sure the template reassignment is done to activate the custom metric for your systems.

    ABAP system certificate monitoring

    In system monitoring you can monitor if ABAP system certificates are expiring or are already expired. For centrally monitoring SSL certificates, read this blog.

    SAP provides a standard metric for this based on configuration validation rule SAP ABAP PSE CERTIFICATES CHECK. This rule is taking all certificates that are to be expired in the next 7 days and all expired certificates.

    This rule has two setbacks:

    • 7 days upfront warning might be too short
    • It reports all expired certificates that are already years expired and don’t harm the system

    New rules

    For the improved setup we will defined 2 new rules:

    • To be expired certificates, with date selection -30 till tomorrow
    • Expired certificates, with date selection today till next 30 days.

    Start with creating the policy in configuration validation (more on configuration validation in this blog):

    Add a new policy Z_ABAP_PSE_TO_BE_EXP for the to be expired, and give it this syntax:

    Add a new policy Z_ABAP_PSE_EXP for the expired ones:

    Both are basically a copy of the standard SAP one with the changed dates.

    Please note you need to change both the dates in the Compliant and Non-Compliant section.

    Create custom metric

    Now you can create a custom metric using the newly created rule. For full description on how to create custom metrics, read this blog. Create the custom metric in the ABAP system template:

    Refer to the newly create custom CoVa (configuration validation) rule:

    And set the threshold:

    For the to be expired certificates, we only want warning.

    We repeat the same for the expired certificates, but now we make it a red alert by setting the thresholds differently.

    Make sure both are now activated for monitoring:

    Trouble shooting

    There might be false alerts raised for this metric. This is for both the custom and standard SAP metric. The source is usually the data collection.

    SAP note 3138046 – False Alert ABAP PSE certificates expiring in Focused Run describes the checks to perform.

    Go to the configuration and configuration validation FIORI tile:

    Select the system and search for the PSE certificates data collection details:

    Cloud monitoring: CPI message monitoring

    SAP Focused Run Cloud Monitoring can be used to monitor messages to and from the SAP BTP CPI solution. CPI stands for Cloud Platform Integeration

    Questions that will be answered in this blog are:

    • How to monitor message to and from SAP CPI?
    • How to setup the monitoring towards SAP CPI?

    End result of monitoring

    The configuration of the scenario is described in the next chapter. We start explaining the end result.

    Click on the tile for integration and cloud monitoring:

    Select the scenario and the overview tile appears:

    Click on the card to go to the scenario topology:

    Zoom into the overview screen of the errors:

    And drill down to any specific error:

    Set up of the CPI monitoring scenario

    Follow the steps from the SAP expert portal for CPI monitoring to setup the STRUST in SAP Focused Run for the CPI URL.

    Validate in the SAP Focused Run ABAP stack that these two parameters are set in RZ11:

    • icm/HTTPS/client_sni_enabled = TRUE
    • ssl/client_sni_enabled = TRUE

    If this is done, go to the cloud setup FIORI tile:

    Add a new end point for CPI:

    The application key, client ID and client secret will need to be provided by the basis person or functional consultant maintaining the CPI interface configurations on the BTP cloud. Depending on the security setup, a proxy is required as well.

    After entering the details check the connection that connectivity is working as expected.

    Now go to the configuration of the interface scenario and create a new cloud service for Cloud Platform Integration:

    On the monitoring screen specify filters for specific IFlows if requiered:

    On the alerting tab you can set up any alerting wanted:

    Set the filter for alerting (in this case all failed flows):

    Assign alert receivers and make sure everything is saved and activated.

    Now you can model the scenario graphically as well:

    Cloud monitoring: alert notification from BTP

    The BTP platform has a function called Alert Notification. This is a generic function that can be used to send alerts. It can be used to send alerts from applications, but also to send alerts from the HANA Cloud database.

    SAP Focused Run can pick up these alert notifications form the BTP platform. From there Focused Run can be used to further relay the alert to notification teams.

    End result of alert notification from BTP

    Go to the Cloud monitoring FIORI tile:

    Select the configured scenario (explanation of the setup is in the next chapter):

    In this case we have setup the alert notification for HANA Cloud. Click on the card tile for details, and click on the interface line:

    Now select the errors and the overview screen opens:

    Click on a single line to go to the specific error details:

    Setup of the scenario

    First you need to prepare your BTP environment to allow SAP Focused Run to collect data from the Alert Management application from your tenant and subaccount. This will give you the URL, client ID and client secret (be careful this is only shown once). To do this, follow the steps on the SAP Focused Run expert portal in this link.

    For the setup of the scenario in SAP Focused Run, go to the FIORI tile for cloud setup:

    Set up the OAUTH end point:

    After the setup save the details and test the connection.

    Now this end point can be used in the scenario setup.

    In the Scenario configuration create the Cloud Service and select the SAP Cloud Platform Alert Notification Service:

    In the monitoring details set the Endpoint you just created and filter on the events:

    In the third tab Alerting you can set up the alerts if wanted.

    Save and activate.

    In the scenario modelling you can now use an on premise system and the Cloud Service you set up above to model a graphical scenario: