summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0015-Add-state-sensor-messages-to-the-registry.patch
blob: 1193fe9d1756c29e5bf891888805be5d0c5c0b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From b468b508176dfffe2e8e4adb3052577b9ff70d2f Mon Sep 17 00:00:00 2001
From: "Arun P. Mohanan" <arun.p.m@linux.intel.com>
Date: Wed, 27 Jan 2021 18:22:58 +0530
Subject: [PATCH] Add state sensor messages to the registry

Add messages to registry to indicate state sensor state change.

Tested:
Build and redfish validator passes.
Logged these events and confirmed that they appear as expected on
Redfish.
GET: https://<BMC IP>/redfish/v1/Systems/system/LogServices/EventLog/Entries/1612528180
{
    "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1612528180",
    "@odata.type": "#LogEntry.v1_4_0.LogEntry",
    "Created": "2021-02-05T12:29:40+00:00",
    "EntryType": "Event",
    "Id": "1612528180",
    "Message": "Operational Fault Status of Card_health_1 state sensor changed from Error to Normal.",
    "MessageArgs": [
        "Operational Fault Status",
        "Card_health_1",
        "Error",
        "Normal"
    ],
    "MessageId": "OpenBMC.0.1.StateSensorNormal",
    "Name": "System Event Log Entry",
    "Severity": "OK"
}

Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com>
---
 .../registries/openbmc_message_registry.hpp   | 36 +++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/redfish-core/include/registries/openbmc_message_registry.hpp b/redfish-core/include/registries/openbmc_message_registry.hpp
index 6cf503f..87b2913 100644
--- a/redfish-core/include/registries/openbmc_message_registry.hpp
+++ b/redfish-core/include/registries/openbmc_message_registry.hpp
@@ -29,7 +29,7 @@ const Header header = {
     "0.2.0",
     "OpenBMC",
 };
-constexpr std::array<MessageEntry, 188> registry = {
+constexpr std::array<MessageEntry, 191> registry = {
     MessageEntry{
         "ADDDCCorrectable",
         {
@@ -2331,6 +2331,39 @@ constexpr std::array<MessageEntry, 188> registry = {
                      {},
                      "None.",
                  }},
+    MessageEntry{
+        "StateSensorNormal",
+        {
+            "Indicates that a state sensor has changed state to normal.",
+            "%1 of %2 state sensor changed from %3 to %4.",
+            "OK",
+            "OK",
+            4,
+            {"string", "string", "string", "string"},
+            "None.",
+        }},
+    MessageEntry{
+        "StateSensorWarning",
+        {
+            "Indicates that a state sensor has changed state to warning.",
+            "%1 of %2 state sensor changed from %3 to %4.",
+            "Warning",
+            "Warning",
+            4,
+            {"string", "string", "string", "string"},
+            "Check sensor subsystem for errors.",
+        }},
+    MessageEntry{
+        "StateSensorCritical",
+        {
+            "Indicates that a state sensor has changed state to critical.",
+            "%1 of %2 state sensor changed from %3 to %4.",
+            "Critical",
+            "Critical",
+            4,
+            {"string", "string", "string", "string"},
+            "Check sensor subsystem for errors.",
+        }},
     MessageEntry{"SystemInterfaceDisabledProvisioned",
                  {
                      "Indicates that the system interface is in the disabled "
@@ -2423,6 +2456,5 @@ constexpr std::array<MessageEntry, 188> registry = {
             {"string"},
             "None.",
         }},
-
 };
 } // namespace redfish::message_registries::openbmc
-- 
2.17.1