Skip to main content

Monitor MarkLogic Server

Format the monitor results

The application that issues a request to the Management API specifies the format for the returned view. For example, most Web browsers specify the default return format as HTML. If no return format is specified by the application, the view is formatted as XML. You can explicitly specify the view format by means of the format parameter at the end of the resource address:

format=value

Where value is either HTML, JSON, or XML.

The XML and JSON formats provide a rich set of data for your monitoring application. For example, to return an XML view of the entire cluster, you can enter the following in a browser:

http://monitor_host:8002/manage/LATEST?format=xml

This will return a cluster view in XML format. For example:

<cluster-default xsi:schemaLocation=
  "http://marklogic.com/manage/clusters manage-clusters.xsd">
  <meta>
    <uri>/manage/LATEST</uri>
    <current-time>2011-06-30T16:00:06.81-07:00</current-time>
    <elapsed-time units="sec">0.012</elapsed-time>
  </meta>
  <relations>
    <relation-group array="true">
      <uriref>/manage/LATEST/databases</uriref>
      <typeref>databases</typeref>
      <relation-count>13</relation-count>
    </relation-group>
    <relation-group array="true">
      <uriref>/manage/LATEST/forests</uriref>
      <typeref>forests</typeref>
      <relation-count>13</relation-count>
    </relation-group>
    <relation-group array="true">
      <uriref>/manage/LATEST/groups</uriref>
      <typeref>groups</typeref>
      <relation-count>1</relation-count>
    </relation-group>
    <relation-group array="true">
      <uriref>/manage/LATEST/hosts</uriref>
      <typeref>hosts</typeref>
      <relation-count>1</relation-count>
    </relation-group>
    <relation-group array="true">
      <uriref>/manage/LATEST/requests</uriref>
      <typeref>requests</typeref>
      <relation-count>1</relation-count>
    </relation-group>
    <relation-group array="true">
      <uriref>/manage/LATEST/servers</uriref>
      <typeref>servers</typeref>
      <relation-count>8</relation-count>
    </relation-group>
    <relation-group array="true">
      <uriref>/manage/LATEST/transactions</uriref>
      <typeref>transactions</typeref>
    </relation-group>
  </relations>
  <related-views>
    <related-view array="true">
      <view-type>item</view-type>
      <view-name>query</view-name>
      <view-uri>/manage/LATEST/query</view-uri>
    </related-view>
    <related-view array="true">
      <view-type>item</view-type>
      <view-name>status</view-name>
      <view-uri>/manage/LATEST?view=status</view-uri>
    </related-view>
  </related-views>
</cluster-default>