Server Monitoring
Efficiently monitor the performance and health of your servers in real-time. This feature allows you to track critical metrics such as CPU usage, memory consumption, disk activity, and more, helping you ensure optimal server operation. With proactive monitoring, you can quickly identify and address potential issues before they lead to downtime, enhancing the reliability of your services.
ENDPOINTS
Expand all
  • Server monitoring operations
    POST/v1/server-resource
    DELETE/v1/server-resource
    PUT/v1/server-resource/{id}
  • Server monitoring records
  • Server performance metrics overview
Setup Server for Monitoring
This API endpoint allows you to set up a new server for monitoring within your organization's infrastructure. By creating a new server monitoring resource, you can track the performance and availability of specific servers. To set up the server, provide essential details such as the service_id, name, description, and timezone.

Utilizing this endpoint helps organizations ensure their infrastructure operates optimally, with real-time insights into performance metrics through data visualizations.

Common use cases:

  • Infrastructure setup and management: Easily register and monitor multiple servers across various regions or time zones, ensuring comprehensive tracking of performance and availability with relevant data visualizations.
  • Historical performance analysis: Track and visualize performance metrics over time to identify trends, recurring issues, or periods of underperformance, facilitating better resource allocation and proactive problem resolution.


Authorization: Bearer YOUR_TOKEN

Request Body Parameters
  • service_id string
    The unique service ID associated with the server resource. Example: 'ed45b14d-e3ea-4f40-9a4e-16c175afad98'
  • name string
  • description string
  • timezone string
  • chart_type_default string
  • os string
  • metric_types_basic array
  • metric_types_advanced array
  • metric_types_complex array
  • interval integer
  • enabled boolean
JavaScript
Response codes
const axios = require('axios');

const url = 'https://resource-cmd.api.pinghome.io/v1/server-resource';
const data = {
  service_id: 'ed45b14d-e3ea-4f40-9a4e-16c175afad98',
  name: 'Resource name',
  description: 'Resource description',
  timezone: 'Europe/Berlin',
  chart_type_default: 'line',
  os: 'ubuntu',
  metric_types_basic: ['cpu-total-usage'],
  metric_types_advanced: ['disk-io-unified'],
  metric_types_complex: ['processes-unified'],
  interval: 60,
  enabled: true
};

axios.post(url, data, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).
Delete Multiple Server Monitors
This API endpoint enables you to delete multiple server monitoring resources by providing their IDs as query parameters.

Authorization: Bearer YOUR_TOKEN



Expected Behavior:

  • On success, the specified server monitoring resources will be deleted, and a confirmation message along with the IDs of the deleted resources will be returned.
  • If the request is unauthorized or the provided IDs are invalid, an error message will be returned, specifying the issue.
Query Parameters
  • id string
    A list of server resource IDs to delete.
    Example: ['6766163a-568d-47b4-a1fa-91a0957e06d4', 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'].
JavaScript
Response codes
const axios = require('axios');

const url = 'https://resource-cmd.api.pinghome.io/v1/server-resource?id=6766163a-568d-47b4-a1fa-91a0957e06d4&id=c03b02ec-244f-4d2c-8f68-3910071ed5c8';

axios.delete(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).
Update Server Monitor
This API endpoint allows you to update a server resource by providing its unique ID in the path and specifying the updated details in the request body.

Authorization: Bearer YOUR_TOKEN



Expected Behavior:

  • On success, the server resource will be updated, and a confirmation message along with the updated resource ID will be returned.
  • If the request is unauthorized or the provided ID is invalid, an error message will be returned, specifying the issue.
Path Parameters
  • id string
    The unique ID of the server resource to be updated. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Request Body Parameters
  • service_id string
    The unique service ID associated with the server resource.
    Example: 'ed45b14d-e3ea-4f40-9a4e-16c175afad98'
  • name string
  • description string
  • timezone string
  • chart_type_default string
  • os string
  • metric_types_basic array
  • metric_types_advanced array
  • metric_types_complex array
  • interval integer
  • enabled boolean
JavaScript
Response codes
const axios = require('axios');

const url = 'https://resource-cmd.api.pinghome.io/v1/server-resource/445a5c1f-c0eb-403a-96d7-3976e5dc74ed';
const data = {
  service_id: 'ed45b14d-e3ea-4f40-9a4e-16c175afad98',
  name: 'Resource name',
  description: 'Resource description',
  timezone: 'Europe/Berlin',
  chart_type_default: 'line',
  os: 'ubuntu',
  metric_types_basic: ['cpu-total-usage'],
  metric_types_advanced: ['disk-io-unified'],
  metric_types_complex: ['processes-unified'],
  interval: 60,
  enabled: true,
};

axios.put(url, data, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).
Full List of Server Monitoring Records
This API endpoint allows an authenticated user to retrieve all server records by providing service ID in the path. It supports pagination via query parameters limit and page.

Authorization: Bearer YOUR_TOKEN

Path Parameters
  • id string
    The unique ID of the service.
    Example: '906a3444-15ce-4410-8041-89a238e9e91f'
Query Parameters
  • page (optional) positive integer
    The page of the result. Use this parameter to paginate through results when there are multiple pages of data.
    Example: 50.
  • limit (optional) positive integer
JavaScript
Response codes
const axios = require('axios');

const url = 'https://resource-query.api.pinghome.io/v1/service/906a3444-15ce-4410-8041-89a238e9e91f/server-resources?limit=50&page=1';

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).
Get Specific Server Monitor
This API endpoint allows you to retrieve a server monitor details by providing its ID in the path.

Authorization: Bearer YOUR_TOKEN

Path Parameters
  • id string
    The unique ID of the server resource.
    Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
JavaScript
Response codes
const axios = require('axios');

const url = 'https://resource-query.api.pinghome.io/v1/server-resource/445a5c1f-c0eb-403a-96d7-3976e5dc74ed';

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).
View Server Performance Metrics
This API endpoint retrieves server metrics for a specific server over a specified time range. Query parameters such as type, start_date, end_date, interval, and limit can be used to control the time range and quantity of metrics retrieved.

Authorization: Bearer YOUR_TOKEN


Path Parameters
  • id string
    The unique ID of the server resource for which metrics are being retrieved. Example: '9bb4505f-6073-4a9b-abd3-cc698f695c7b'
Query Parameters
  • type string
    The type of metric being retrieved. The accepted values are: 'cpu-total-usage', 'memory-usage', 'disk-io-unified', 'disk-usage-unified', 'system-load-unified', 'swap-usage', and 'network-usage-unified'.
    Example: 'cpu-total-usage'
  • start_date (optional) string
  • end_date (optional) string
  • interval (optional) string
  • limit (optional) positive integer
JavaScript
Response codes
const axios = require('axios');

const url = 'https://statistic-query.api.pinghome.io/v1/server-resource/9bb4505f-6073-4a9b-abd3-cc698f695c7b/metrics?type=cpu-total-usage&start_date=2023-04-03T21:00:00Z&end_date=2023-04-03T22:04:00Z&interval=on-demand&limit=100';

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).