Generic process status monitoring in sapstartsrv
PUBLIC
Generic process status monitoring in
sapstartsrv for HDB (or other use cases)
Date: 2025-01-08
Owner: Server Infrastructure Team
Generic process status monitoring in
sapstartsrv for HDB (or other use cases)
Date: 2025-01-08
Owner: Server Infrastructure Team
© 2025 SAP SE or an SAP affiliate company. All rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to this material. 2 / 5
Table of contents
Introduction ................................................................................................................................................................. 3
Status monitoring ...................................................................................................................................................... 3
Status file ................................................................................................................................................................................................................ 3
Guidelines .............................................................................................................................................................................................................. 4
References ................................................................................................................................................................... 5
Table of contents
Introduction ................................................................................................................................................................. 3
Status monitoring ...................................................................................................................................................... 3
Status file ................................................................................................................................................................................................................ 3
Guidelines .............................................................................................................................................................................................................. 4
References ................................................................................................................................................................... 5
© 2025 SAP SE or an SAP affiliate company. All rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to this material. 3 / 5
Introduction
Sapstarstrv provides a SAPControl webservice interface to monitor an SAP instance. In particular it provides a
“GetProcesssList” webmethod to list the instance processes. So far, this webmethod had the following
limitations:
• It only lists the processes configured in the SAP profile
• In general, the process status is retrieved from the OS (process running or stopped)
To provide better status information specific handling for some process types had been implemented:
• disp+work: Connection to Message Server /TCP/IP) and dialog queue processing are check (shared
memory)
• jstart/jcontrol: AS Java startup framework provides status information via shared memory API
• Enqueue: Enqueue statistic is polled (TCP/IP)
• Message Server: Client list is polled (TCP/IP)
• Webdispatcher: Webdispatcher provides a MPI API to retrieve status information (TCP/IP + shared
memory)
So, since the monitored processes do not provide a common standard API for reliable status monitoring a
specific implementation for each process type had been implemented. When adding new instance types (like
HDB, MDM...) this approach doesn’t scale and would introduce lots of different protocols or shared memory
dependencies.
Instead of adding even more process specific monitoring functionality sapstartsrv now provides an easy-to-
use capability enabling any process started via the profile to add a sophisticated monitoring status for itself
and (if necessary) additional (child) processes.
Status monitoring
A process configured in the profile can provide an optional status file “<process_name>.status”, e.g.
“hdbdaemon.status” or “gwrd.status”. For each running process sapstartsrv checks for these files and if
available and the content is valid adds its information to the GetProcessList result. To improve performance
the status files information is cached by sapstartsrv and only reread when the file was updated. To force
reading status files for some processes a list of processes (without file extension) known to write status files
can be configured in the profile:
service/status_procs = <process1> <process2>...<processN>
e.g.:
service/status_procs = hdbdaemon gwrd
Running processes known to write a status will be listed as status “yellow”, “Running but status info
unavailable” if no valid status file is found.
Status file
A status file is an UTF8 encoded text file in English language. It consists of 1 or more blocks of 5 text lines.
Each block describes a single process. The first block describes the process configured in the profile; the
Introduction
Sapstarstrv provides a SAPControl webservice interface to monitor an SAP instance. In particular it provides a
“GetProcesssList” webmethod to list the instance processes. So far, this webmethod had the following
limitations:
• It only lists the processes configured in the SAP profile
• In general, the process status is retrieved from the OS (process running or stopped)
To provide better status information specific handling for some process types had been implemented:
• disp+work: Connection to Message Server /TCP/IP) and dialog queue processing are check (shared
memory)
• jstart/jcontrol: AS Java startup framework provides status information via shared memory API
• Enqueue: Enqueue statistic is polled (TCP/IP)
• Message Server: Client list is polled (TCP/IP)
• Webdispatcher: Webdispatcher provides a MPI API to retrieve status information (TCP/IP + shared
memory)
So, since the monitored processes do not provide a common standard API for reliable status monitoring a
specific implementation for each process type had been implemented. When adding new instance types (like
HDB, MDM...) this approach doesn’t scale and would introduce lots of different protocols or shared memory
dependencies.
Instead of adding even more process specific monitoring functionality sapstartsrv now provides an easy-to-
use capability enabling any process started via the profile to add a sophisticated monitoring status for itself
and (if necessary) additional (child) processes.
Status monitoring
A process configured in the profile can provide an optional status file “<process_name>.status”, e.g.
“hdbdaemon.status” or “gwrd.status”. For each running process sapstartsrv checks for these files and if
available and the content is valid adds its information to the GetProcessList result. To improve performance
the status files information is cached by sapstartsrv and only reread when the file was updated. To force
reading status files for some processes a list of processes (without file extension) known to write status files
can be configured in the profile:
service/status_procs = <process1> <process2>...<processN>
e.g.:
service/status_procs = hdbdaemon gwrd
Running processes known to write a status will be listed as status “yellow”, “Running but status info
unavailable” if no valid status file is found.
Status file
A status file is an UTF8 encoded text file in English language. It consists of 1 or more blocks of 5 text lines.
Each block describes a single process. The first block describes the process configured in the profile; the
© 2025 SAP SE or an SAP affiliate company. All rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to this material. 4 / 5
remaining blocks can be used to describe additional processes. Each text line starts with 2 32Bit integer
values, a file unique id and the actual text line number. An extra final line with negative line number is used to
mark the end of the status file. This data is used for plausibility checking of the file only, e.g. to detect an
eventually dirty read while the reporting process is updating the file in parallel. The remaining part of the
actual text line contains the reported data. The 5 lines of each block contain
1. Process name (String)
2. Process description (String)
3. PID (Integer)
4. Status text (String)
5. Status (GREEN|YELLOW|GRAY|RED)
Example:
4711 1 hdbdaemon
4711 2 HDB daemon
4711 3 13687
4711 4 Running
4711 5 GREEN
4711 6 hdbnameserver
4711 7 HDB name server
4711 8 13702
4711 9 Initializing
4711 10 YELLOW
4711 -11
Guidelines
• The reporting process must write the status file exactly in the format described above
• The reporting process must update the status file whenever any of its process status changes
• The reporting process must use a different file id whenever it updates the status file
• The reported status text should reuse standard text status like “Stopped”, “Running” if appropriate
instead of using a different text for the same semantics (e.g. “Halted”, “Started”...).
• The reported status should follow the common semantics:
o GREEN: Running and fully operational
o YELLOW: Running but not fully operational (e.g. starting up, shutting down...)
o GRAY: Stopped
o RED: Stopped with serious error (e.g. could not be started...)
• If the reporting process controls child processes it is fully responsible to control the life cycle of
these processes. Sapstartsrv only controls processes configured in the profile and stops these via
SIGINT / SIGQUIT / SIGKILL signals.
remaining blocks can be used to describe additional processes. Each text line starts with 2 32Bit integer
values, a file unique id and the actual text line number. An extra final line with negative line number is used to
mark the end of the status file. This data is used for plausibility checking of the file only, e.g. to detect an
eventually dirty read while the reporting process is updating the file in parallel. The remaining part of the
actual text line contains the reported data. The 5 lines of each block contain
1. Process name (String)
2. Process description (String)
3. PID (Integer)
4. Status text (String)
5. Status (GREEN|YELLOW|GRAY|RED)
Example:
4711 1 hdbdaemon
4711 2 HDB daemon
4711 3 13687
4711 4 Running
4711 5 GREEN
4711 6 hdbnameserver
4711 7 HDB name server
4711 8 13702
4711 9 Initializing
4711 10 YELLOW
4711 -11
Guidelines
• The reporting process must write the status file exactly in the format described above
• The reporting process must update the status file whenever any of its process status changes
• The reporting process must use a different file id whenever it updates the status file
• The reported status text should reuse standard text status like “Stopped”, “Running” if appropriate
instead of using a different text for the same semantics (e.g. “Halted”, “Started”...).
• The reported status should follow the common semantics:
o GREEN: Running and fully operational
o YELLOW: Running but not fully operational (e.g. starting up, shutting down...)
o GRAY: Stopped
o RED: Stopped with serious error (e.g. could not be started...)
• If the reporting process controls child processes it is fully responsible to control the life cycle of
these processes. Sapstartsrv only controls processes configured in the profile and stops these via
SIGINT / SIGQUIT / SIGKILL signals.
© 2025 SAP SE or an SAP affiliate company. All rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to this material. 5 / 5
References
• How to use the SAPControl Webservice Interface,
https://www.sap.com/documents/2016/09/0a40e60d-8b7c-0010-82c7-eda71af511fa.html
www.sap.com.
References
• How to use the SAPControl Webservice Interface,
https://www.sap.com/documents/2016/09/0a40e60d-8b7c-0010-82c7-eda71af511fa.html
www.sap.com.