Kurs: Dodawanie panelu kontrolnego do prezentacji alertów
W tym kursie konfigurowany jest panel kontrolny do śledzenia alertów.
Informacje o tym zadaniu
- Wyświetlanie alertów według istotności.
- Wyświetlanie alertów według statusu.
- Wyświetlanie alertów według statusu alertu.
- Wyświetlanie alertów według właściciela
- Wyświetlanie tabeli alertów.
Zanim rozpoczniesz
- Ukończenie kursu Dodawanie danych z urządzeń fizycznych .
- Utwórz pusty panel kontrolny jako podstawę dla nowego panelu kontrolnego. Użyj następującej konfiguracji:
{ "cards": [], "title": "Robot alerts", "timeGrain": "hour", "description": "Robot tickets", "layouts": {} } - Wygeneruj kilka alertów.
- Za pomocą funkcji AlertHighnależy utworzyć alert load_warning_level na elemencie danych ładowania, ustawić górny próg na 300, poziom istotności na średni oraz status na poprawność sprawdzoną. Zaplanuj uruchomienie funkcji na danych z ostatnich 5 dni.
- Za pomocą funkcji AlertLownależy utworzyć alert robot_too_slow na elemencie danych travel_time, ustawić dolny próg na 1, poziom istotności na wysoki oraz status na nowy. Zaplanuj uruchomienie funkcji na danych z ostatnich 5 dni.
- Za pomocą funkcji AlertLownależy utworzyć alert work_performed_too_high na elemencie danych work_performed, ustawić górny próg na 1500, istotność na wartość medium oraz status na nowy. Zaplanuj uruchomienie funkcji na danych z ostatnich 5 dni.
Krok 1: wyświetlanie alertów według istotności
W konfiguracji card card ustaw wartość "type":
"alert" w obiekcie cards.dataSource , a następnie ustaw wartość "dataSourceId":
"count".
Obiekt dataFilter służy do filtrowania każdego atrybutu według wartości pola alertu, na przykład przez alerty o istotności krytycznej. Jeśli zostanie określony filtr danych, należy dołączyć filtr do pola groupBy w konfiguracji dataSource .
W tym kroku przefiltruj kartę wartości według istotności. Wyświetl liczbę alertów o wysokiej, średniej i niskiej istotności.
{
"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"
]
}
}Dodaj przykład karty wartości do panelu kontrolnego.
Krok 2: Wyświetlanie alertów według statusu
Przefiltruj kartę wartości według statusu. Wyświetl liczbę nowych, sprawdzonych i rozwiązanych alertów na karcie.
Przykład:
{
"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"
]
}
}
Dodaj przykład karty wartości do panelu kontrolnego.
Krok 3: wyświetlanie alertów według typu alertu
Przefiltruj kartę wartości według nazwy alertu. Wyświetl liczbę następujących nazw alertów:
-` load_warning_level `
-"robot_too_slow"
-` work_performed_too_high `
Użyj nazwy, aby filtrować według nazwy alertu.
Przykład:
<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"
]
}
}
Dodaj przykład karty wartości do panelu kontrolnego.
Krok 4: Wyświetlanie alertów według właściciela w karcie wartości
Przefiltruj kartę wartości wg właściciela alertu. Wyświetl liczbę alertów przypadających na każdego właściciela. Zmień właścicieli na nazwy użytkowników, które zostały skonfigurowane w środowisku demonstracyjnym.
Przykład:
{
"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"
]
}
}
Dodaj przykład karty wartości do panelu kontrolnego.
Krok 5: Dodawanie tabeli alertów
Dodaj tabelę alertów, aby wyświetlić alerty dla ostatnich 24 godzin.
Przykład:
{
"id": "alerts",
"size": "LARGEWIDE",
"title": "Alerts in the last 24 hours",
"type": "ALERT",
"attributes": [
{
"id": "count"
}
]
"dataSource": {
"range": {
"count": -24,
"interval": "hour"
},
"type": "alert"
}
}
Dodaj przykład tabeli alertów do panelu kontrolnego.
Krok 6: importowanie panelu kontrolnego
- Zaloguj się jako administrator.
- Na stronie Monitor (Monitor) na karcie Devices (Urządzenia) wybierz typ urządzenia robota, który został utworzony dla kursu.
- Kliknij ikonę Ustawienia , a następnie wybierz opcję Edytuj panel kontrolny.
- Kliknij ikonę importu, aby przesłać lokalny plik konfiguracyjny panelu kontrolnego JSON.
Przykład zaktualizowanego panelu kontrolnego:
{
"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": {}
}
Krok 7: przegląd panelu kontrolnego
Otwórz panel kontrolny dla urządzenia. Zmodyfikuj alerty w tabeli alertów i monitoruj zmiany zachodzące na kartach wartości.