!--a11y-->
Configuring Availability Monitoring
(Heartbeat) 
You need the following configuration files in order to configure Availability Monitoring (Heartbeat) and the TREX GRMG server:
● installed.xml (configuration file for the TREX GRMG server)
This file controls whether a TREX server (service) of an instance in a TREX installation is checked.
● GRMG_config.xml (XML customizing file)
This file is provided by TREX as a template. It determines which TREX installation is to be checked by CCMS (SAP system) in transaction GRMG. It is uploaded by calling transaction GRMG in the SAP system.
You can find these files in the directory <TREX_DIR>/exe/python_support/grmg.

You can carry out the configuration of Availability Monitoring using a Python script (see Installing Monitoring Functions Using a Script). If you do this, you do not need to work through the steps described here manually.
● You need an open port for accessing the TREX GRMG server by HTTP request (<GRMG_server_port_number>). You have to specify this port during the configuration of availability monitoring.

An example of the port for the TREX GRMG server is 34406, if 44 is the TREX instance number.
The basis for TREX server port numbers is 30000. The ports for the TREX servers are automatically set to predefined values during the installation. The calculation uses the selected TREX instance number.

If the instance number is 44, the ports are as follows:
■ Name server: 34401
■ Preprocessor: 34402
■ Index server: 34403
■ Queue server: 34404
■ HTTP server: 34405
This method of calculation ensures that the ports do not clash with other TREX instances on the same host. If you are using several instances of TREX index servers and preprocessors, the ports are defined differently.
● During the installation of TREX, all files that you require for correct operation of CCMS and GRMG are installed on your machine: The operating system collector SAPOSCOL, the CCMS agent SAPCCMSR, and the library DSRLIB (name extensions depend on the platform).
The TREX installation creates the following directories:
○ On Windows: <disk_drive>:\usr\sap\prfclog
○ On UNIX: /usr/sap/prfclog
Directory |
Storage Of |
\usr\sap\prfclog\logmon |
Templates for log file monitoring |
\usr\sap\prfclog\grmg |
GRMG scenarios |
\usr\sap\prfclog\dsr |
Statistics records |
\usr\sap\prfclog\procmon |
Process monitoring templates |
...
1. Go to the directory <TREX_DIR>/exe/python_support/grmg.
2. Change the configuration file for the GRMG server installed.xml:
<?xml version="1.0" encoding="UTF-8"?>
<components>
<component name="IS_01" installed="X">
<property name="HOST" value="host"/>
<property name="PORT" value="30003"/>
</component>
<component name="QS_01" installed="X">
<property name="HOST" value="host"/>
<property name="PORT" value="30004"/>
</component>
<component name="PP_01" installed="X">
<property name="HOST" value="host"/>
<property name="PORT" value="30002"/>
</component>
<component name="NS_01" installed=" ">
<property name="HOST" value="host"/>
<property name="PORT" value="30001"/>
</component>
<component name="WS_01" installed="X">
<property name="URL" value="http://localhost:30005/TREX?CMD=PING"/>
</component>
</components>

Key for abbreviations:
■ IS_01 = index server
■ QS_01 = queue server
■ PP_01 = preprocessor
■ NS_01 = name server
■ WS_01 = Web server
3. Replace the value for the host name in the following line:
<property name="HOST" value="host"/>
The host name is the name of the server on which the TREX instance is running.

<property name="HOST" value="p77893"/>
4. Replace the URL of the TREX Web server (TREX HTTP server).
○ If TREX is running on IIS (Windows) change the URL to http://<host>:34405/trexhttpserver/trexhttpserver.dll?CMD=PING
○ If TREX is running on the Apache Web Server (UNIX) change the URL to http://<host>:34405/TREX?CMD=PING

The TREX Web server has the port 34405 if your TREX instance number is 44.
Replace <host> with the name of the TREX Web server.
5. Change the ports.
The ports of the TREX server should be checked. Information on the TREX server ports is located in the TREX configuration file topology.ini, which is located in the directory <TREX_DIR>/<trex_hostname>.

You can also display the TREX configuration file using the TREX admin tools on the Landscape ® Ini tab and the ports for the TREX servers on the Landscape ® Tree tab.

