Guidelines for Monitoring DevTest Services
search cancel

Guidelines for Monitoring DevTest Services

book

Article ID: 10629

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

This document give the option to use DevTest features as a monitoring tool for DevTest services.  

Customers have faced issues where some services stopped suddenly (Coordinator, Simulator, etc…) and would not be aware they were no longer running. They have had to log in to the server machines and manually check the services to see the issue. They would like to set up a monitoring tool or Test case where they can get the notification when the services are down.

Environment

All Supported DevTest releases and platforms..

Resolution

There are a couple of Options within the DevTest tool that can be used.

 Option1: Use the ServiceManger command-line tool.  This utility lets you perform various actions on a Registry, Coordinator, Simulator, or VSE server.  The ServiceManager is included under the DevTest_Home/bin folder. 

Usage: 
ServiceManager -u <username> -p <password> -m <registry-spec> -u <username> -p <password>  are DevTest credentials  <registry-spec> is your registry connection specification -s all - Status 

For example:
ServiceManager -u admin -p admin -m tcp://[hostname]:2010/Registry -s all 
This above command will attempt to connect to your Registry using admin/admin as credentials and provide you the status of the components connected to that Registry. 

A bash script can be created and run it often to check the status. 
 

Option 2: Using the REST Invoke API 

Follow the below steps for REST Invoke API 

1. In a browser enter the URL : http://[REGISTRYHOSTNAME]:1505/api/swagger/   in a supported browser. If the registry is on a remote computer, replace localhost with the name or IP address of the computer. This will give you the list of API commands you can use. 

2. Click on Coordinator Server 
GET /CoordinatorServers - Gets the list of Coordinator resources registered with the Registry. 

Can also use the Request URL as :  http://localhost:1505/api/Dcm/CoordinatorServers 

The response will look like below:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CoordinatorServerList xmlns="http://www.ca.com/lisa/invoke/v2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ca.com/lisa/invoke/v2.0 CoordinatorServerList.xsd" href="http://localhost:1505/api/Dcm/CoordinatorServers" type="application/vnd.ca.lisaInvoke.coordinatorServerList+xml"><CoordinatorServer name="Coordinator" href="http://localhost:1505/api/Dcm/CoordinatorServers/Coordinator" type="application/vnd.ca.lisaInvoke.coordinatorServer+xml"><ConsoleURL>http://localhost:1505</ConsoleURL><HostAddress>[HOSTNAME]</HostAddress><Status>OK: 0 Coordinators running. Memory used 174mb, allocated 242mb, max 683mb (25%) Our cpu usage 0%, system cpu used 11%</Status><TestList href="http://localhost:1505/api/Dcm/CoordinatorServers/Coordinator/Tests" type="application/vnd.ca.lisaInvoke.testList+xml"/><Link href="http://localhost:1505/api/Dcm/CoordinatorServers/Coordinator/actions" rel="actions"/><Link href="http://localhost:1505/api/Dcm/CoordinatorServers/Coordinator/actions/deployMar" rel="deployMar"/></CoordinatorServer></CoordinatorServerList>

 3. Create a Test Case and add an HTTP step or a REST Step

Configure the URL as http://localhost:1505/api/Dcm/CoordinatorServers 

Assert on the Step response for "Coordinator Running" or  "Status  OK" and if Assertion Fails then Go To- > an Email Step. This  step can send email to a recipient when the step fails. 

Do the same for Simulators / VSE etc... 

http://localhost:1505/ should give you a response that shows that the Registry's Web console is up... 
http://localhost:1507/devtest/ - would show that the Portal is up.

Create Monitor Mar info file and deploy them to the CVS monitor. Configure the Monitors so that it runs every 2 hours for a period of time.

Additional Information

Look under "REST Invoke API "   and "Use the ServiceManager" sections of our documentations for reference.