How to monitor your EntireX environment with command line scripts
Tags: webmethods, entirex, cobol
Published: 2019-09-24 11:36:28

---
title: How to monitor your EntireX environment with command line scripts
published: true
tags: #webmethods, #entirex, #cobol
canonical_url: http://techcommunity.softwareag.com/techniques-blog/-/blogs/how-to-monitor-your-entirex-environment-with-command-line-scripts
---

# webMethods EntireX

**EntireX is used in distributed and hybrid environments for COBOL or Natural integration. EntireX Monitoring Scripts provide you with a simple way to monitor your EntireX environment. See how easy it is to monitor EntireX Brokers as well as ACI or RPC Servers from the command line.**

By Juergen Lind, Director, Product Management Adabas & Natural, and Peter Hofer, Sr. Lead Software Engineer, Software AG

| Issue 2, 2018 | [<font color="#000000"><img alt="" id="yui_patched_v3_11_0_1_1435667347988_855" src="http://techcommunity.softwareag.com/image/image_gallery?uuid=202eb7e1-9148-4c65-b29a-54c4302ab65e&amp;groupId=10157&amp;t=1326987658425" style="width: 22px; height: 22px; vertical-align: text-bottom;"> <span id="yui_patched_v3_11_0_1_1492771711676_1198">Download PDF</span> </font>](http://techcommunity.softwareag.com/ecosystem/download/techniques/2018-issue2/SAG_webMethods_EntireX_TECHniques_Apr18_WEB.pdf) |
|-|-|-|
## Introduction

Imagine this scenario: You have an EntireX production environment with Broker and RPC or ACI Servers that you want to monitor. You also want to receive notifications when a component of your environment goes down and is no longer available.

To do this, you can use the monitoring scripts available with EntireX. They allow you to define your environment, to monitor it and to define actions in case of an error. Although the scripts will be installed and run on Microsoft® Windows®, you can monitor your EntireX environment running on any other operating system.

After the installation of EntireX on Windows you can find the shortcut to the monitoring scripts under _\<your installation name\> \>\> Administration_ as shown in Figure 1.

![](http://techcommunity.softwareag.com/documents/10157/9581666/EntireX_1.jpg/9aa522b3-78bf-4c81-9bca-d7ed598ab6be?t=1523445358663)  
_Fig 1: EntireX Monitoring Scripts in the Windows Start Menu_

Use the functions offered in the menu of the monitoring scripts to define and to monitor your environment. Functions 7 and 8 are shown in the screenshot (see Figure 2).

![](http://techcommunity.softwareag.com/documents/10157/9581666/EntireX_2.jpg/fb92fe0c-7487-4b7c-ba91-f291d6d1a758?t=1523445361866)  
_Fig. 2: Menu of EntireX Monitoring Scripts_

## Define your environment

Select function 7 _Define your Environment_ to define your environment. This opens an editor with an example definition of an environment. Adjust this definition to your needs.  
Here you see an example of a basic environment:

ENVIRONMENT MyProductionServers  
ERROREXIT handle\_error.bat  
BROKER myProductionBroker localhost:1971  
@rem Example of a definition of an RPC Service  
RPCSERVICE myRPCServer RPC SRV1 CALLNAT  
@rem Example of a definition of an ACI Service  
SERVICE myACIServer ACLASSASERVER ASERVICE

An environment is defined by the keyword _ENVIRONMENT_ with your self-defined meaningful name of the environment. It needs the definition of:

- A user-written exit to handle outages
- The EntireX Broker
- ACI or RPC Services

Please note that the EntireX Broker does not have to run on the local PC; instead, it can run anywhere in your network (as long as the EntireX Broker is accessible from the PC where the monitoring script is running).

Use the keyword _ERROREXIT_ to define your own error routine (i.e., a bat file) called in case of an outage. The bat file has to be in the _PATH_ so that the monitoring script can call it. The error exit is called in case of an outage with the information about the component (Broker or Server) which caused the error. See the provided file _handle\_error.bat_ as an example. Adjust the error exit to your needs (for example send a notification in case of an outage).

Use the keyword _BROKER_ followed by your logical name of the Broker and the Broker ID to define the Broker to be monitored. See the provided example environment for examples how to specify user ID and password if your Broker runs with Security.

Use the keyword _RPCSERVICE_ (for an RPC Server) or _SERVICE_ (for an ACI Service) followed by your logical name and the Class, Server and Service to define the Server(s) to be monitored. You can define multiple servers.

Example:

RPCSERVICE myCICSRPCServer RPC CICSSRV CALLNAT  
@rem my CICS RPC Server  
RPCSERVICE myBATCHRPCServer RPC BATCHSRV CALLNAT  
@rem my Batch RPC Server

 

In this case the monitoring script will first check if the CICS® RPC Server can be called. Secondly it will check the availability of the Batch RPC Server.

The definition of the environment is stored under _My Documents/ Software AG/EntireX_

## Monitor your environment

Select function 8 _Monitor your Environment_ to start the monitoring of your environment defined in the previous step. During execution, the definition of the environment will be passed. The keyword _BROKER_ checks if the defined Broker can be accessed.

The keyword _SERVICE_ checks if the defined (ACI) Service is registered at the Broker.

The keyword _RPCSERVICE_ defines an RPC Server. During execution this service will be "pinged" using the RPC-PING. This checks if the defined Service can be called.

In case of an outage or error situation, your self-defined, user-written error exit is called.

The entire check of the environment is repeated after a specified time in which the default is 60 seconds.

You might ask yourself, "how are these checks performed in the end?" Effectively the command line utility _etbinfo_ is called for all checks.

## Handling outages

If the check of a component of the Environment _(BROKER, SERVICE or_ _RPCSERVICE__)_ fails the specified _ERROREXIT_ is called with the information about

- The Object _(BROKER or SERVICE)_
- The Error Number and Error Text returned by _ETBINFO_
- The environment name
- The Broker name and Broker ID
- In case of a failing Service, the Name, Class, Server and Service

In case of an outage you can use this information to send a notification about the checked environment (using your defined environment name) and the component (Broker or Service) which is not available. Or you can try to automatically restart the missing component.

To learn more, read _Monitoring EntireX with Command-line Scripts_ from [webMethods EntireX documentation](http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/index.htm).

## Summary

With EntireX monitoring scripts you can easily monitor your EntireX landscape. You can self-define your EntireX components to be monitored as an environment and EntireX Brokers as well as ACI or RPC Servers can be monitored.

In case of an outage a user-defined Error Exit will be called with all the information which you can adjust to your needs. For example, you might want to send a notification or restart an unavailable component.