EDB Postgres Enterprise Manager REST APIs v12.0: Custom Probe v10.2

get__probe_

Code samples

GET /probe/

Gets all the custom/system probes.

Parameters

NameInTypeRequiredDescription
X-Auth-TokenheaderstringtrueToken of authorization

Example responses

200 Response
[
  {
    "probe_id": 0,
    "probe_name": "string",
    "enabled": true,
    "target_type": 0,
    "internal_name": "string",
    "is_system_probe": true,
    "any_server_version": true,
    "collection_method": "w",
    "interval": 0,
    "lifetime": 0,
    "discard_history": true,
    "platform": "unix",
    "probe_code": "string",
    "probe_columns": [
      {
        "pc_id": 0,
        "pc_name": "string",
        "pc_data_type": "bigint",
        "pc_internal_name": "string",
        "pc_unit": "string",
        "pc_col_type": "m",
        "pc_position": 0,
        "pc_graphable": true,
        "pc_calc_pit": true,
        "pc_pit_default": true
      }
    ],
    "alternate_code": [
      {
        "server_version_id": 0,
        "server_probe_code": "string",
        "extension_version": 0
      }
    ]
  }
]

Responses

StatusMeaningDescriptionSchema
200OKSuccessful responseInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
anonymous[CustomProbes]falsenonenone
» probe_idintegerfalsenoneIdentifier for a probe
» probe_namestringfalsenoneName of the probe
» enabledbooleanfalsenoneDetermines whether the probe is enabled or disabled by default.
» target_typeintegerfalsenoneDefines the type of the object to which the probe applies.
  • A probe with target_type 100 is responsible for collecting statistics for an agent.
  • A probe with target_type 200 is responsible for collecting statistics for a monitored server.
  • A probe with target_type 300 is responsible for collecting statistics for a database.
  • A probe with target_type 400 is responsible for collecting statistics for a schema.
  • A probe with target_type 500 is responsible for collecting statistics for a table.
  • A probe with target_type 600 is responsible for collecting statistics for a index.
  • A probe with target_type 700 is responsible for collecting statistics for a sequence.
  • A probe with target_type 800 is responsible for collecting statistics for a function.
  • A probe with target_type 900 is responsible for collecting statistics for a view.
  • A probe with target_type 1000 is responsible for collecting statistics for a extension.
» internal_namestringfalsenoneDefines the internal name of the probe. The PEM system creates internal tables for storing probe statistics in the 'pemdata', and 'pemhistory' schema. The names of those tables are the same as the internal name.
» is_system_probebooleanfalsenoneDetermines whether this probe is user-defined. This flag is always false for a user-defined probe.
» any_server_versionbooleanfalsenoneDetermines whether this probe applies to any version of a Postgres variant. For more details, please consult the documentation.
» collection_methodstringfalsenoneDefines the method of statistics collection. PEM supports three methods for custom made probes: SQL, WMI, or batch/shell script.
  • 'w' stands for WMI script.
    This type of script only applies to the Windows platform, and the target_type is 100 (for agent).
  • 'b' stands for batch/shell script. The 'target_type' for this script is always 100 (agent). This script behaves as a batch script on Windows and a shell script on other platforms.
  • 's' stands for SQL script. The 'target_type' is always 200 (server), 300 (database), 400 (schema), 500 (table), 600 (index), 700 (sequence), 800 (function), or 900 (view), or 1000 (extension).
» intervalintegerfalsenoneDefines how frequently the probe collects statistics (in seconds).Must be greater than or equal to 10
» lifetimeintegerfalsenoneDefines the history data retention time (in days). Valid range is 1-365. This value does not have any effect if 'discard_history' is set to true.
» discard_historybooleanfalsenoneDetermines whether to discard history data. When 'discard_history' is set to false, history of the data for this probe is not stored.
» platformstringfalsenoneDefines the platform where this probe can run. This value only applies to an agent-level probe.
» probe_codestringfalsenoneA SQL/Batch script/Shell script/WMI script to collect the statistics as per the definition of the code.
» probe_columns[object]falsenonenone
»» pc_idintegerfalsenoneColumn identifier
»» pc_namestringfalsenoneColumn name
»» pc_data_typestringfalsenoneData type of the column.
Supported datatypes are:
      bigint
      char
      decimal
      double precision
      integer
      numeric
      real
      text
      text[]
      timestamp
      timestamptz
