Availability Monitoring of J2EE
Applications
Each J2EE application can be monitored using the GRMG architecture. To do this, the application developer has to follow the steps described in this section.
...
1.
Create a grmg-customizing.xml. For more information, see
GRMG: Instrumentation
of a Component.
2. Make sure you modify the values of some of the XML tags according to the specific requirements defined in this step:
a. Leave the SCENEVERSION tag empty. This tag is required by the GRMG framework to maintain the versions you upload.
b. The SCENENAME tag – the value of this tag has an 8 symbol limitation. It is the technical name of the scenario and does not change from one instance of the scenario to another (SCENDESC and the SCENSTARTURL tags do change, but not the SCENNAME). This technical name is used in the CCMS in pre-defined monitors, or views, on the monitoring data. You have to put your component name in an abbreviated form as the value of SCENNAME.

If you want all versions of your heartbeat to appear in one monitor, leave the SCENNAME constant.
If you want to separate the monitor trees, add a version number or other information to the SCENNAME so that the technical name changes between releases or support packages.
Examples:
J2EE_630 – Release specific. J2EE_630 needs a new monitor definition.
BMS – Generic. A BMS monitor automatically picks up all versions and instances of the heartbeat for BMS, the Broadcast Messaging Server.
BMS_40 – Release-specific. BMS_640 needs a new monitor definition. Its monitoring trees will not automatically appear in the BMS monitors in the CCMS.
c. The SCENEDESC tag – this tag has a 26 symbol limitation. It is advisable for this tag to have the following template content: ‘GRMG: <your_application_name> <SID> on <HOST>’ or ‘GRMG: <your_scenario_name : <your_version> <SID> on <HOST>’, where <SID> and <HOST> are the application system ID and server host correspondingly. However, as you do not know the system ID and the server host you can provide pattern strings %SID and %HOST, which will be replaced at runtime with the correct ones: SAPSYSTEMNAME and HOST NAME correspondingly. This automates the process of deployment as there will not be many additional settings for the administrator to make.
For example, GRMG: <your_scenario_name>:<your_version> %SID on %HOST.
d. The SCENESTARTURL tag – at the time when you develop your application with a GRMG configuration, you do not know the J2EE Engine host and the port. Therefore, you can handle this tag in the following ways:
i. Leave it empty for the administrator to manually edit it. This is why the J2EE Engine administrator has to enter the host and the HTTP port of the Engine manually in the SCENSTARTURL tag for each GRMG scenario.
ii. At the place where the host and the port must be specified, replace them with pattern strings %HOST or %PORT correspondingly. This way the J2EE Engine system will take the first HPPT port defined in the dispatcher node and replace it automatically. For example, http://%HOST:%PORT/MyGRMGApp/....
If you are using HTTPS, use the %HTTPSPORT pattern string in place of the HTTPS port.
By following this recommendation you will completely automate the upload process and, if there are no specific properties to be configured, you can simply choose the Upload option.
3. Add the grmg-customizing.xml to the META-INF directory of the application EAR file.
4. Modify the application-j2ee-engine.xml, situated in the META-INF directory.
In this file are specified the libraries the application uses in order to run properly. You have to add the following code to this XML:
<application-j2ee-engine> <reference reference-type="weak"> <reference-target target-type="library" provider-name="sap.com"> com.sap.util.monitor.grmg </reference-target> </reference> <reference reference-type="weak"> <reference-target target-type="library" provider-name="engine.sap.com"> sapxmltoolkit </reference-target> </reference> </application-j2ee-engine> |
For more information about the
syntax of the application-j2ee-engine.xml, see
application-j2ee-engine.dtd.
5. Using parameters in the URL of your scenario, for example, “http://MyHost:MyPort/MyGRMGApp?type=grmg”.
If you use HttpServletRequest.getInputStream() method, you cannot use HttpServletRequest.getParameter(). Therefore, if you want to have parameters in the URL, you have to use HttpServletRequest.getQueryString().
When the application is deployed on the J2EE Engine, you can manage your GRMG configuration and then upload the grmg-customizing.xml on an ABAP system using the GRMG runtime in the Visual Administrator. For more information, see The GRMG Runtime Control in the Visual Administrator.

Adding the grmg-customizing.xml to your application and uploading it on an ABAP system is not enough for monitoring the availability of the application. The XML file only provides information to the ABAP system about the application components that will be monitored. Using this information, the ABAP system then sends requests to the application to provide monitored data. Therefore, the application itself must do the monitoring and then provide a response to the ABAP system, which will visualize the monitors data in the CCMS.
To do the monitoring, the
application developer must create and attach a Servlet or JSP component to the
application. For more information about how such a component is developed, see
GRMG:
Instrumentation of a Component.