Monitoring SAP systems has always been a major hurdle in every job I’ve held. SAP has its own monitoring tools, primarily CCMS, but extracting metrics and configurations from the SAP world has always been a challenge. In the past, I used SNMP traps configured in CCMS to send alerts when thresholds were exceeded. However, this process was time-consuming, CCMS isn’t easy to configure, and since it’s passive monitoring, I didn’t get any metrics.
When I joined Würth-Phoenix, one of my first tasks was onboarding a client with only SAP monitoring using a HANA database. Thanks to collaboration with our partner Derga Consulting and invaluable advice from our colleague Andreas Forster, we finally managed to get metrics out of SAP and integrate them into our NETEYE monitoring system on a cloud platform. This allowed us to achieve comprehensive infrastructure monitoring, from the operating system to the innermost SAP components.
Below, I’ll explain what we did and the potential of this work.
We developed two complementary solutions for monitoring SAP instances. The first uses a bash script plugin that launches the sapcontrol
command-line interface. This allows us to manage SAP at the operating system level and, thanks to SOAP web services, visualize some SAP system metrics.
The second solution leverages the check_sap_health
plugin developed by Consol Labs ( https://labs.consol.de/de/omd/packages/check_sap_health/ ), which we modified to achieve our goals.
Diving Deeper: Leveraging sapcontrol for SAP Monitoring
As mentioned earlier, our plugin harnesses the power of SAP’s sapcontrol command (refer to the official documentation here).
sapcontrol utilizes Access Control Lists (ACLs) for enhanced security. In our setup, only the local SAP server, any Application Servers (AS), and the NETEYE satellite are granted read access to the data. This is achieved by creating the $(DIR_PROFILE)$(DIR_SEP)service_http(s).acl files and defining the access rules as follows:
permit 127.0.0.1/32 # permit localhost
permit <IP address of 1st SAP-Server>/32 # permit local server 1
permit <IP address of 2nd SAP-Server>/32 # permit local server 2
# (similar add all SAP-Applicationservers of the system)
permit <IP-address of Neteye/32 # permit NetEye server
deny 0.0.0.0/0 # deny the rest
By implementing these ACLs, we ensure that only authorized systems can access sensitive SAP data via sapcontrol, maintaining a high level of security within our monitoring infrastructure.
While sapcontrol offers a wealth of information, we might not need all of it for our monitoring purposes. This is where the DEFAULT.PFL file comes into play. This file allows us to filter and select only the specific methods we want to read from sapcontrol.
Here’s how we modified DEFAULT.PFL to achieve this:
service/protectedwebmethods = SDEFAULT -GetVersionInfo -GetAlertTree -GetAlerts -EnqGetStatistic -GetQueueStatistic -GetInstanceProperties -GetSystemInstanceList -ReadLogFile -ListLogFiles -AnalyseLogFiles -ABAPReadSyslog -ABAPGetComponentList
ref. https://help.sap.com/docs/SUPPORT_CONTENT/si/3362959700.html
By specifying the desired methods in DEFAULT.PFL, we optimize our monitoring process by.
The NETEYE plugin utilizes various functions to monitor your SAP instances effectively. Here are some of the key functions:
The GetProcessList
function provides a detailed list of active processes running within your SAP instance. This list varies depending on the type of instance you’re monitoring.
For example:
ASCS Instance:
GetProcessList OK name, description, dispstatus, textstatus, starttime, elapsedtime, pid msg_server,
MessageServer, GREEN, Running, 2024 12 05 13:17:48, 26:34:15, 12259
enq_server, Enqueue Server 2, GREEN, Running, 2024 12 05 13:17:48, 26:34:15, 12260
Dialog Instance:
GetProcessList OK name, description, dispstatus, textstatus, starttime, elapsedtime, pid
disp+work, Dispatcher, GREEN, Running, 2024 12 03 13:38:58, 74:14:56, 27568
igswd_mt, IGS Watchdog, GREEN, Running, 2024 12 03 13:38:58, 74:14:56, 27569
gwrd, Gateway, GREEN, Running, 2024 12 03 13:38:59, 74:14:55, 27589
icman, ICM, GREEN, Running, 2024 12 03 13:38:59, 74:14:55, 27590
This function provides valuable insights into the health and performance of your SAP system by:
starttime
and elapsedtime
, you can track how long processes have been running and identify potential resource bottlenecks.This is just one of the many functions the NETEYE plugin uses to provide comprehensive SAP monitoring. In the next sections, we’ll explore other essential functions and how they contribute to a robust monitoring strategy.
Another powerful function within the NETEYE plugin is ABAPGetWPTable. This function analyzes the Work Process Table within your SAP system, providing valuable insights into the workload distribution and resource utilization.
Here’s an example of the output generated by ABAPGetWPTable:
OK: Number of free dialog processes: 10 of 10
Current Workprocess-Table: No, Typ, Pid, Status, Reason, Start, Err, Sem, Cpu, Time, Program, Client, User, Action, Table
0, DIA, 27591, Wait, , yes, , , 0:08:33, , , , , ,
1, DIA, 27592, Wait, , yes, , , 0:08:50, , , , , ,
2, DIA, 27593, Wait, , yes, , , 0:09:50, , , , , ,
3, DIA, 27594, Wait, , yes, , , 0:07:54, , , , , ,
4, DIA, 27595, Wait, , yes, , , 0:14:38, , , , , ,
5, DIA, 27596, Wait, , yes, , , 0:16:31, , , , , ,
6, DIA, 27597, Wait, , yes, , , 0:14:13, , , , , ,
7, DIA, 27598, Wait, , yes, , , 0:19:06, , , , , ,
8, DIA, 27599, Wait, , yes, , , 0:18:09, , , , , ,
9, DIA, 27600, Wait, , yes, , , 0:18:25, , , , , ,
10, BTC, 27601, Wait, , yes, , , 0:01:22, , , , , ,
11, BTC, 27602, Wait, , yes, , , 0:00:57, , , , , ,
12, BTC, 27603, Wait, , yes, , , 0:05:44, , , , , ,
13, UPD, 19741, Wait, , yes, , , 0:00:02, , , , , ,
20, UPD, 27611, Wait, , yes, , , 0:00:10, , , , , ,
21, BTC, 27612, Wait, , yes, , , 0:00:59, , , , , ,
22, BTC, 27613, Stop, TI, yes, , , 0:00:55, 3, FDC_START_TIMERDAEMON, 500, SAP_SYSTEM, ,
23, BTC, 27614, Wait, , yes, , , 0:01:42, , , , , ,
24, BTC, 27615, Wait, , yes, , , 0:01:48, , , , , ,
25, BTC, 27616, Wait, , yes, , , 0:02:03, , , , , ,
26, BTC, 27617, Wait, , yes, , , 0:02:13, , , , , ,
27, BTC, 27618, Wait, , yes, , , 0:09:20, , , , , ,
28, BTC, 27619, Wait, , yes, , , 0:04:46, , , , , ,
29, BTC, 27620, Wait, , yes, , , 0:08:52, , , , , ,
30, BTC, 27621, Wait, , yes, , , 0:04:26, , , , , ,
31, SPO, 27622, Wait, , yes, , , 0:00:16, , , , , ,
32, UP2, 27623, Wait, , yes, , , 0:00:06, , , , , ,
This output offers a comprehensive overview of your SAP system’s work processes, including:
By leveraging the ABAPGetWPTable
function, you gain a deeper understanding of your SAP system’s internal workings and can proactively address potential performance issues before they impact your business operations.
To effectively monitor the health and performance of your SAP system, it’s crucial to keep a close eye on the dispatcher queue. This is where user requests are processed, and any bottlenecks here can significantly impact system responsiveness.
The NETEYE plugin utilizes the GetQueueStatistic
function to retrieve essential information about the dispatcher queue. This function provides valuable data on the current state of the queue, including the number of requests waiting to be processed and historical peak values.
Here’s an example of the output generated by GetQueueStatistic
:
OK: Requests in dialog-queue of dispatcher: 1 of 14000 (Peak since start of DP: 94)
his output tells us:
By monitoring these metrics, you can:
The GetQueueStatistic
function is a valuable tool for maintaining the health and performance of your SAP environment. By integrating this function into your NETEYE monitoring setup, you can gain valuable insights into your dispatcher queue and ensure optimal system performance.
In any SAP system, lock contention can be a major performance bottleneck. When multiple users or processes try to access the same resources simultaneously, locks are used to ensure data consistency. However, excessive lock contention can lead to delays and hinder system performance.
To monitor lock contention effectively, the NETEYE plugin incorporates the EnqGetStatistic
function. This function provides critical information about the lock table, including the current number of lock entries and the peak number of entries since the instance started.
Here’s an example of the output generated by EnqGetStatistic
:
OK: Current entries in lock-table: 0 of 250000 (Peak since start of instance: 2286)
This output reveals:
By monitoring these metrics, you can:
The EnqGetStatistic
function provides valuable insights into the lock contention within your SAP system. Integrating this function into your NETEYE monitoring strategy helps you maintain optimal performance and prevent costly delays caused by lock conflicts.
A key advantage of all the plugins we’ve explored so far is their ability to customize alert thresholds. This means you can fine-tune the monitoring system to match your specific requirements and risk tolerance.
Instead of relying on generic, one-size-fits-all alerts, you can define thresholds that align with your SAP system’s unique characteristics and performance expectations. This allows you to:
This flexibility makes the NETEYE plugin a powerful tool for proactive SAP monitoring. You can tailor the alerting system to your specific needs, ensuring that you’re always aware of potential problems before they impact your business operations.
Stay tuned for Part 2 of this blog, where we’ll dive into the check_sap_health
plugin and explore its key functionalities.