TrueSight API Documentation
OverviewAccountActionsAdministration
Alarms v1Alarms v2BatchingDashboards
DatasetsEventsExtended Metrics
GroupsHostgroupsMetersMetricsProduct
PluginsRelaysSourcesSource-TagsSynchronize Data
Tenants
Terms

POST/v2/alarms

Create an Alarm

Request body properties:

actions integer[], optional: true, default: []

An array of associated actions for the alarm.

hostgroupId integer, optional: true, default: null

The hostgroup of sources the alarm rules apply to.

isDisabled boolean, optional: true, default: true

Set the alarm status to be either Enabled or Disabled.

metric string, optional: true, default: conditional

The name of the metric to alarm on.

Defaults are:

Threshold: CPU

Baseline: CPU

Host Communication: CPU

API Metric Communication: User defined choice of any metric.

name string, optional: false

The name of the alarm.

note string, optional: true, default: null

A description or resolution of the alarm

notifyClear boolean, optional, default: true

When true, perform actions when all hosts

notifySet boolean, optional, default: true

When true, perform actions when an alarm threshold and interval is breached.

perHostNotify boolean, optional: true, default: true

When true, actions will run once per host until resolved. When false, only the initial trigger and resolution will process the actions.

timeoutInterval integer, optional: true, default: 259200000(3 days)

The interval after which an individual host state should resolve by timeout.

triggerInterval boolean, optional, default: conditional, min: conditional

The interval of time in ms that the alarm state should be in fault before triggering.

The default and minimum values vary by alarm family as follows:

Threshold

Communication:

Baseline:

triggerPredicate object|null, optional: conditional, default: null

The threshold of the alarm. Applies only to the threshold family of alarm types.

{
    "agg": "avg", // (or "min", "max", "avg", "all")
    "op": "gt", // (or "lt", "eq", "outside")
    "val": 0.9 // (some threshold)
}

triggerPredicate properties for Baseline alarm types as follows:

All Values Above Baseline {"agg”:”min","op”:"gt","val":0.0}
All Values Below Baseline {"agg”:"max","op”:"lt","val":0.0}
All Values Outside Baseline {"agg”:"all","op”:"outside","val":0.0}
Average Value Above Baseline {"agg”:”avg","op”:"gt","val":0.0}
Average Value Below Baseline {"agg”:”avg","op”:"lt","val":0.0}
Average Value Outside Baseline {"agg”:”avg","op”:"outside","val":0.0}

typeId integer, optional: true, default: 3

One of the following alarm typeId's:

Threshold Family:

3: Threshold

7: Baseline

Communication Family:

4: Host Communication

6: API Metric Communication

typeId's 1 and 2 are reserved for the immutable familyId's of Threshold and Communication, respectively.

It is not possible to change to a type that would result in the change of alarm family.

Examples:

Example threshold alarm request:

curl https://api.truesight.bmc.com/v2/alarms \
-X POST \
-u <email>:<api-token> \
-H "Content-Type: application/json" \
-d '
{
   "hostgroupId": 200,
   "isDisabled": false,
   "metric": "CPU",
   "name": "Hostgroup 200 CPU",
   "note": "Notify when host AVG CPU is high",
   "notifyClear": true,
   "notifySet": true,
   "perHostNotify": true,
   "timeoutInterval": 259200000,
   "triggerInterval": 60000,
   "triggerPredicate": {
      "agg": "avg",
      "op": "gt",
      "val": 0.8
   },
   "typeId": 3
}'

Example Communication request:

curl https://api.truesight.bmc.com/v2/alarms \
-X POST \
-u <email>:<api-token> \
-H "Content-Type: application/json" \
-d '
{
   "hostgroupId": 200,
   "isDisabled": false,
   "name": "My Host Communication Alarm",
   "note": "Notify when hosts are not reporting",
   "timeoutInterval": 259200000,
   "triggerInterval": 15000,
   "typeId": 4
}'

Example API Metric Communication request:

curl https://api.truesight.bmc.com/v2/alarms \
-X POST \
-u <email>:<api-token> \
-H "Content-Type: application/json" \
-d '
{
   "hostgroupId": 200,
   "isDisabled": false,
   "metric": "MY_CUSTOM_METRIC",
   "name": "My API Metric Communication Alarm",
   "note": "Notify when hosts are not reporting",
   "notifyClear": true,
   "notifySet": true,
   "perHostNotify": true,
   "timeoutInterval": 259200000,
   "triggerInterval": 15000,
   "typeId": 5
}'

Example baseline alarm request:

curl https://api.truesight.bmc.com/v2/alarms \
-X POST \
-u <email>:<api-token> \
-H "Content-Type: application/json" \
-d '
{
   "actions": [],
   "familyId": 1,
   "hostgroupId": 200,
   "isDisabled": false,
   "metric": "CPU",
   "name": "Baseline_All_Values_Above",
   "note": "Notify when all values above baseline",
   "notifyClear": true,
   "notifySet": true,
   "perHostNotify": false,
   "timeoutInterval": 86460000,
   "triggerInterval": 60000,
   "triggerPredicate": {
      "agg": "min",
      "op": "gt",
      "val": 0
   },
   "typeId": 7
}'