Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | // Copyright (c) 2018 Intel Corporation |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #pragma once |
| 18 | #include <sel_logger.hpp> |
| 19 | #include <sensorutils.hpp> |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 20 | |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 21 | #include <string_view> |
Jason M. Bills | 2bc9f0d | 2019-03-27 11:13:12 -0700 | [diff] [blame] | 22 | #include <variant> |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 23 | |
| 24 | enum class thresholdEventOffsets : uint8_t |
| 25 | { |
| 26 | lowerNonCritGoingLow = 0x00, |
| 27 | lowerCritGoingLow = 0x02, |
| 28 | upperNonCritGoingHigh = 0x07, |
| 29 | upperCritGoingHigh = 0x09, |
| 30 | }; |
| 31 | |
| 32 | static constexpr const uint8_t thresholdEventDataTriggerReadingByte2 = (1 << 6); |
| 33 | static constexpr const uint8_t thresholdEventDataTriggerReadingByte3 = (1 << 4); |
| 34 | |
Jason M. Bills | 60ec28a | 2019-04-11 16:53:44 -0700 | [diff] [blame] | 35 | static const std::string openBMCMessageRegistryVersion("0.1"); |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 36 | |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 37 | inline static sdbusplus::bus::match_t startThresholdAssertMonitor( |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 38 | std::shared_ptr<sdbusplus::asio::connection> conn) |
| 39 | { |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 40 | auto thresholdAssertMatcherCallback = [conn](sdbusplus::message_t& msg) { |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 41 | // This static set of std::pair<path, event> tracks asserted events to |
| 42 | // avoid duplicate logs or deasserts logged without an assert |
| 43 | static boost::container::flat_set<std::pair<std::string, std::string>> |
| 44 | assertedEvents; |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 45 | std::vector<uint8_t> eventData(selEvtDataMaxSize, |
| 46 | selEvtDataUnspecified); |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 47 | |
| 48 | // Get the event type and assertion details from the message |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 49 | std::string sensorName; |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 50 | std::string thresholdInterface; |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 51 | std::string event; |
| 52 | bool assert; |
| 53 | double assertValue; |
| 54 | try |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 55 | { |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 56 | msg.read(sensorName, thresholdInterface, event, assert, |
| 57 | assertValue); |
| 58 | } |
Patrick Williams | 3f4cd97 | 2021-10-06 12:42:50 -0500 | [diff] [blame] | 59 | catch (const sdbusplus::exception_t&) |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 60 | { |
| 61 | std::cerr << "error getting assert signal data from " |
| 62 | << msg.get_path() << "\n"; |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 63 | return; |
| 64 | } |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 65 | |
| 66 | // Check the asserted events to determine if we should log this event |
| 67 | std::pair<std::string, std::string> pathAndEvent( |
| 68 | std::string(msg.get_path()), event); |
| 69 | if (assert) |
| 70 | { |
| 71 | // For asserts, add the event to the set and only log it if it's new |
| 72 | if (assertedEvents.insert(pathAndEvent).second == false) |
| 73 | { |
| 74 | // event is already in the set |
| 75 | return; |
| 76 | } |
| 77 | } |
| 78 | else |
| 79 | { |
| 80 | // For deasserts, remove the event and only log the deassert if it |
| 81 | // was asserted |
| 82 | if (assertedEvents.erase(pathAndEvent) == 0) |
| 83 | { |
| 84 | // asserted event was not in the set |
| 85 | return; |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | // Set the IPMI threshold event type based on the event details from the |
| 90 | // message |
| 91 | if (event == "CriticalAlarmLow") |
| 92 | { |
| 93 | eventData[0] = |
| 94 | static_cast<uint8_t>(thresholdEventOffsets::lowerCritGoingLow); |
| 95 | } |
| 96 | else if (event == "WarningAlarmLow") |
| 97 | { |
| 98 | eventData[0] = static_cast<uint8_t>( |
| 99 | thresholdEventOffsets::lowerNonCritGoingLow); |
| 100 | } |
| 101 | else if (event == "WarningAlarmHigh") |
| 102 | { |
| 103 | eventData[0] = static_cast<uint8_t>( |
| 104 | thresholdEventOffsets::upperNonCritGoingHigh); |
| 105 | } |
| 106 | else if (event == "CriticalAlarmHigh") |
| 107 | { |
| 108 | eventData[0] = |
| 109 | static_cast<uint8_t>(thresholdEventOffsets::upperCritGoingHigh); |
| 110 | } |
| 111 | // Indicate that bytes 2 and 3 are threshold sensor trigger values |
| 112 | eventData[0] |= thresholdEventDataTriggerReadingByte2 | |
| 113 | thresholdEventDataTriggerReadingByte3; |
| 114 | |
| 115 | // Get the sensor reading to put in the event data |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 116 | sdbusplus::message_t getSensorValue = |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 117 | conn->new_method_call(msg.get_sender(), msg.get_path(), |
| 118 | "org.freedesktop.DBus.Properties", "GetAll"); |
| 119 | getSensorValue.append("xyz.openbmc_project.Sensor.Value"); |
George Hung | d9d7896 | 2019-03-27 13:25:24 +0800 | [diff] [blame] | 120 | boost::container::flat_map<std::string, std::variant<double, int64_t>> |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 121 | sensorValue; |
| 122 | try |
| 123 | { |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 124 | sdbusplus::message_t getSensorValueResp = |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 125 | conn->call(getSensorValue); |
| 126 | getSensorValueResp.read(sensorValue); |
| 127 | } |
Patrick Williams | 3f4cd97 | 2021-10-06 12:42:50 -0500 | [diff] [blame] | 128 | catch (const sdbusplus::exception_t&) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 129 | { |
| 130 | std::cerr << "error getting sensor value from " << msg.get_path() |
| 131 | << "\n"; |
| 132 | return; |
| 133 | } |
Jason M. Bills | bb071fb | 2019-03-27 11:15:42 -0700 | [diff] [blame] | 134 | double max = 0; |
| 135 | auto findMax = sensorValue.find("MaxValue"); |
| 136 | if (findMax != sensorValue.end()) |
| 137 | { |
| 138 | max = std::visit(ipmi::VariantToDoubleVisitor(), findMax->second); |
| 139 | } |
| 140 | double min = 0; |
| 141 | auto findMin = sensorValue.find("MinValue"); |
| 142 | if (findMin != sensorValue.end()) |
| 143 | { |
| 144 | min = std::visit(ipmi::VariantToDoubleVisitor(), findMin->second); |
| 145 | } |
George Hung | d9d7896 | 2019-03-27 13:25:24 +0800 | [diff] [blame] | 146 | |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 147 | try |
| 148 | { |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 149 | eventData[1] = ipmi::getScaledIPMIValue(assertValue, max, min); |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 150 | } |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 151 | catch (const std::exception& e) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 152 | { |
| 153 | std::cerr << e.what(); |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 154 | eventData[1] = selEvtDataUnspecified; |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 155 | } |
| 156 | |
| 157 | // Get the threshold value to put in the event data |
| 158 | // Get the threshold parameter by removing the "Alarm" text from the |
| 159 | // event string |
| 160 | std::string alarm("Alarm"); |
| 161 | if (std::string::size_type pos = event.find(alarm); |
| 162 | pos != std::string::npos) |
| 163 | { |
| 164 | event.erase(pos, alarm.length()); |
| 165 | } |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 166 | sdbusplus::message_t getThreshold = |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 167 | conn->new_method_call(msg.get_sender(), msg.get_path(), |
| 168 | "org.freedesktop.DBus.Properties", "Get"); |
| 169 | getThreshold.append(thresholdInterface, event); |
George Hung | d9d7896 | 2019-03-27 13:25:24 +0800 | [diff] [blame] | 170 | std::variant<double, int64_t> thresholdValue; |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 171 | try |
| 172 | { |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 173 | sdbusplus::message_t getThresholdResp = conn->call(getThreshold); |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 174 | getThresholdResp.read(thresholdValue); |
| 175 | } |
Patrick Williams | 3f4cd97 | 2021-10-06 12:42:50 -0500 | [diff] [blame] | 176 | catch (const sdbusplus::exception_t&) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 177 | { |
| 178 | std::cerr << "error getting sensor threshold from " |
| 179 | << msg.get_path() << "\n"; |
| 180 | return; |
| 181 | } |
Patrick Williams | 5a18f10 | 2024-08-16 15:20:38 -0400 | [diff] [blame^] | 182 | double thresholdVal = |
| 183 | std::visit(ipmi::VariantToDoubleVisitor(), thresholdValue); |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 184 | |
| 185 | double scale = 0; |
| 186 | auto findScale = sensorValue.find("Scale"); |
George Hung | d9d7896 | 2019-03-27 13:25:24 +0800 | [diff] [blame] | 187 | if (findScale != sensorValue.end()) |
| 188 | { |
Patrick Williams | 5a18f10 | 2024-08-16 15:20:38 -0400 | [diff] [blame^] | 189 | scale = |
| 190 | std::visit(ipmi::VariantToDoubleVisitor(), findScale->second); |
George Hung | d9d7896 | 2019-03-27 13:25:24 +0800 | [diff] [blame] | 191 | thresholdVal *= std::pow(10, scale); |
| 192 | } |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 193 | try |
| 194 | { |
| 195 | eventData[2] = ipmi::getScaledIPMIValue(thresholdVal, max, min); |
| 196 | } |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 197 | catch (const std::exception& e) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 198 | { |
| 199 | std::cerr << e.what(); |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 200 | eventData[2] = selEvtDataUnspecified; |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 201 | } |
| 202 | |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 203 | std::string threshold; |
| 204 | std::string direction; |
Patrick Williams | 5a18f10 | 2024-08-16 15:20:38 -0400 | [diff] [blame^] | 205 | std::string redfishMessageID = |
| 206 | "OpenBMC." + openBMCMessageRegistryVersion; |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 207 | enum EventType |
| 208 | { |
| 209 | eventNone, |
| 210 | eventInfo, |
| 211 | eventWarn, |
| 212 | eventErr |
| 213 | }; |
Glukhov Mikhail | 8cb7d0a | 2023-04-06 07:21:23 +0300 | [diff] [blame] | 214 | [[maybe_unused]] EventType eventType = eventNone; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 215 | if (event == "CriticalLow") |
| 216 | { |
| 217 | threshold = "critical low"; |
| 218 | if (assert) |
| 219 | { |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 220 | eventType = eventErr; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 221 | direction = "low"; |
Jason M. Bills | 60ec28a | 2019-04-11 16:53:44 -0700 | [diff] [blame] | 222 | redfishMessageID += ".SensorThresholdCriticalLowGoingLow"; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 223 | } |
| 224 | else |
| 225 | { |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 226 | eventType = eventInfo; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 227 | direction = "high"; |
Jason M. Bills | 60ec28a | 2019-04-11 16:53:44 -0700 | [diff] [blame] | 228 | redfishMessageID += ".SensorThresholdCriticalLowGoingHigh"; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 229 | } |
| 230 | } |
| 231 | else if (event == "WarningLow") |
| 232 | { |
| 233 | threshold = "warning low"; |
| 234 | if (assert) |
| 235 | { |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 236 | eventType = eventWarn; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 237 | direction = "low"; |
Jason M. Bills | 60ec28a | 2019-04-11 16:53:44 -0700 | [diff] [blame] | 238 | redfishMessageID += ".SensorThresholdWarningLowGoingLow"; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 239 | } |
| 240 | else |
| 241 | { |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 242 | eventType = eventInfo; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 243 | direction = "high"; |
Jason M. Bills | 60ec28a | 2019-04-11 16:53:44 -0700 | [diff] [blame] | 244 | redfishMessageID += ".SensorThresholdWarningLowGoingHigh"; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 245 | } |
| 246 | } |
| 247 | else if (event == "WarningHigh") |
| 248 | { |
| 249 | threshold = "warning high"; |
| 250 | if (assert) |
| 251 | { |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 252 | eventType = eventWarn; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 253 | direction = "high"; |
Jason M. Bills | 60ec28a | 2019-04-11 16:53:44 -0700 | [diff] [blame] | 254 | redfishMessageID += ".SensorThresholdWarningHighGoingHigh"; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 255 | } |
| 256 | else |
| 257 | { |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 258 | eventType = eventInfo; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 259 | direction = "low"; |
Jason M. Bills | 60ec28a | 2019-04-11 16:53:44 -0700 | [diff] [blame] | 260 | redfishMessageID += ".SensorThresholdWarningHighGoingLow"; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 261 | } |
| 262 | } |
| 263 | else if (event == "CriticalHigh") |
| 264 | { |
| 265 | threshold = "critical high"; |
| 266 | if (assert) |
| 267 | { |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 268 | eventType = eventErr; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 269 | direction = "high"; |
Jason M. Bills | 60ec28a | 2019-04-11 16:53:44 -0700 | [diff] [blame] | 270 | redfishMessageID += ".SensorThresholdCriticalHighGoingHigh"; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 271 | } |
| 272 | else |
| 273 | { |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 274 | eventType = eventInfo; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 275 | direction = "low"; |
Jason M. Bills | 60ec28a | 2019-04-11 16:53:44 -0700 | [diff] [blame] | 276 | redfishMessageID += ".SensorThresholdCriticalHighGoingLow"; |
Jason M. Bills | 2b9704d | 2018-11-02 13:12:09 -0700 | [diff] [blame] | 277 | } |
| 278 | } |
| 279 | |
Konstantin Aladyshev | d067a6b | 2023-03-31 09:22:49 +0000 | [diff] [blame] | 280 | std::string journalMsg( |
| 281 | std::string(sensorName) + " " + threshold + " threshold " + |
| 282 | (assert ? "assert" : "deassert") + |
| 283 | ". Reading=" + std::to_string(assertValue) + |
| 284 | " Threshold=" + std::to_string(thresholdVal) + "."); |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 285 | |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 286 | #ifdef SEL_LOGGER_SEND_TO_LOGGING_SERVICE |
| 287 | std::string LogLevel = ""; |
| 288 | switch (eventType) |
| 289 | { |
| 290 | case eventInfo: |
| 291 | { |
| 292 | LogLevel = |
| 293 | "xyz.openbmc_project.Logging.Entry.Level.Informational"; |
| 294 | break; |
| 295 | } |
| 296 | case eventWarn: |
| 297 | { |
| 298 | LogLevel = "xyz.openbmc_project.Logging.Entry.Level.Warning"; |
| 299 | break; |
| 300 | } |
| 301 | case eventErr: |
| 302 | { |
| 303 | LogLevel = "xyz.openbmc_project.Logging.Entry.Level.Critical"; |
| 304 | break; |
| 305 | } |
| 306 | default: |
| 307 | { |
| 308 | LogLevel = "xyz.openbmc_project.Logging.Entry.Level.Debug"; |
| 309 | break; |
| 310 | } |
| 311 | } |
| 312 | if (eventType != eventNone) |
| 313 | { |
Patrick Williams | 99f6997 | 2023-03-28 02:31:11 -0500 | [diff] [blame] | 314 | sdbusplus::message_t AddToLog = conn->new_method_call( |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 315 | "xyz.openbmc_project.Logging", "/xyz/openbmc_project/logging", |
| 316 | "xyz.openbmc_project.Logging.Create", "Create"); |
| 317 | AddToLog.append(journalMsg, LogLevel, |
| 318 | std::map<std::string, std::string>( |
| 319 | {{"SENSOR_PATH", std::string(msg.get_path())}, |
| 320 | {"EVENT", threshold}, |
| 321 | {"DIRECTION", direction}, |
| 322 | {"THRESHOLD", std::to_string(thresholdVal)}, |
| 323 | {"READING", std::to_string(assertValue)}})); |
| 324 | conn->call(AddToLog); |
| 325 | } |
| 326 | #else |
Jason M. Bills | 5ff505f | 2019-04-11 16:58:01 -0700 | [diff] [blame] | 327 | selAddSystemRecord( |
Konstantin Aladyshev | 6f5342d | 2023-04-19 09:23:11 +0000 | [diff] [blame] | 328 | conn, journalMsg, std::string(msg.get_path()), eventData, assert, |
Jason M. Bills | 5ff505f | 2019-04-11 16:58:01 -0700 | [diff] [blame] | 329 | selBMCGenID, "REDFISH_MESSAGE_ID=%s", redfishMessageID.c_str(), |
| 330 | "REDFISH_MESSAGE_ARGS=%.*s,%f,%f", sensorName.length(), |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 331 | sensorName.data(), assertValue, thresholdVal); |
Glukhov Mikhail | 3fc535c | 2023-03-15 09:50:55 +0300 | [diff] [blame] | 332 | #endif |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 333 | }; |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 334 | sdbusplus::bus::match_t thresholdAssertMatcher( |
| 335 | static_cast<sdbusplus::bus_t&>(*conn), |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 336 | "type='signal', member='ThresholdAsserted'", |
| 337 | std::move(thresholdAssertMatcherCallback)); |
| 338 | return thresholdAssertMatcher; |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 339 | } |