»» pc_internal_namestringfalsenoneReturns the internal name of the column.
»» pc_unitstringfalsenoneReturns the unit of the column.
»» pc_col_typestringfalsenoneReturns the column as part of the primary key of the internal table, or not. 'k' stands for a key column, and 'm' stands for a member/normal column.
»» pc_positionintegerfalsenoneReturns the position of the column in the internal table.
»» pc_graphablebooleanfalsenoneDetermines whether the data of the column can be graphed on a chart.
»» pc_calc_pitbooleanfalsenoneDetermines whether the server calculates the point-in-time for metric data for this column.
»» pc_pit_defaultbooleanfalsenoneDetermines whether the metric is stored by point-in-time by default. Please refer to the 'Custom Probes' section in the documentation for detailed information.
» alternate_code[AlternateServerProbeCode]falsenonenone
»» server_version_idintegerfalsenoneServer version ID for the monitored server
server_version_idDatabase Server
10905PostgreSQL 9.5
10906PostgreSQL 9.6
11000PostgreSQL 10
11100PostgreSQL 11
11200PostgreSQL 12
11300PostgreSQL 13
20905Postgres Plus Advanced Server 9.5
20906Postgres Plus Advanced Server 9.6
21000EDB Postgres Advanced Server 10
21100EDB Postgres Advanced Server 11
21200EDB Postgres Advanced Server 12
21300EDB Postgres Advanced Server 13
»» server_probe_codestringfalsenoneSQL query to run on the specified server version
»» extension_versionintegerfalsenoneSpecifies the extension version. Valid for extension target type
Enumerated Values
PropertyValue
collection_methodw
collection_methodb
collection_methods
platformunix
platformwindows
pc_data_typebigint
pc_data_typechar
pc_data_typedecimal
pc_data_typedouble precision
pc_data_typeinteger
pc_data_typenumeric
pc_data_typereal
pc_data_typetext
pc_data_typetext[]
pc_data_typetimestamp
pc_data_typetimestamptz
pc_col_typem
pc_col_typek
Info

This operation does not require authentication

post__probe_

Code samples

POST /probe/

Creates a new custom probe.

Body parameter

{
  "probe_name": "string",
  "collection_method": "w",
  "enabled": true,
  "target_type": 0,
  "any_server_version": true,
  "any_extension_version": true,
  "extension_name": "string",
  "interval": 0,
  "lifetime": 0,
  "discard_history": true,
  "platform": "unix",
  "probe_code": "string",
  "probe_columns": [
    {
      "pc_name": "string",
      "pc_data_type": "bigint",
      "pc_unit": "string",
      "pc_col_type": "m",
      "pc_graphable": true,
      "pc_calc_pit": true,
      "pc_pit_default": true
    }
  ],
  "alternate_code": [
    {
      "server_version_id": 0,
      "server_probe_code": "string",
      "extension_version": 0
    }
  ]
}

Parameters

NameInTypeRequiredDescription
X-Auth-TokenheaderstringtrueToken of authorization
bodybodyCustomProbePostDatatruenone

Example responses

Responses

StatusMeaningDescriptionSchema
200OKStatus 200None

Response Schema

Info

This operation does not require authentication

get__probe_{probe_id}

Code samples

GET /probe/{probe_id}

Gets probe information for specified probe ID.

Parameters

NameInTypeRequiredDescription
probe_idpathintegertrueProbe ID for which probe information will be returned
X-Auth-TokenheaderstringtrueToken of authorization

Example responses

200 Response
{
  "probe_id": 0,
  "probe_name": "string",
  "enabled": true,
  "target_type": 0,
  "internal_name": "string",
  "is_system_probe": true,
  "any_server_version": true,
  "collection_method": "w",
  "interval": 0,
  "lifetime": 0,
  "discard_history": true,
  "platform": "unix",
  "probe_code": "string",
  "probe_columns": [
    {
      "pc_id": 0,
      "pc_name": "string",
      "pc_data_type": "bigint",
      "pc_internal_name": "string",
      "pc_unit": "string",
      "pc_col_type": "m",
      "pc_position": 0,
      "pc_graphable": true,
      "pc_calc_pit": true,
      "pc_pit_default": true
    }
  ],
  "alternate_code": [
    {
      "server_version_id": 0,
      "server_probe_code": "string",
      "extension_version": 0
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessful responseCustomProbes
Info

This operation does not require authentication

put__probe_{probe_id}

Code samples

PUT /probe/{probe_id}

Updates custom/system probe information for specified probe ID.

Body parameter

{
  "interval_min": 0,
  "interval_sec": 0,
  "lifetime": 0,
  "enabled": true,
  "probe_code": "string",
  "probe_columns": {
    "changed": [
      {
        "pc_id": 0,
        "pc_unit": "string",
        "pc_graphable": true
      }
    ]
  },
  "alternate_code": {
    "changed": [
      {
        "server_version_id": 0,
        "server_probe_code": "string",
        "extension_version": 0
      }
    ],
    "deleted": [
      {
        "server_version_id": 0
      }
    ],
    "added": [
      {
        "server_version_id": 0,
        "server_probe_code": "string",
        "extension_version": 0
      }
    ]
  }
}

Parameters

NameInTypeRequiredDescription
probe_idpathintegertrueProbe ID for which probe information will be returned
X-Auth-TokenheaderstringtrueToken of authorization
bodybodyCustomProbePutDatatruenone

Example responses

Responses

StatusMeaningDescriptionSchema
200OKStatus 200None

Response Schema

Info

This operation does not require authentication

delete__probe_{probe_id}

Code samples

DELETE /probe/{probe_id}

Deletes the custom probe.

Parameters

NameInTypeRequiredDescription
probe_idpathintegertrueProbe ID for which probe information will be returned
X-Auth-TokenheaderstringtrueToken of authorization

Example responses

Responses

StatusMeaningDescriptionSchema
200OKSuccessful deletionNone

Response Schema

Info

This operation does not require authentication