Tutorial: Adding a dashboard for alerts
In this tutorial, you are configuring a dashboard for tracking alerts.
About this task
- Display alerts by severity.
- Display alerts by status.
- Display alerts by alert status.
- Display alerts by owner
- Display a table of alerts.
Before you begin
- Complete the Adding data from physical devices tutorial.
- Create an empty dashboard as the basis for your new dashboard. Use the following
configuration:
{ "cards": [], "title": "Robot alerts", "timeGrain": "hour", "description": "Robot tickets", "layouts": {} }
- Generate some alerts.
- Using the AlertHighValue function, create a load_warning_level alert on the load data item, set the upper_threshold to 300, severity to medium, and status to validated. Schedule the function to run on the last 5 days data.
- Using the AlertLowValue function, create a robot_too_slow alert on the travel_time data item, set the lower_threshold to 1, severity to high, and status to new. Schedule the function to run on the last 5 days data.
- Using the AlertLowValue function, create a work_performed_too_high alert on the work_performed data item, set the upper_threshold to 1500, severity to medium, and status to new. Schedule the function to run on the last 5 days data.
Step 1: Display alerts by severity
In the value card configuration, set "type":
"alert"
in the cards.dataSource object, and then set "dataSourceId":
"count"
.
Use the dataFilter object to filter each attribute by an alert field value, such as by critical severity alerts. If you specify a data filter, you must include the filter in the groupBy field of the dataSource configuration.
In this step, filter the value card by severity. Display a count of high, medium, and low severity alerts on the card.
{
"id": "alerts1",
"size": "MEDIUM",
"title": "Alert - Severity",
"type": "VALUE",
"attributes": [
{
"id": "count"
}
]
"content": {
"attributes": [{
"label": "High",
"dataFilter": {
"severity": "High"
},
"dataSourceId": "count"
},
{
"label": "Medium",
"dataFilter": {
"severity": "Medium"
},
"dataSourceId": "count"
},
{
"label": "Low",
"dataFilter": {
"severity": "Low"
},
"dataSourceId": "count"
}
]
},
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert",
"groupBy": [
"severity"
]
}
}
Add the value card example to the dashboard.
Step 2: Display alerts by status
Filter a value card by status. Display a count of new, validated, and resolved alerts on the card.
Example:
{
"id": "alerts2",
"size": "MEDIUM",
"title": "Alert - Status",
"type": "VALUE",
"attributes": [
{
"id": "count"
}
]
"content": {
"attributes": [{
"label": "New",
"dataFilter": {
"status": "New"
},
"dataSourceId": "count"
},
{
"label": "Validated",
"dataFilter": {
"status": "Validated"
},
"dataSourceId": "count"
},
{
"label": "Resolved",
"dataFilter": {
"status": "Resolved"
},
"dataSourceId": "count"
}
]
},
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert",
"groupBy": [
"status"
]
}
}
Add the value card example to the dashboard.
Step 3: Display alerts by alert type
Filter the value card by the alert name. Display a count of the following alert names:
- `load_warning_level`
- `robot_too_slow`
- `work_performed_too_high`
Use name to filter on the alert name.
Example:
<ul data-widget="twisty" class="ibm-twisty">
<li>
<span class="ibm-twisty-head">
<strong>Expand to see JSON</strong>
</span>
<div class="ibm-twisty-body">
<pre><code>
{
"id": "alerts3",
"size": "MEDIUM",
"title": "Alert types",
"type": "VALUE",
"attributes": [
{
"id": "count"
}
]
"content": {
"attributes": [{
"label": "Load - High level detected",
"dataFilter": {
"name": "load_warning_level"
},
"dataSourceId": "count"
},
{
"label": "Travel time - Robot travelling two slowly",
"dataFilter": {
"name": "robot_too_slow"
},
"dataSourceId": "count"
},
{
"label": "Work performed too high",
"dataFilter": {
"name": "work_performed_too_high"
},
"dataSourceId": "count"
}
]
},
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert",
"groupBy": [
"name"
]
}
}
Add the value card example to the dashboard.
Step 4: Display alerts by owner in a value card
Filter the value card by the alert owner. Display a count of alerts per owner. Change the owner value to usernames that are configured in your demonstration environment.
Example:
{
"id": "alerts4",
"size": "MEDIUM",
"title": "Alert - owner",
"type": "VALUE",
"attributes": [
{
"id": "count"
}
]
"content": {
"attributes": [{
"label": "John Smith",
"dataFilter": {
"owner": "jsmith@company.com"
},
"dataSourceId": "count"
},
{
"label": "Jane Jones",
"dataFilter": {
"owner": "jjones.gothe@company.com"
},
"dataSourceId": "count"
},
{
"label": "Taylor White",
"dataFilter": {
"owner": "twhite.Hoyt@company.com"
},
"dataSourceId": "count"
}
]
},
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert",
"groupBy": [
"owner"
]
}
}
Add the value card example to the dashboard.
Step 5: Add an alerts table
Add an alerts table to show alerts for the last 24 hours.
Example:
{
"id": "alerts",
"size": "LARGEWIDE",
"title": "Alerts in the last 24 hours",
"type": "ALERT",
"attributes": [
{
"id": "count"
}
]
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert"
}
}
Add the alert table example to the dashboard.
Step 6: Import the dashboard
- Log in as an administrator.
- On the Monitor page, on the Devices tab, select the robot device type that you created for the tutorial.
- Click the Settings icon and then select Edit dashboard.
- Click the import icon to upload your local JSON dashboard configuration file.
Example of the updated dashboard:
{
"cards": [{
"id": "alerts1",
"size": "MEDIUM",
"title": "Alert - Severity",
"type": "VALUE",
"attributes": [
{
"id": "count"
}
]
"content": {
"attributes": [{
"label": "High",
"dataFilter": {
"severity": "High"
},
"dataSourceId": "count"
},
{
"label": "Medium",
"dataFilter": {
"severity": "Medium"
},
"dataSourceId": "count"
},
{
"label": "Low",
"dataFilter": {
"severity": "Low"
},
"dataSourceId": "count"
}
]
},
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert",
"groupBy": [
"severity"
]
}
},
{
"id": "alerts2",
"size": "MEDIUM",
"title": "Alert - Status",
"type": "VALUE",
"attributes": [
{
"id": "count"
}
]
"content": {
"attributes": [{
"label": "New",
"dataFilter": {
"status": "New"
},
"dataSourceId": "count"
},
{
"label": "Validated",
"dataFilter": {
"status": "Validated"
},
"dataSourceId": "count"
},
{
"label": "Resolved",
"dataFilter": {
"status": "Resolved"
},
"dataSourceId": "count"
}
]
},
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert",
"groupBy": [
"status"
]
}
},
{
"id": "alerts3",
"size": "MEDIUM",
"title": "Alert types",
"type": "VALUE",
"attributes": [
{
"id": "count"
}
]
"content": {
"attributes": [{
"label": "Load - High level detected",
"dataFilter": {
"name": "load_warning_level"
},
"dataSourceId": "count"
},
{
"label": "Travel time - Robot travelling two slowly",
"dataFilter": {
"name": "robot_too_slow"
},
"dataSourceId": "count"
},
{
"label": "Work performed too high",
"dataFilter": {
"=name": "work_performed_too_high"
},
"dataSourceId": "count"
}
]
},
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert",
"groupBy": [
"name"
]
}
},
{
"id": "alerts4",
"size": "MEDIUM",
"title": "Alert - Owner",
"type": "VALUE",
"attributes": [
{
"id": "count"
}
]
"content": {
"attributes": [{
"label": "John Smith",
"dataFilter": {
"Owner": "jsmith@company.com"
},
"dataSourceId": "count"
},
{
"label": "Jane Jones",
"dataFilter": {
"Owner": "jjones@company.com"
},
"dataSourceId": "count"
},
{
"label": "Taylor Dunne",
"dataFilter": {
"Owner": "tdunne@company.com"
},
"dataSourceId": "count"
}
]
},
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert",
"groupBy": [
"Owner"
]
}
},
{
"id": "alerts",
"size": "LARGEWIDE",
"title": "Alerts in the last 24 hours",
"type": "ALERT",
"attributes": [
{
"id": "count"
}
]
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert"
}
}
],
"title": "Robot - alerts",
"timeGrain": "hour",
"description": "Robot tickets",
"layouts": {}
}
Step 7: Review the dashboard
Open the dashboard for a device. Modify the alerts in the alerts table and monitor the updates that are made to the value cards.