Setup Server for Monitoring

Register a new server for metric tracking by providing details such as service_id, name, description, and timezone. This endpoint creates a server monitoring resource, allowing you to visualize essential system metrics like CPU, memory, and disk usage through charts.

Once configured, the server will begin reporting usage data to your dashboard, giving your team consistent visibility into system activity across different services and environments.

Use cases:
  • Infrastructure setup — Quickly onboard new servers and begin tracking system-level metrics without deep configuration.
  • Timezone labeling — Assign a timezone to each server so that metric timestamps in visualizations reflect local server time, improving clarity during reviews.
  • Visual trend tracking — View how system resource usage evolves over time to assist in capacity planning or basic diagnostics.

    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).