Skip to main content

System Monitoring Data

The System Monitoring API allows you to fetch the latest system health metrics, including CPU, memory, disk usage, NSQ queue details, and service status. This helps administrators monitor real-time performance and resource utilization of the Motadata ServiceOps components.

note

This API is available from v8.7.3 onwards.

URL: http://{server-url}/api/system-monitoring-data/get-latest

Method: GET

Headers:

KeyDescription
AuthorizationBearer {access token obtained after authorization}
Content-Typeapplication/json

Request

curl --location --request GET 'http://172.16.13.114/api/system-monitoring-data/get-latest' \
--header 'Authorization: Bearer eyJraWQiOiJmbG90by1rZXktaWQiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJwcmFtb2QuYmFuc29kZUBtb3RhZGF0YS5jb20iLCJ1c2VyX25hbWUiOiJ1dWlkMzYtNTY5ZTUyNDMtYWZiMy00ZjZjLWIxNzctMjU5MGM1MGYxYjE3IiwiaXNzIjoiaHR0cDovLzE3Mi4xNi4xMy4xMTQvYXBpIiwibG9naW5fc291cmNlIjoiTk9STUFMX0xPR0lOIiwiY2xpZW50X2lkIjoiZmxvdG8td2ViLWFwcCIsImF1ZCI6ImZsb3RvLXdlYi1hcHAiLCJsb2dpbl9zc29faWQiOjAsIm5iZiI6MTc2MTgwNTIyOCwiZ3JhbnRfdHlwZSI6InBhc3N3b3JkIiwic2NvcGUiOlsiTk8tU0NPUEUiXSwiZXhwIjoxNzYxOTc4MDI4LCJsb2dpbl9tc3BfcG9ydGFsX2lkIjowLCJpYXQiOjE3NjE4MDUyMjgsImp0aSI6ImY3NTEwOGY5LTQ1OTMtNDlmYS05MDNlLWQ5N2RiMzMwYTI5OCIsInRlbmFudElkZW50aWZpZXIiOiJhcG9sbyJ9.qu0iN2t4PJiZsILWoPE4D_1EjxSnF0UNx5Q4kH80TcCXl7nT_jUVw55o8qIHH5Ly8UZsNUYJAM4m0BqmjPWVftYK0zgyaxNGvEo2vIleAPSr8IXt7btw5UDNuvomjlK0xUbSFfyRnFirqumw1HApxQMRsQT5mXhAyMMNayZioDs-TR9BqJFuN6eQ0utmftlPvnb8V6kjVHId9Cb_VgpsQeAPUaZS_mNkeD1K4QaWDlNz3omsPH4gqcuTbs_ea1Wmi2GqTyp69-lwPfI_6ULfXgyjMllSZgi9QNCBTZ26vWrkGkRK6d-zQNMiVwHmJEhNXlrcOab4Crp9XNTSPshskw' \
--header 'Content-Type: application/json' \
--data '{"qualDetails":{"type":"FlatQualificationRest","quals":[]}}'

Response:

