Skip to main content

Inventory Metric Log

The Inventory Metric Log API providesendpoints provide access to time-serieshistorical metric data collected from devices in your inventory. These endpoints allow you to queryretrieve and retrievefilter historicalmetric metrics, measurements, and sensor data with flexible filtering options. Use these endpointslogs to build dashboards, generate reports, or analyze device performanceperformance, overmonitor time.trends, and generate reports based on collected measurement data.

Base URL: https://control.zequenze.com/api/v1

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Inventory Metric Log API iscategory designedprovides forcomprehensive accessingaccess andto analyzinghistorical time-seriesmetric data collected from various devices in your infrastructure.inventory Thisdevices. APIThese categoryendpoints focusesare essential for monitoring device performance, analyzing trends, and generating detailed reports based on retrievingcollected metricmeasurement logs that contain measurements, sensor readings, and other quantitative data points captured over time.data.

Key Concepts:

  • MetricsMetric Logs: QuantitativeHistorical measurements collected from devices (CPU usage, temperature, bandwidth, etc.)
Parameters: The specific typesrecords of measurements beingtaken trackedfrom (variabledevices, names,including displayvalues, names, units) Time-series Data: All metrics are timestampedtimestamps, and can be filtered by date rangesmetadata Device Association: EveryEach metric log is linked to a specific device in your inventory Parameter Tracking: Metrics are organized by parameters (what is being measured) with support for multiple naming conventions Origin Tracking: Each metric entry records how the data was collected (automatic, manual, API, etc.)

Common Use Cases:

  • BuildingPerformance monitoring and trend analysis
Historical data retrieval for reporting Device health assessments Compliance auditing and data validation Integration with monitoring dashboards with real-time and historicalalerting data Generating performance reports for specific devices or time periods Analyzing trends and patterns in device metrics Troubleshooting issues by examining metric history Creating alerts based on metric thresholdssystems

The API supports flexiblepowerful filtering by device, metric type, parameter names, and time ranges, making it easycapabilities to help you retrieve exactly the data you needneed, with pagination for yourhandling specificlarge usedatasets case.efficiently.


Endpoints

GET /inventory_metric_log/

Description: Retrieves a paginated list of inventory metric logs with comprehensive filtering options. This endpoint is ideal for fetchingquerying historical metric data across multiple metric records across different devices, time periods,devices and metricparameters, types. Usemaking it toperfect buildfor dashboards,dashboard generatecreation, reports,trend oranalysis, performand bulk data analysis.exports.

Use Cases:

  • Fetch all temperature readings from a specific device over the last 24 hours
Retrieve CPU metrics from multiple servers within a date range Build real-timeBuilding monitoring dashboards showing current andwith historical data ExportGenerating performance reports for specific time periods Analyzing device trends across multiple parameters Exporting metric data for external analysis ortools reportingCreating toolsalerts based on historical patterns

Full URL Example:

https://control.zequenze.com/api/v1/inventory_metric_log/?datetime__gte=2024-01-01&device__name=server-01&metric_name=cpu_usage&datetime__gte=2024-01-15T00:00:00Z&limit=10050

Parameters:

Parameter Type In Required Description
datetime__gte string query No Filter recordsmetrics from this datetimedate/time onwards. AcceptsSupports ISO format: 2000-01-01, 2000-01-01 00:01:00, or 2000-01-01 00:01:00+00:00
datetime__lte string query No Filter recordsmetrics up to this datetime.date/time. AcceptsSupports ISO format: 2000-01-01, 2000-01-01 00:01:00, or 2000-01-01 00:01:00+00:00
device__name string query No Filter metrics by exact device name
metric__name string query No Filter by the internal metric name identifier
parameter__name string query No Filter by the parameter's displayparameter name
parameter__short_name string query No Filter by theparameter parameter's abbreviatedshort name
parameter__variable_name string query No Filter by the parameter'sparameter variable name used in data collection
cursor string query No Pagination cursor for retrieving the next setpage of results
limit integer query No Number of results to return per page (defaultrecommended: varies50-100 byfor systemoptimal configuration)performance)
metric_name string query No Alternative parameter to filter byfor metric'smetric parameter name
parameter_name string query No Alternative parameter to filter byfor metric'smetric parameter name

cURL Example:

curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?datetime__gte=2024-01-01T00:00:00Z&device__name=web-server-01&metric_name=memory_usage&datetime__gte=2024-01-15T00:00:00Zparameter__name=cpu_usage&limit=50"100" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example Response:

