vRops: How to Monitor Linux Process Automatically – via Rest API


In vRops, if you want to monitor a Linux process, you can configure monitoring in UI (see image1).
The challenge is when you have 100s or 1000s of Linux VMs, you have to execute this step per process per VM. If you want to monitor 4 processes in 100 VMs you need to do it 400 times.

Can we automate this? Yes, this blog post covers the details. VRops version used for this blog post is 6.6

Solution: High level steps

  1. Create a Multiprocess Resource via Rest API
  2. Set the resource as child to VM’s Linux Object
  3. Start monitoring the process

Detailed Steps

  • Pre-Requisite: Get EP Ops Adapter Instance ID used for multiprocess objects
    • Multiprocess object we create should be associated with an Epops adapter instance. To identify the Epops adapter instance, monitor a Linux process on any test VM.
    • This step is done in UI. Take a test VM and Monitor a Linux process ( see Image 1)
    • Record the Epops Adapter Instance Id, which the created multiprocess object is associated with. (EPOPS-Adapter-Instance-ID See Image2)
  • Step1: Get vRops Token via REST API.
    • I am skipping the details as there are many blogs available.
  • Step2: Get Agent ID and Parent ID of VMs Epops Agent
    • Url: https://<vRopsFqdn>/suite-api/api/resources?name=<testvm>
    • Action: GET
    • Headers: Authorization = vRealizeOpsToken xxxx , includeRelated = yes
    • Copy the Identifier of EP Ops Adapter – Linux Resource (EPOPSAdapter-Linux-Id; see Image3)
    • Copy agentID and parentID of EP Ops Adapter – EP Ops Agent Resource (EPOPSAgent-AgentID, EPOPSAgent-ParentID; See Image4)
  • Step3: Create a Multiprocess object
    • Url: https:// <vRopsFqdn>/suite-api/api/resources/adapters/<EPOPS-Adapter-Instance-ID>
    • Action: POST
    • Headers: Authorization = vRealizeOpsToken xxxx content-type=application/xml
    • Body: See XML Body below. Caution: Don’t miss | in parentID
    • Copy the newly created resource Id from the API call result ( Multiprocess-resourceID see below )
      <ops:link href=”/suite-api/api/resources/28c2xxxx ” rel=”SELF” name=”linkToSelf”/>
  • Step4: Set the created multiprocess object as a child to VM OS Instance
    • Url: https:// <vRopsFqdn>//suite-api/api/resources/< EPOPSAdapter-Linux-Id
    • Action: POST
    • Headers: Authorization = vRealizeOpsToken xxxx content-type=application/json
    • Body :
      “uuids” : [ ” Multiprocess-resourceID ” ]
  • Step5: Start monitoring the process
    • Url: https://<vRopsFqdn>/suite-api/api/resources/< Multiprocess-resourceID >/monitoringstate/start
    • Action: PUT
    • Headers: Authorization = vRealizeOpsToken xxxx



Image 3

Image 4

XML Body
<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>

<ops:resource xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xs=”http://www.w3.org/2001/XMLSchema” xmlns:ops=”http://webservice.vmware.com/vRealizeOpsMgr/1.0/”>

<ops:description> mt-api-testvm02-ntpd </ops:description>



<ops:adapterKindKey>EP Ops Adapter</ops:adapterKindKey>




<ops:identifierType name=”agentID” dataType=”STRING” isPartOfUniqueness=”false”/>




<ops:identifierType name=”discoveryMode” dataType=”STRING” isPartOfUniqueness=”false”/>




<ops:identifierType name=”monitoredResourceID” dataType=”STRING” isPartOfUniqueness=”true”/>

<ops:value> mt-api-testvm02-ntpd </ops:value>



<ops:identifierType name=”Override_agent_configuration_data” dataType=”STRING” isPartOfUniqueness=”false”/>




<ops:identifierType name=”parentID” dataType=”STRING” isPartOfUniqueness=”true”/>




<ops:identifierType name=”process.query” dataType=”STRING” isPartOfUniqueness=”false”/>