{
"cpu": {
"avg_cpu": 1.6132784966091325,
"core": 8,
"load_avg": {
"1 min": 0.06,
"15 min": 0.08,
"5 min": 0.05
},
"usage": [
1.9369665134961769,
1.8576360348114263,
1.4790468365205696,
1.5116661189986549,
1.3945857260142058,
1.575319986858901,
1.4435695537769964,
1.7074372023961295
]
},
"disk": {
"io": 318,
"usage": {
"total_gb": 58.460209152,
"used_gb": 11.270025216,
"free_gb": 47.190183936,
"used_percent": 19.278113060966422
}
},
"memory": {
"total_gb": 8.053211136,
"used_gb": 6.396706816,
"free_gb": 0.509042688,
"used_percent": 79.43051172972501
},
"nsq_data": {
"active": true,
"broadcast_address": "127.0.0.1",
"hostname": "localhost.localdomain",
"http_port": 4151,
"size_in_mb": 50.953125,
"start_time": "2025-10-30T10:51:50+05:30",
"stats": {
"actionNodeExecutorQueue": [
{
"Topic Name": "actionNodeExecutorQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 15,
"Finish count": 15,
"Ready count": 10,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "actionNodeExecutorQueue",
"Alert message": ""
}
],
"asset_discovery_data_queue": [
{
"Topic Name": "asset_discovery_data_queue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 1,
"Finish count": 1,
"Ready count": 10,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "asset_discovery_data_queue",
"Alert message": ""
}
],
"createAuditEventQueue": [
{
"Topic Name": "createAuditEventQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 20,
"Finish count": 20,
"Ready count": 4,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "createAuditEventQueue",
"Alert message": ""
}
],
"createEventQueue": [
{
"Topic Name": "createEventQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 24,
"Finish count": 24,
"Ready count": 5,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "createEventQueue",
"Alert message": ""
}
],
"createRequestFromEmail": [
{
"Topic Name": "createRequestFromEmail",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 9,
"Finish count": 9,
"Ready count": 1,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "createRequestFromEmail",
"Alert message": ""
}
],
"discoveryPatternComponentDataQueue": [
{
"Topic Name": "discoveryPatternComponentDataQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 1,
"Finish count": 1,
"Ready count": 10,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "discoveryPatternComponentDataQueue",
"Alert message": ""
}
],
"eventWiseWorkflowProcessQueue": [
{
"Topic Name": "eventWiseWorkflowProcessQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 13,
"Finish count": 13,
"Ready count": 10,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "eventWiseWorkflowProcessQueue",
"Alert message": ""
}
],
"exportReportQueue": [
{
"Topic Name": "exportReportQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 1,
"Finish count": 1,
"Ready count": 5,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "exportReportQueue",
"Alert message": ""
}
],
"flowNodeExecutorQueue": [
{
"Topic Name": "flowNodeExecutorQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 2,
"Finish count": 2,
"Ready count": 10,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "flowNodeExecutorQueue",
"Alert message": ""
}
],
"pattern_discovery_data_queue": [
{
"Topic Name": "pattern_discovery_data_queue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 1,
"Finish count": 1,
"Ready count": 10,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "pattern_discovery_data_queue",
"Alert message": ""
}
],
"sendEmailQueue": [
{
"Topic Name": "sendEmailQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 19,
"Finish count": 19,
"Ready count": 5,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "sendEmailQueue",
"Alert message": ""
}
],
"sendSmsQueue": [
{
"Topic Name": "sendSmsQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 1,
"Finish count": 1,
"Ready count": 10,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "sendSmsQueue",
"Alert message": ""
}
],
"tenantOnBoardQueue": [
{
"Topic Name": "tenantOnBoardQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 1,
"Finish count": 1,
"Ready count": 1,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "tenantOnBoardQueue",
"Alert message": ""
}
],
"updateAuditEventQueue": [
{
"Topic Name": "updateAuditEventQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 22,
"Finish count": 22,
"Ready count": 5,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "updateAuditEventQueue",
"Alert message": ""
}
],
"updateEventQueue": [
{
"Topic Name": "updateEventQueue",
"Paused": false,
"Channel Paused": false,
"Deactivated": false,
"Message count": 18,
"Finish count": 18,
"Ready count": 10,
"IN Flight count": 0,
"Requeue count": 0,
"Channel name": "updateEventQueue",
"Alert message": ""
}
]
},
"tcp_port": 4150,
"version": "1.2.1"
},
"service_details": {
"main_service": {
"cpu_percent": 16.16893352776016,
"createdAt": "2025-10-30T10:50:48+05:30",
"memory_percent": 26.786366,
"pid": 454358,
"status": "active",
"usedMemory": 2338131968
},
"analytics_service": {
"cpu_percent": 9.28829029234108,
"createdAt": "2025-10-30T10:50:48+05:30",
"memory_percent": 21.59191,
"pid": 454354,
"status": "active",
"usedMemory": 1783992320
},
"chat_server": {
"status": "active",
"usedMemory": 81874944
},
"discovery_service": {
"cpu_percent": 0.028448271138665025,
"createdAt": "2025-10-30T10:50:48+05:30",
"memory_percent": 0.3782076,
"pid": 454373,
"status": "active",
"usedMemory": 12582912
},
"file_server": {
"cpu_percent": 0.42840034515476116,
"createdAt": "2025-10-30T10:50:48+05:30",
"memory_percent": 4.7559757,
"pid": 454517,
"status": "active",
"usedMemory": 363249664
},
"nginx": {
"cpu_percent": 0.005634068479362691,
"createdAt": "2025-10-30T10:50:48+05:30",
"memory_percent": 0.42637363,
"pid": 454430,
"status": "active",
"usedMemory": 178905088
},
"elasticsearch": {
"status": "active",
"usedMemory": 1203818496
}
},
"time": 1761805198424
}

Response Body Fields

