4.13. Notification types

The notification type represents the type of notification. When you create a notification in Rackspace Cloud Monitoring, you must specify the notification type. Rackspace Cloud Monitoring currently supports the following notification types:

Email

Email alerts where the message is delivered to a specified address.

Webhook

Industry-standard web hooks, where JSON is posted to a configurable URL.

PagerDuty

Use PagerDuty, an incident management system, integrated with Rackspace Cloud Monitoring.

 4.13.1. Email notification type

A notification sent by email.

Table 4.15. Attributes
NameDescriptionValidation
address Email address to send notifications to
  • Email address

 4.13.2. Webhook notification type

The webhook notification takes the following parameters:

Table 4.16. Attributes
NameDescriptionValidation
url An HTTP or HTTPS URL to POST to
  • URL

 

Example 4.96. Webhook notification POST to a specified URL with JSON Payload

{
    "event_id": "acOne:enOne:alOne:chOne:1326910500000:WARNING",
    "log_entry_id": "6da55310-4200-11e1-aaaf-cd4c8801b6b1",
    "details": {
        "target": null,
        "timestamp": 1326905540481,
        "metrics": {
            "tt_firstbyte": {
                "type": "I",
                "data": 2,
                "unit": "milliseconds"
            },
            "duration": {
                "type": "I",
                "data": 2,
                "unit": "milliseconds"
            },
            "bytes": {
                "type": "i",
                "data": 17,
                "unit": "bytes"
            },
            "tt_connect": {
                "type": "I",
                "data": 0,
                "unit": "milliseconds"
            },
            "code": {
                "type": "s",
                "data": "200",
                "unit": "unknown"
            }
        },
        "state": "WARNING",
        "status": "warn.",
        "txn_id": "sometransaction",
        "collector_address_v4": "127.0.0.1",
        "collector_address_v6": null,
        "observations": [
            {
                "monitoring_zone_id": "mzOne",
                "state": "WARNING",
                "status": "warn.",
                "timestamp": 1326905540481
            }
        ]
    },
    "entity": {
        "id": "enOne",
        "label": "entity one",
        "ip_addresses": {
            "default": "127.0.0.1"
        },
        "metadata": null,
        "managed": false,
        "uri": null,
        "agent_id": null,
        "created_at": 1326905540481,
        "updated_at": 1326905540481
    },
    "check": {
        "id": "chOne",
        "label": "ch a",
        "type": "remote.http",
        "details": {
            "url": "http://www.foo.com",
            "body": "b",
            "method": "GET",
            "follow_redirects": true,
            "include_body": false
        },
        "monitoring_zones_poll": [
            "mzOne"
        ],
        "timeout": 30,
        "period": 60,
        "target_alias": "default",
        "target_hostname": "",
        "target_resolver": "",
        "disabled": false,
        "metadata": null,
        "confd_name": null,
        "confd_hash": null,
        "created_at": 1326905540481,
        "updated_at": 1326905540481
    },
    "alarm": {
        "id": "alOne",
        "label": "Alarm 1",
        "check_type": "remote.http",
        "check_id": null,
        "criteria": "if (metric[\"t\"] >= 2.1) { return WARNING } return WARNING",
        "disabled": false,
        "notification_plan_id": "npOne",
        "metadata": null,
        "confd_name": null,
        "confd_hash": null,
        "created_at": 1326905540481,
        "updated_at": 1326905540481
    },
    "tenant_id": "91111"
}


 4.13.2.1. Notification payload

The following fields are contained within a single payload:

Field Description
eventId The ID for the event in the system.
logEntryId The ID for the log entry.
entity The entity record that triggered the alert.
check The check record that triggered the alert.
alarm The alarm record that triggered the alert.

 4.13.2.2. Notification header contents

The following fields will be populated in the request header when your webhook is called.

Header Field Description
x-rackspace-webhook-token The webhook token defined in an account. This is used in your web application to verify that your webhook is called by an authorized Rackspace service.

 4.13.3. PagerDuty notification type

A notification sent through PagerDuty.

To learn how to use this notification type, read the PagerDuty blog Rackspace Cloud Monitoring Now Integrates with PagerDuty .

Table 4.17. Attributes
NameDescriptionValidation
service_key The PagerDuty service key to use.
  • Alphanumeric string

  • String between 1 and 32 characters long

 4.13.4. Create notification type

Users cannot create notification types.

 4.13.5. List notification types

Verb URI Description
GET /notification_types Lists available notification types.

There are no parameters for this call.

Normal Response Code: 200

Error Response Codes: 401, 403, 500, 503

 

Example 4.97. List notification types response: XML

<?xml version="1.0" encoding="utf-8"?>
<container>
  <values>
    <notification_type id="webhook">
      <fields>
        <field>
          <name>url</name>
          <description>An HTTP or HTTPS URL to POST to</description>
          <optional>false</optional>
        </field>
      </fields>
    </notification_type>
    <notification_type id="email">
      <fields>
        <field>
          <name>address</name>
          <description>Email address to send notifications to</description>
          <optional>false</optional>
        </field>
      </fields>
    </notification_type>
    <notification_type id="pagerduty">
      <fields>
        <field>
          <name>service_key</name>
          <description>The PagerDuty service key to use.</description>
          <optional>false</optional>
        </field>
      </fields>
    </notification_type>
  </values>
  <metadata>
    <count>3</count>
    <limit>50</limit>
    <marker/>
    <next_marker/>
    <next_href/>
  </metadata>
</container>


 

Example 4.98. List notification types response: JSON

{
    "values": [
        {
            "id": "webhook",
            "fields": [
                {
                    "name": "url",
                    "description": "An HTTP or HTTPS URL to POST to",
                    "optional": false
                }
            ]
        },
        {
            "id": "email",
            "fields": [
                {
                    "name": "address",
                    "description": "Email address to send notifications to",
                    "optional": false
                }
            ]
        },
        {
            "id": "pagerduty",
            "fields": [
                {
                    "name": "service_key",
                    "description": "The PagerDuty service key to use.",
                    "optional": false
                }
            ]
        }
    ],
    "metadata": {
        "count": 3,
        "limit": 50,
        "marker": null,
        "next_marker": null,
        "next_href": null
    }
}


 4.13.6. Get notification type

Verb URI Description
GET /notification_types/notificationTypeId Get information for a single notification type.

There are no parameters for this call.

Normal Response Code: 200

Error Response Codes: 401, 403, 500, 503

 

Example 4.99. Get notification type response: XML

<?xml version="1.0" encoding="utf-8"?>
<notification_type id="webhook">
  <fields>
    <field>
      <name>url</name>
      <description>An HTTP or HTTPS URL to POST to</description>
      <optional>false</optional>
    </field>
  </fields>
</notification_type>


 

Example 4.100. Get notification type response: JSON

{
    "id": "webhook",
    "fields": [
        {
            "name": "url",
            "description": "An HTTP or HTTPS URL to POST to",
            "optional": false
        }
    ]
}


 4.13.7. Update notification type

Users cannot update notification types.

 4.13.8. Delete notification type

Users cannot delete notification types.



loading table of contents...