This is an example of the topology.ini file with the ports of the TREX Web server (HTTP server), name server, preprocessor, index server, and queue server for the TREX instance number 44.
<topology>
<host>
<pwdf1040>
<httpserver>
<34405>
url=http://pwdf1040.wdf.sap.corp:34405/TREXHttpServer/TrexHttpServer.dll
certfile=
active=yes
read_accesscounter=0
</34405>
</httpserver>
<nameserver>
<34401>
<info>
user=D035410
platform=windows
uname=Windows 2000
sap_retrieval_path=D:\usr\sap\trex_44\
trexdaemon=yes
date_started=2004-07-01 14:55:11.461
sapsystem=44
</info>
active=yes
</34401>
</nameserver>
<preprocessor>
<34402>
servicemode=any
active=yes
read_accesscounter=1
</34402>
</preprocessor>
<indexserver>
<34403>
<index>
<xxtrextestgrmgyy>
assigned=yes
type=master
</xxtrextestgrmgyy>
<olga_test>
assigned=yes
type=master
</olga_test>
</index>
active=yes
read_accesscounter=3
write_accesscounter=0
backup_accesscounter=0
</34403>
</indexserver>
<queueserver>
<34404>
<queue>
<xxtrextestgrmgyy>
type=master
assigned=yes
</xxtrextestgrmgyy>
<olga_test>
type=master
assigned=yes
</olga_test>
</queue>
active=yes
read_accesscounter=401
write_accesscounter=0
backup_accesscounter=0
</34404>
</queueserver>
</pwdf1040>
</host>
You have now changed the GRMG scenario according to the TREX installation to be checked.
...
1. Call the script TREXSettings.bat.
This script defines the environment variables. It is located in the directory <TREX_DIR>.
2. Change the template for the XML customizing file GRMG_config.xml. This file is located in the directory <TREX_DIR>/exe/python_support/grmg.
3. Enter the URL of the TREX GRMG server in the following tag:
<scenstarturl>http://host: <GRMG_server_port_number></scenstarturl>/
It must end with a forward slash (/).

If your TREX instance number is 44, the GRMG_server_port_number value is 34406.
4. Choose a meaningful description for the scenario in the following tag:
<scendesc>TREX_instance_on_host_host_name</scendesc>
We recommend that you replace instance with your TREX instance and host_name with your host name.
5. Start the TREX GRMG server in one of the following ways:
a. Manually in a shell:
Python TREXgrmg.py <GRMG_server_port_number>
The Python script TREXgrmg.py is located in the directory <TREX_DIR>/exe/python_support/grmg.
b. Automatically using the TREX daemon:
To configure the automatic start of the TREX GRMG server, proceed as explained below.

If the TREX GRMG server does not start using the Python script ccms_config.py after configuration of the availability monitoring, you have to perform the same steps.
i. Go to the directory <TREX_DIR>/exe/python_support/grmg.
ii. Check the entry for the port number of the TREX GRMG server in the XML customizing file GRMG_config.xml in the tag <scenstarturl>http://host:<GRMG_server_port_number></scenstarturl>.
iii. Open the configuration file TREXDaemon.ini in the directory <TREX_DIR>/<trex_hostname>.
You can also change the TREX configuration file using the TREX admin tools on the Landscape ® Ini tab.
iv. Add the value grmg to the section [daemon] for the parameter programs.
v. Edit the parameter arguments in the section [grmg].
vi. In the GRMG_config.xml file, add the path and the defined port number for the GRMG server to the value TREXgrmg.py.

C:\sap\<SAPSID>\TRX<instance_number>\exe\python_support\grmg\
TREXgrmg.py 34406
vii. Save the file.
viii. You have to restart TREX so that the changes to the TREX configuration file TREXDaemon.ini take effect.
If you have used the TREX admin tool to change the configuration file, the system asks you whether it should restart the TREX services.

[daemon]
# references sections below
programs=nameserver,preprocessor,indexserver,queueserver,grmg
[grmg]
executable=python
arguments=D:\usr\sap\<SAPSID>\TRX<instance_number>\exe\
python_support\grmg\TREXgrmg.py 34406
startdir=D:\usr\sap\<SAPSID>\TRX<instance_number>\exe\
python_support\grmg
instances=1

Make sure that you use the same port number in TREXDaemon.ini as you specified in the XML customizing file GRMG_config.xml. Otherwise the TREX GRMG server does not start automatically.
If you change the configuration later on, change the configuration file for the TREX GRMG server installed.xml and restart the TREX GRMG server.
6. Copy the file GRMG_config.xml to the directory SAPCCMSR GRMG to be loaded automatically into the SAPCCMS system.

If you install multiple TREX instances on your host, you have to specify your TREX instance when renaming the XML file, for example, GRMG_config_trex48.xml.
On Windows: Copy the file GRMG_config.xml to the directory <disk_drive>:\usr\sap\prfclog\grmg.

During the TREX installation, the share saploc was created in Windows in the directory <disk_drive >\usr\sap\prfclog\. The SAPCCMS system needs this share to load the XML customizing file grmgconfig.xml.
On
UNIX: Copy the file
GRMG_config.xml to the directory.
/usr/sap/prfclog/grmg.
The file is loaded automatically and activated in the configured SAP system by SAPCCMSR. You can execute it manually by carrying out the next step.
7. Load the XML customizing file GRMG_config.xml by calling up the transaction GRMG in the SAP system.
You can now start transaction RZ20 in order to check the availability of the TREX services.