Here's a detailed breakdown of the fields in the API response:

  • cpu: Object containing CPU usage details.

    • avg_cpu (number): Average CPU usage.
    • core (number): Number of CPU cores.
    • load_avg (object): System load average over different time periods.
      • 1 min (number): Load average over 1 minute.
      • 5 min (number): Load average over 5 minutes.
      • 15 min (number): Load average over 15 minutes.
    • usage (array of numbers): CPU usage percentage for each core.
  • disk: Object containing disk usage details.

    • io (number): Disk I/O operations.
    • usage (object): Detailed disk space usage.
      • total_gb (number): Total disk space in GB.
      • used_gb (number): Used disk space in GB.
      • free_gb (number): Free disk space in GB.
      • used_percent (number): Percentage of disk space used.
  • memory: Object containing memory usage details.

    • total_gb (number): Total memory in GB.
    • used_gb (number): Used memory in GB.
    • free_gb (number): Free memory in GB.
    • used_percent (number): Percentage of memory used.
  • nsq_data: Object containing NSQ queue details.

    • active (boolean): Indicates if NSQ is active.
    • broadcast_address (string): Broadcast address of NSQ.
    • hostname (string): Hostname of the NSQ server.
    • http_port (number): HTTP port for NSQ.
    • size_in_mb (number): Size of NSQ data in MB.
    • start_time (string): NSQ start time (ISO 8601 format).
    • stats (object): Object containing statistics for various NSQ topics/queues.
      • Each key (e.g., actionNodeExecutorQueue, asset_discovery_data_queue) is an array of objects, where each object represents a channel within that topic.
        • Topic Name (string): Name of the NSQ topic.
        • Paused (boolean): Indicates if the topic is paused.
        • Channel Paused (boolean): Indicates if the channel is paused.
        • Deactivated (boolean): Indicates if the channel is deactivated.
        • Message count (number): Number of messages in the channel.
        • Finish count (number): Number of messages finished processing.
        • Ready count (number): Number of messages ready for processing.
        • IN Flight count (number): Number of messages currently in flight.
        • Requeue count (number): Number of messages requeued.
        • Channel name (string): Name of the NSQ channel.
        • Alert message (string): Any alert messages for the channel.
    • tcp_port (number): TCP port for NSQ.
    • version (string): NSQ version.
  • service_details: Object containing details for various services.

    • Each key (e.g., main_service, analytics_service, chat_server, discovery_service, file_server, nginx, elasticsearch) is an object with service-specific metrics.
      • cpu_percent (number, optional): CPU percentage used by the service.
      • createdAt (string, optional): Timestamp when the service was created (ISO 8601 format).
      • memory_percent (number, optional): Memory percentage used by the service.
      • pid (number, optional): Process ID of the service.
      • status (string): Status of the service (e.g., "active").
      • usedMemory (number): Used memory in bytes.
  • time (number): Timestamp of when the monitoring data was collected.

Authentication

This API uses Bearer Token authentication. To obtain a valid token, you typically need to authenticate with the ServiceOps platform using the access token obtained after authorization. The token should then be included in the Authorization header of your request in the format Bearer YOUR_ACCESS_TOKEN.

Error Responses

Common error responses you might encounter include:

  • 401 Unauthorized: If the provided Authorization token is missing, invalid, or expired.

    {
    "status": "error",
    "message": "Unauthorized: Invalid or missing token"
    }
  • 403 Forbidden: If the authenticated user does not have the necessary permissions to access this resource.

    {
    "status": "error",
    "message": "Forbidden: Insufficient permissions"
    }
  • 500 Internal Server Error: A generic error message indicating an issue on the server side. This could be due to various reasons, and details might be logged on the server for further investigation.

    {
    "status": "error",
    "message": "Internal Server Error: Something went wrong"
    }

Usage Scenarios

This API is primarily useful for administrators and monitoring systems to:

  • Real-time Performance Monitoring: Obtain up-to-the-minute metrics on CPU, memory, and disk utilization to assess system health.
  • Resource Utilization Tracking: Monitor how resources are being consumed by various ServiceOps components (e.g., main_service, analytics_service, elasticsearch).
  • NSQ Queue Management: Keep an eye on the status and message counts of NSQ queues to identify potential bottlenecks or processing delays.
  • Service Health Checks: Verify the operational status of critical ServiceOps services.
  • Automated Alerting: Integrate with external monitoring tools to trigger alerts based on defined thresholds for CPU, memory, or NSQ queue levels.