EDB Postgres Enterprise Manager REST APIs v6.0: Export Custom Alert Templates v10.2

post__alert_custom_export_

Code samples

POST /alert/custom/export/

Export custom alert templates

Body parameter

{
  "alert_templates": [
    0
  ]
}

Parameters

NameInTypeRequiredDescription
X-Auth-TokenheaderstringtrueToken of authorization
bodybodyCustomAlertTemplateExportDatatruenone

Example responses

200 Response
[
  {
    "version": 1,
    "alert_templates": [
      {
        "name": "string",
        "description": "string",
        "reference_id": "string",
        "default_history_retention": 0,
        "object_type": 0,
        "sql": "string",
        "applicable_on_server": "ALL",
        "default_check_frequency": 0,
        "threshold_unit": "string",
        "is_system_template": true,
        "is_auto_create": true,
        "thresholds": [
          0
        ],
        "operator": ">",
        "high_threshold_value": "string",
        "medium_threshold_value": "string",
        "low_threshold_value": "string",
        "info_sql": "string",
        "probes": [
          {
            "probe_name": "string",
            "collection_method": "w",
            "enabled": true,
            "target_type": 0,
            "any_server_version": true,
            "interval": 0,
            "lifetime": 0,
            "discard_history": true,
            "platform": "string",
            "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"
              }
            ],
            "internal_name": "string"
          }
        ]
      }
    ]
  }
]

Responses

StatusMeaningDescriptionSchema
200OKSuccessful responseInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
anonymous[CustomAlertTemplateExportResponseData]falsenonenone
» versionintegerfalsenoneVersion of the alert template export.
» alert_templates[AlertImportExportTemplate]falsenonenone
»» namestringfalsenoneName of the alert template. NOTE: It is a mandatory parameter for the POST request.
»» descriptionstringfalsenoneDescription about the alert template. NOTE: It is a mandatory parameter for the POST request.
»» reference_idstringfalsenoneInternal identifier for the alert template.
»» default_history_retentionintegerfalsenoneDefines the history retention period in days for this type of alerts. NOTE: It is a mandatory parameter for the POST request.
»» object_typeintegerfalsenoneDefines the type of the object on which this alert template is applicable to.
  • System wide alert template will be 50.
  • An alert template applicable to an agent will be 100.
  • An alert template applicable to a managed server will be 200.
  • An alert template applicable to a database for a particular monitored server will be 300.
  • An alert template applicable to a schema on a particular database for the managed server will be 400.
  • An alert template applicable to a table on a particular schema for the database on a monitored server will be 500.
  • An alert template applicable to an index on a particular schema for the database on a monitored server will be 600.
  • An alert template applicable to a sequence on a particular schema for the database on a monitored server will be 700.
  • An alert template applicable to a function on a particular schema for the database on a monitored server will be 800.
NOTE: It is a mandatory parameter for the POST request.
»» sqlstringfalsenoneSQL query, possibly parameterized, to get a numeric indicating threshold reached. NOTE: It is a mandatory parameter for the POST request.
»» applicable_on_serverstringfalsenoneTemplate is applicable on which type of monitored server. Possible values are ALL, POSTGRES_SERVER, ADVANCED_SERVER. NOTE: It is a mandatory parameter for the POST request.
»» default_check_frequencyintegerfalsenoneDefines how frequently to check for the alert defined from this template (in minutes). NOTE: It is a mandatory parameter for the POST request.
»» threshold_unitstringfalsenoneUnit in which threshold is calculated; purely for GUI, like MB/kB/seconds/days/...
»» is_system_templatebooleanfalsenoneDefines whether the given template is system defined or user defined. NOTE: It is not applicable for the the POST/PUT requests.
»» is_auto_createbooleanfalsenoneWhether alert should be created as soon as agent or server is added to pem.
»» thresholds[number]falsenoneDefault threshold values. Values in the thresholds array must be in the sorted order based on the operator.
»» operatorstringfalsenoneOperator to compare threshold values.
»» high_threshold_valuestringfalsenoneHigh threshold value.
»» medium_threshold_valuestringfalsenoneMedium threshold value.
»» low_threshold_valuestringfalsenoneLow threshold value.
»» info_sqlstringfalsenoneSpecify the SQL query that will provide the detailed information about that alert on Dashboard.
»» probes[allOf]falsenonenone

allOf

NameTypeRequiredRestrictionsDescription
»»» anonymousCustomProbePostDatafalsenonenone
»»»» probe_namestringfalsenoneName of the probe.
»»»» collection_methodstringfalsenoneDefines the method of statistics collection. PEM supports three methods for custom made probes. i.e. SQL, WMI, Batch/Shell script.
  • 'w' stands for WMI script.
    It is applicable for the windows platform only, and target_type will be 100 (i.e. agent).
  • 'b' stands for Batch/Shell script. 'target_type' for this will be always be 100 (i.e. agent). It will behave as batch script on windows otherwise as a shell script.
  • 's' stands for SQL script. It will applicable only for 200 (i.e. server), 300 (i.e. database), 400 (i.e. schema), 500 (i.e. table), 600 (i.e. index), 700 (i.e. sequence), 800 (i.e. function), 900 (i.e. view).
»»»» enabledbooleanfalsenoneDefines whether the probe is enabled/disabled by default.
»»»» target_typeintegerfalsenoneDefines the type of the object on which the probe is applicable to.
  • 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.
»»»» any_server_versionbooleanfalsenoneDefines whether this probe is applicable to any version of Postgres variant. For more details, please follow the documenation.
»»»» intervalintegerfalsenoneDefines how frequently the probe will collect the statistics (in seconds).
»»»» lifetimeintegerfalsenoneDefines the history data retention time (in days). It does not have any effect, if 'discard_history' is set to true.
»»»» discard_historybooleanfalsenoneDefines whether to discard the history data. It will not store the history of the data for this probe, when 'discard_history' is set to false.
»»»» platformstringfalsenoneDefines on which platform this probe can run on. It is only applicable to an agent level probe.
»»»» probe_codestringfalsenoneA SQL/Batch script/Shell script/WMI script to collect the statistics as per definition of the code.
»»»» probe_columns[object]falsenonenone
»»»»» pc_namestringfalsenoneName of the column
»»»»» pc_data_typestringfalsenoneData type of the column.
Supported datatypes are:
      bigint
      char
      decimal
      double precision
      integer
      numeric
      real
      text
      text[]
      timestamp
      timestamptz
»»»»» pc_unitstringfalsenoneReturns the unit of the column.
»»»»» pc_col_typestringfalsenoneReturns the columns is 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_graphablebooleanfalsenoneReturns whether the data of the column is graphable on a chart, or not.
»»»»» pc_calc_pitbooleanfalsenoneReturns whether server calculates the point-in-time for the metric data for this column.
»»»»» pc_pit_defaultbooleanfalsenoneReturns the metric is stored by point-in-time by default. Please refer the 'Custom Probes' section in the documentation for detailed information.
»»»» alternate_code[AlternateServerProbeCode]falsenonenone
»»»»» server_version_idintegerfalsenoneServer version id for the support 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

and

NameTypeRequiredRestrictionsDescription
»»» anonymousobjectfalsenonenone
»»»» internal_namestringfalsenoneInternal name of the probe from the system where probe was exported.
Enumerated Values
PropertyValue
applicable_on_serverALL
applicable_on_serverPOSTGRES_SERVER
applicable_on_serverADVANCED_SERVER
operator>
operator<
collection_methodw
collection_methodb
collection_methods
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