Generic process status monitoring in sapstartsrv

Sapstarstrv provides a SAPControl webservice interface to monitor an SAP instance. However, the “GetProcessList” webmethod to list the instance processes could only list the processes configured in the SAP profile and retrieved the process status from the OS. Therefore an easy-to-use capability has been introduced enabling any process started via the profile to add a sophisticated monitoring status for itself and additional child processes. Download the Document

PUBLICGeneric process status monitoring insapstartsrv for HDB (or other use cases)Date: 2025-01-08Owner: 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 / 5Table of contentsIntroduction ................................................................................................................................................................. 3Status monitoring ...................................................................................................................................................... 3Status file ................................................................................................................................................................................................................ 3Guidelines .............................................................................................................................................................................................................. 4References ................................................................................................................................................................... 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 / 5IntroductionSapstarstrv 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 followinglimitations: 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 (sharedmemory) 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 + sharedmemory)So, since the monitored processes do not provide a common standard API for reliable status monitoring aspecific implementation for each process type had been implemented. When adding new instance types (likeHDB, MDM...) this approach doesn’t scale and would introduce lots of different protocols or shared memorydependencies.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 itselfand (if necessary) additional (child) processes.Status monitoringA 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 ifavailable and the content is valid adds its information to the GetProcessList result. To improve performancethe status files information is cached by sapstartsrv and only reread when the file was updated. To forcereading status files for some processes a list of processes (without file extension) known to write status filescan be configured in the profile:service/status_procs = <process1> <process2>...<processN>e.g.:service/status_procs = hdbdaemon gwrdRunning processes known to write a status will be listed as status “yellow”, “Running but status infounavailable” if no valid status file is found.Status fileA 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 / 5remaining blocks can be used to describe additional processes. Each text line starts with 2 32Bit integervalues, a file unique id and the actual text line number. An extra final line with negative line number is used tomark the end of the status file. This data is used for plausibility checking of the file only, e.g. to detect aneventually dirty read while the reporting process is updating the file in parallel. The remaining part of theactual text line contains the reported data. The 5 lines of each block contain1. Process name (String)2. Process description (String)3. PID (Integer)4. Status text (String)5. Status (GREEN|YELLOW|GRAY|RED)Example:4711 1 hdbdaemon4711 2 HDB daemon4711 3 136874711 4 Running4711 5 GREEN4711 6 hdbnameserver4711 7 HDB name server4711 8 137024711 9 Initializing4711 10 YELLOW4711 -11Guidelines 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 appropriateinstead 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 operationalo YELLOW: Running but not fully operational (e.g. starting up, shutting down...)o GRAY: Stoppedo 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 ofthese processes. Sapstartsrv only controls processes configured in the profile and stops these viaSIGINT / 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 / 5References How to use the SAPControl Webservice Interface,https://www.sap.com/documents/2016/09/0a40e60d-8b7c-0010-82c7-eda71af511fa.htmlwww.sap.com.