{
  "count": 1247,
  "next": "https://control.zequenze.com/api/v1/inventory_metric_log/?cursor=eyJpZCI6MTAwfQ%3D%3D&limit=50"eyJkYXRldGltZSI6IjIwMjQtMDEtMTVUMTA6MzA6MDBaIiwiaWQiOjEwMH0%3D",
  "previous": null,
  "results": [
    {
      "id": 15234,1245,
      "datetime": "2024-01-15T14:15T10:30:00Z",
      "device": {
        "id": 42,
        "name"device_name": "web-server-01",
      "type"parameter_name": "server"CPU Usage",
      "location"metric_name": "datacenter-east"
      }cpu_usage",
      "metric": {
        "id": 7,
        "name"origin": "memory_usage",
        "unit": "percentage"
      },
      "parameter": {
        "name": "Memory Utilization",
        "short_name": "MEM",
        "variable_name": "memory_percent",
        "unit": "%"
      }au",
      "value": 67.8,85.7,
      "status"result": 85.7,
      "original_value": "normal",
      85.7%"created_at": "2024-01-15T14:30:15Z"
    },
    {
      "id": 15235,1244,
      "datetime": "2024-01-15T14:15T10:25:00Z",
      "device": {
        "id": 42,
        "name"device_name": "web-server-01",
      "type"parameter_name": "server"Memory Usage",
      "location"metric_name": "datacenter-east"memory_usage",
      "origin": "au",
      "value": 72.3,
      "result": 72.3,
      "original_value": "72.3%"
    },
      "metric":
    {
      "id": 7,1243,
      "name"datetime": "memory_usage"2024-01-15T10:20:00Z",
      "unit"device_name": "percentage"
      }web-server-01",
      "parameter": {
        "name"parameter_name": "MemoryDisk Utilization"Usage",
      "short_name"metric_name": "MEM"disk_usage",
      "variable_name"origin": "memory_percent",
        "unit": "%"
      }sc",
      "value": 65.2,45.8,
      "status"result": 45.8,
      "original_value": "normal",45.8 "created_at": "2024-01-15T14:25:15Z"GB"
    }
  ]
}

Response Codes:

Status Description
200 Success - Returns paginated list of metric logslog matchingdata
the filtercriteria401 Unauthorized - Invalid or missing API token 400 Bad Request - Invalid query parameters or date format 401429 UnauthorizedToo Many Requests - InvalidRate orlimit missing authentication token 403 Forbidden - Insufficient permissions to access metric dataexceeded

GET /inventory_metric_log/{id}/

Description: Retrieves a specific inventory metric log recordentry by its unique ID. This endpoint provides detailed information about a single metric entry,measurement, including all associated device, metric,metadata and parameterfiltering data.capabilities Usefor this when you need complete details about a specific measurement or when following up on a particular data point identified in listrelated queries.

Use Cases:

  • GetInvestigating specific metric anomalies or alerts
Retrieving detailed information aboutfor aaudit specific anomalous reading identified in monitoringtrails Retrieve complete metadata for a metric entry including collection timestamp VerifyAccessing specific measurements for audit or compliancedebugging purposes AccessBuilding fulldrill-down parameterinterfaces detailsfrom forsummary a particular metric readingviews

Full URL Example:

https://control.zequenze.com/api/v1/inventory_metric_log/15234/1245/

Parameters:

Parameter Type In Required Description
id integer path Yes Unique identifier of the metric log entry to retrieve
datetime__gte string query No Additional filter forby datetime (thoughgreater typicallythan notor needed for single record retrieval)equal)
datetime__lte string query No Additional filter forby datetime (thoughless typicallythan notor needed for single record retrieval)equal)
device__name string query No Additional filter by device name (for validation purposes)
metric_name string query No Additional filter by metric parameter name
parameter_name string query No Additional filter by parameter name
parameter__variable_name string query No Additional filter by parameter variable name

cURL Example:

curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/15234/1245/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example Response:

{
  "id": 15234,1245,
  "datetime": "2024-01-15T14:15T10:30:00Z",
  "device": {
    "id": 42,
    "name"device_name": "web-server-01",
  "type"parameter_name": "server"CPU Usage",
  "model"metric_name": "Dell PowerEdge R740"cpu_usage",
  "serial_number"origin": "ABC123XYZ789",
    "location": "datacenter-east",
    "rack": "R15-U24",
    "organization": "Production Web Services",
    "status": "active",
    "last_seen": "2024-01-15T14:30:00Z"
  },
  "metric": {
    "id": 7,
    "name": "memory_usage",
    "description": "System memory utilization percentage",
    "unit": "percentage",
    "collection_interval": 300,
    "retention_days": 90
  },
  "parameter": {
    "id": 23,
    "name": "Memory Utilization",
    "short_name": "MEM",
    "variable_name": "memory_percent",
    "description": "Percentage of total system memory currently in use",
    "unit": "%",
    "min_value": 0,
    "max_value": 100,
    "warning_threshold": 80,
    "critical_threshold": 95
  }au",
  "value": 67.8,85.7,
  "raw_value"result": 85.7,
  "original_value": "67.84329",
  85.7%"status": "normal",
  "quality": "good",
  "collection_method": "snmp",
  "created_at": "2024-01-15T14:30:15Z",
  "updated_at": "2024-01-15T14:30:15Z"
}

Response Codes:

Status Description
200 Success - Returns the specific metric log entry with complete details
401 Unauthorized - Invalid or missing authenticationAPI token
403 Forbidden - Insufficient permissions to access this metric data 404 Not Found - Metric log entry with the specified ID does not exist 403 Forbidden - Access denied to this metric log entry

Common Use Cases

Use Case 1: BuildingPerformance a Device PerformanceMonitoring Dashboard

Retrieve recent CPU and memory metrics for multipleall parametersweb from a specific deviceservers to display current statussystem health status.

Approach: Use the list endpoint with device name filtering and short-termdatetime trends.

range
#to Getget last 24 hours of CPU, memory, and diskrecent metrics foracross amultiple server
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=web-server-01&datetime__gte=2024-01-15T00:00:00Z&limit=500" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
parameters.

Use Case 2: Historical Trend Analysis

FetchGenerate monthly performance reports by querying metric data overfor a longerspecific time periodperiods and parameters.

Approach: Use datetime filtering with parameter-specific queries to analyzecollect performancedata trendsfor trend analysis and identify patterns or seasonal variations.reporting.

# Get temperature readings for the past month
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?parameter__variable_name=temperature&datetime__gte=2023-12-15T00:00:00Z&datetime__lte=2024-01-15T00:00:00Z" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Use Case 3: Multi-DeviceAnomaly MonitoringInvestigation

MonitorInvestigate specific performance incidents by examining detailed metric logs around the sametime metric across multiple devices by filtering on parameter name without specifying a device.

# Get CPU usage from all devices in the last hour
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?metric_name=cpu_usage&datetime__gte=2024-01-15T13:00:00Z&limit=1000" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Use Case 4: Investigating Specific Incidents

When you identifyof an anomalousalert.

reading

Approach: in your monitoring system, useUse the detail endpoint to getexamine completespecific contextmetric aboutentries, combined with datetime filtering to see surrounding data points.

Use Case 4: Automated Alerting System

Build monitoring systems that specificcheck measurement.

# Get full details about a specific concerningrecent metric readingvalues curlagainst -Xthresholds GETand "https://control.zequenze.com/api/v1/inventory_metric_log/15234/"trigger \alerts.
-H

Approach: "Authorization:Regularly Bearerpoll YOUR_API_TOKEN"the

list endpoint with recent datetime filters and parameter-specific queries to monitor critical metrics.

Use Case 5: DataCompliance Export for External AnalysisReporting

RetrieveGenerate largeaudit datasetsreports forshowing importmetric intocollection externalhistory analyticsand toolsdata orsources for compliance reporting.purposes.

#

Approach: ExportQuery allmetric metricslogs with origin filtering to show how data was collected (automatic vs manual) for aaudit specific device over a quarter curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=critical-server-01&datetime__gte=2024-01-01T00:00:00Z&datetime__lte=2024-03-31T23:59:59Z&limit=10000" \ -H "Authorization: Bearer YOUR_API_TOKEN"

trails.

Best Practices

Pagination Management:

  • Use reasonable limit values (50-100) to balance performance and data volume
Implement cursor-based pagination for consistent results when data changes frequently Store cursor values for resuming interrupted data collection processes

UseEfficient DateFiltering:

Range
Filters: Always specifyuse datetime filters (datetime__gteto limit query scope and datetime__lte)improve performance Combine device and parameter filters to reduce unnecessary data transfer Use specific parameter names rather than broad queries when possible

Error Handling:

    Implement retry logic for rate limiting (429) responses Handle missing metric entries (404) gracefully in monitoring systems Validate datetime formats before making API calls to avoid retrieving400 excessiveerrors

    Performance Optimization:

      Cache frequently accessed metric data locally when appropriate Use batch processing for large historical data exports Consider the trade-off between real-time queries and improvescheduled responsedata times.collection

      Origin Code Reference:

        au = Automatic (sensor/system generated)

        Implement Pagination: For large datasets, use the limitma parameter= and pagination cursors to retrieve data in manageable chunks. Start with reasonable limitsManual (100-500human records) and adjust based on your needs.

        entered)

        Cachegu Frequently= AccessedGUI Data:(web If building dashboards or reports that refresh frequently, consider caching metric data client-side for short periods to reduce API calls and improve user experience.

        interface)

        Combinecl Filters= Effectively: Use multiple filter parameters togetherCLI (devicecommand name + metric type + date range) to precisely target the data you need rather than filtering large result sets client-side.

        line)

        Handlesc Rate= Limits:Script Implement(automated exponential backoff retry logic in your applications to handle potential rate limiting gracefully, especially when making bulk data requests.

        script)

        Monitorap = API Usage:(external Track your API usage patterns to optimize query efficiency and avoid hitting rate limits during peak monitoring periods.

        Validate Date Formats: Ensure datetime parameters are properly formatted in ISO 8601 format. Include timezone information when precision is important for your use case.

        Use Appropriate Error Handling: Implement robust error handling for common scenarios like missing devices, invalid date ranges, and network timeouts, especially in automated monitoring systems.

        system)