Some filesystems are critical to a business, such as those used in interfaces. This custom metric group will alert if a filesystem is not mounted.
Create the Bash Script to Check the Filesystem Status
Firstly, we need to create a bash script that takes the filesystem as its input argument and then checks its status. Create the following script called /sbin/checkfilesystemmounted.sh (owner is root, permissions 755). You may put this script somewhere else if you prefer, but be sure to refer to the correct location later on in this post.
The findmnt command returns the mount details if the filesystem is mounted. The filesystem is passed as a script argument in variable $1. If the filesystem is mounted, the script returns integer 1. If the filesystem is not mounted, the script returns integer 0. For example, to check your desired filesystem, execute it like this as root:
The result should be as per the following example:
Webmethod returned successfully
Operation ID: 0A02C69098121EDDA68C041B50FE858D
----- Response data ----
description=Check if filesystem is mounted
{type:integer, name:FileSystemMounted, value:1}
exitcode=0
Create the Custom Alert in SAP Focused Run
In Focused Run, we create an alert in a Linux host monitoring template. For example, the alert name is “Interface Filesystem not Mounted”. The Alert should be in Category “Exceptions” and the Severity is up to you. In this case it is 9.
Create the Custom Metric Group in SAP Focused Run
Next, we create the custom Metric Group . A Metric Group allows variants to be created, and each variant corresponds to a filesystem you wish to monitor.
Overview Tab:
Name: “Interface Filesystem not Mounted”
Category: Exceptions
Class: Metric Group
Data Type: Integer
Technical Name: INTERFACE_FILESYSTEM_NOT_MOUNTED
Data Collection Tab:
Data Collector Type: Diagnostic Agent (push)
Data Collector Name: OS: ExecuteOperation
Collection Interval: 5 Minutes (depending on the criticality)
CUSTOM_OPERATION_NAME: checkfileystemmounted – This corresponds to the custom operation for saphostctrl created earlier
METRIC_NAME: FileSystemMounted – This corresponds to the name of the metric in the JSON output by the bash script
RETURNFORMAT: JSON – This is the output format of the bash script
Usage Tab:
Threshold Tab:
As the script returns a numeric value 0 if the filesystem is not mounted, then the threshold will alert if the value is 0.
Assignment Tab
Assign to the custom alert created earlier.
Add Variants
The variable passed to the saphostctrl operation is “FILESYSTEM”. We can add the rest of the filesystems as individual variants. The format for the operation parameters is as follows:
FILESYSTEM:/the/filesystem/you/want/to/check
For example:
You can enter as many filesystems as you like as separate variants.
Activate Alert
Go to the “Metrics, Events, Alerts Hierarchy” tab, and activate System Monitoring.
Testing the Metric
In a non-Production environment, try to unmount a filesystem, and at most 5 minutes later, there should be an alert produced.
This blog will focus on monitoring on EWM systems.
Monitoring productive EWM systems
EWM systems are at the often used as stand alone systems that make sure logistics and warehousing can keep running at high availability. If the connected ECC or S4HANA system is down, EWM can continue to support logistics operations.
EWM can be older version based on SCM/BI system core. Newer EWM systems are using S4HANA with EWM activated as standalone.
Extra in an EWM system are the use of qRFC and the CIF (Core interface). And many EWM systems have users that interact with the system via ITS GUI based handheld scanners.
CIF monitoring
The CIF is the core interface between SCM and ECC system. The interface typically uses RFC and qRFC. And it is working both ways.
Setup for the CIF specific RFC’s and qRFC’s the monitoring:
For a BW system some numbers are typically higher than on an ECC or S4HANA system. Response times of 1.5 seconds would indicate horrible performance on ECC, but are normal on BW system.
System host template
For system host the regular CPU, memory, disc template is sufficient. Finetune the thresholds to your comfort level.
This blog will focus on monitoring on SLT systems. These systems are mainly used to replicate data from source systems like ECC and S4HANA towards target systems like Enterprise HANA and HANA cloud.
Monitoring productive SLT systems
When monitoring a productive system, you will need to finetune the monitoring templates for:
ABAP 7.10 and higher Application template, for the ABAP application
ABAP 7.10 and higher Technical instance template, for the ABAP application servers
System host template
Database template
ABAP APPLICATION TEMPLATE
Make sure you cover in the ABAP application template the following items:
Availability:
Message server HTTP logon
System logon check
RFC logon check
License status
Certificates expiry
Update status
Performance and system health:
Critical number ranges
SICK detection
Dumps last hour
Cancelled jobs last hour
Security:
Global changeability should be that the system is closed
Locking of critical users like SAP* and DDIC (see blog)
Fine tune the metrics so you are alerted on situation where the system is having issues.
SLT uses far more background and dialog processes than a normal system. It is basically continuously busy processing records.
SLT DMIS template for SLT system
For SLT systems, apply the SLT DMIS template:
In the SLT system itself, make sure job /1LT/IUC_HEALTH_C with program R_DMC_HC_RUN_CHECKS runs. This will collect data that is needed for SLT itself, but which is also re-used by SAP Focused Run.
Anyhow you should make sure to regularly apply the notes for the DMIS component. See this blog.
SLT DMIS dummy template backend system
For SLT to work, the DMIS component is installed in both the SLT system and the backend system. For the backend system SLT component, Focused Run will pick up the template as well. But this will not make any sense in monitoring, since it is the source system and not the SLT system.
For this reason, set up a dummy empty template with every monitoring item disabled:
Assign this dummy template to your backend system.
ABAP APPLICATION SERVER TEMPLATE
Make sure you cover in the ABAP application server template the following items:
Availability:
Local RFC logon test
Local HTTP logon test (if any BW web scenario is used)
The detailed monitoring data from system monitoring is only kept 28 days.
For specific reasons you might want to store certain details longer for specific systems in a condensed way. For example, you want to keep short dumps and failed jobs for your productive systems on daily basis for 1 year.
Here is where the aggregation framework can help you.
Set up aggregation framework
To setup up the aggregation framework go to the System monitoring Individual maintenance FIORI tile:
On the left hand side choose the option Aggregation Framework:
Choose the button Create Variant to create a new variant:
Fill out the name and basic description and press the Continue with next step button:
The next screen is bit more complex:
In sequence: first search for the extended system ID and press go in the top left section. In the bottom left section, select the system you want. In the top right section now select Add filter from the left button. And press the Add selected objects for aggregation button on the bottom right part. Now press the Continue with next step button:
Select the metrics on the left hand side and add the filters on the right hand side. When done press the Continue with next step button:
Press the Start Calculation button and check your results. Then press Save.
Using the aggregation framework
For using the aggregation framework there are no special requirements. Whenever you use an aggregated metric in system monitoring, you can simply use the details with a long period.
Settings for the aggregation framework
In the aggregation framework configuration screen, you can click on the configuration wheel top right to set the retention period for Short/Medium/Long:
When you are using a web dispatcher, you want to check that the main URL is available. You can achieve this via URL monitoring in health monitoring (see blog).
In some cases you want to integrate this vital start URL into system monitoring, since that is your main central tool.
You can create a custom monitoring metric to measure and act on this.
In the use case below we will setup URL monitoring for web dispatcher for SAP Netweaver Gateway serving FIORI pages.
Creation of the custom metric for web dispatcher URL monitoring.
Create a custom metric following the steps in this blog. The template to be adjusted is the technical system SAP Web Dispatcher 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_WEBDISPATCHER_URL_AVAILABILITY:
In the data collection:
Data to enter: RFC on diagnostics agent (push). Select SRSM Ping Http Unsp. Select the HTTPS protocol and setup the URL to monitor: /sap/bc/ui2/flp?sap-client=xxx&sap-language=EN. This is the main FIORI start URL. The port number is taken from the LMDB settings of the web dispatcher: $SAP_WebDispatcherIPServicePort->SAP_IPServicePort.PortNumber$.
Define the threshold for alerting:
We take here three measurements. If we don’t then with a single glitch in the network an alert will be triggered.
And assign the metric to the system message alert group:
When we perform Simple System Integration (SSI) on a managed system , it automatically activates the SAP default monitoring template on the managed system. However, in most of the SAP Focused Run (FRUN) implementation scenarios, we create customer defined monitoring templates (Custom Templates), which we then manually assign/activate on the managed system.
Rule Based Template Assignment is a feature in FRUN by which we can define based on managed system category which custom monitoring template to be assigned and activated directly when we perform SSI on the managed system.
Defining Rule Based Template Assignment
For Rule Based Template Assignment navigate to the FIORI tile Individual Maintenance in the Advanced System Management section of FIORI launch-pad.
In the Individual Maintenance App navigate to the Rule Maintenance by clicking on the button as shown below.
In the Rule Rule Based Assignment Screen, on the left hand side panel, select the specific Managed Object type for which you want to define the Rule Based Template Assignment.
In this blog we take the example of defining a Rule Based Template Assignment for managed system of type SAP ABAP BASIS 7.10 and higher and specify the custom template for System Level monitoring template. So we select Technical Systems upon which the right side panel now gives a list of all product types. In the right side panel we scroll down and select SAP ABAP BASIS 7.10 and higher.
Now we need to define the Rule based on which the Custom Defined Template to be defined. In this blog we take the example that we have defined 2 custom templates one for Production Systems and one for Non Production Systems. So we will need to define rule to assign template based on filters System Type ABAP and IT Admin role defined in LMDB. For more information on this function read this blog.
In the subsequent screen select Maintain Rules.
In the Maintain Rule screen we select the following filters.
Name your Rule and Save.
Similarly you can create Rule ABAP Non production, just ensure to select the following IT Admin Roles.
Now back in the main screen select the Rule you created from the drop down.
And for Template select the custom template you want to select for the assignment.
Add the assignment.
Now click in Continue with Next Step button till you come to the Reconfiguration tab and then close. This will allow you to save your Rule Assignment.
Once you have assigned the ABAP Production and ABAP Non production rules in the main screen you will see the following assignments listed.
After the assignments done, the next time SSI performed on any ABAP system will take up the custom monitoring template as defined in these rules.
In Individual Maintenance system list you can also see whether current assignment is SAP default or Rule Based Template Assignment.
A special function is System Monitoring is the System Down Monitor. This overview directly gives an overview of the systems that are considered down by SAP Focused Run and the systems which are set to having maintenance.
Questions that will be answered in this blog are:
How can I quickly get an overview of all my systems that are down?
System down monitoring
In the system monitoring screen select the System Down monitoring icon on the left icon bar (here indicated with the arrow):
You can see systems that are down and which ones that are having planned maintenance. If you have set up the SLA management, it will also show that aspect.
If you want to zoom in on the issues, press the i icon right of the system. Then select Links to go to the respective tool for further investigation:
For systems down the best tools are usually the System Analysis and the Alert Event management.
Changing settings
You can change the layout settings with the glasses icon:
You can show/hide the SLA and charts section as per your need.
Definition of down
The definition of down is in Focused Run: any red alert in the availability metrics. This can be:
Complete system down
One of the application servers is down
Core function is down (for example ABAP stack is up and running, but the Https is not available)
Important subfunctions are not working (for example in the SLT system 1 or more source systems can not be reached)
In some cases you want to have your own metric defined to fine tuning the system monitoring template.
Questions that will be answered in this blog are:
How do I create a custom monitoring metric?
Do I need to re-create the custom metric per monitoring template?
What are examples of custom metrics?
Creating custom metric
In this example we create a custom metric to make sure that the user WF-BATCH is not locked.
There is already a metric in the ABAP template that is called User Lock Status. This can be used as a basis for our custom metric.
Goto your template into change mode and on top left choose Create (you need to be in Expert mode first):
And select Metric. Now the screen opens for a new metric creation:
Fill out the details, and create a custom description:
Now go to the tab Data Collection:
Copy the data from your reference metric here. Don’t forget to fill out the Parameter Value. In this case WF-BATCH. Also make sure you have a reasonable Collection Interval timing. Not everything is need to be collected every 5 minutes.
Now go to the tab Threshold:
Configure your threshold setting.
Now press the Next button and assign the metric to the correct group:
Now press Finish to save the metric.
The new custom metric is now available in the monitoring template:
You see that this one has the Custom created marked. Later you can use the filter on Custom created column to quickly find it again.
Deploying custom metric to other templates
If you have to deploy the custom metric to other templates: so far this is a manual action. Per template you have to re-create the same custom metric. I have not found a nice way of re-using custom metrics yet.