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 | #include <systemd/sd-journal.h> |
| 17 | |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 18 | #include <boost/algorithm/string.hpp> |
Ed Tanous | 9092699 | 2020-09-11 12:59:33 -0700 | [diff] [blame] | 19 | #include <boost/asio/io_service.hpp> |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 20 | #include <boost/container/flat_map.hpp> |
| 21 | #include <boost/container/flat_set.hpp> |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 22 | #include <pulse_event_monitor.hpp> |
| 23 | #include <sdbusplus/asio/object_server.hpp> |
| 24 | #include <sel_logger.hpp> |
| 25 | #include <threshold_event_monitor.hpp> |
Charles Hsu | dbd77b9 | 2020-10-29 11:20:34 +0800 | [diff] [blame] | 26 | #include <watchdog_event_monitor.hpp> |
George Hung | 486e42e | 2021-04-14 20:20:42 +0800 | [diff] [blame] | 27 | #ifdef SEL_LOGGER_MONITOR_THRESHOLD_ALARM_EVENTS |
| 28 | #include <threshold_alarm_event_monitor.hpp> |
| 29 | #endif |
JinFuLin | 7c2810b | 2022-12-02 13:55:28 +0800 | [diff] [blame^] | 30 | #ifdef SEL_LOGGER_MONITOR_HOST_ERROR_EVENTS |
| 31 | #include <host_error_event_monitor.hpp> |
| 32 | #endif |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 33 | |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 34 | #include <filesystem> |
| 35 | #include <fstream> |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 36 | #include <iomanip> |
| 37 | #include <iostream> |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 38 | #include <sstream> |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 39 | |
Lei YU | e526b86 | 2020-12-03 15:41:59 +0800 | [diff] [blame] | 40 | #ifdef SEL_LOGGER_SEND_TO_LOGGING_SERVICE |
| 41 | #include <phosphor-logging/elog-errors.hpp> |
| 42 | #include <phosphor-logging/elog.hpp> |
| 43 | #include <phosphor-logging/log.hpp> |
| 44 | #include <xyz/openbmc_project/Logging/SEL/error.hpp> |
| 45 | |
| 46 | using namespace phosphor::logging; |
| 47 | using SELCreated = |
| 48 | sdbusplus::xyz::openbmc_project::Logging::SEL::Error::Created; |
| 49 | #endif |
| 50 | |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 51 | struct DBusInternalError final : public sdbusplus::exception_t |
| 52 | { |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 53 | const char* name() const noexcept override |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 54 | { |
| 55 | return "org.freedesktop.DBus.Error.Failed"; |
Patrick Williams | a138ebd | 2021-09-08 15:46:34 -0500 | [diff] [blame] | 56 | } |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 57 | const char* description() const noexcept override |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 58 | { |
| 59 | return "internal error"; |
Patrick Williams | a138ebd | 2021-09-08 15:46:34 -0500 | [diff] [blame] | 60 | } |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 61 | const char* what() const noexcept override |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 62 | { |
| 63 | return "org.freedesktop.DBus.Error.Failed: " |
| 64 | "internal error"; |
Patrick Williams | a138ebd | 2021-09-08 15:46:34 -0500 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | int get_errno() const noexcept override |
| 68 | { |
| 69 | return EACCES; |
| 70 | } |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 71 | }; |
| 72 | |
Lei YU | e526b86 | 2020-12-03 15:41:59 +0800 | [diff] [blame] | 73 | #ifndef SEL_LOGGER_SEND_TO_LOGGING_SERVICE |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 74 | static bool getSELLogFiles(std::vector<std::filesystem::path>& selLogFiles) |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 75 | { |
| 76 | // Loop through the directory looking for ipmi_sel log files |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 77 | for (const std::filesystem::directory_entry& dirEnt : |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 78 | std::filesystem::directory_iterator(selLogDir)) |
| 79 | { |
| 80 | std::string filename = dirEnt.path().filename(); |
| 81 | if (boost::starts_with(filename, selLogFilename)) |
| 82 | { |
| 83 | // If we find an ipmi_sel log file, save the path |
| 84 | selLogFiles.emplace_back(selLogDir / filename); |
| 85 | } |
| 86 | } |
| 87 | // As the log files rotate, they are appended with a ".#" that is higher for |
| 88 | // the older logs. Since we don't expect more than 10 log files, we |
| 89 | // can just sort the list to get them in order from newest to oldest |
| 90 | std::sort(selLogFiles.begin(), selLogFiles.end()); |
| 91 | |
| 92 | return !selLogFiles.empty(); |
| 93 | } |
| 94 | |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 95 | static unsigned int initializeRecordId(void) |
| 96 | { |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 97 | std::vector<std::filesystem::path> selLogFiles; |
| 98 | if (!getSELLogFiles(selLogFiles)) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 99 | { |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 100 | return selInvalidRecID; |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 101 | } |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 102 | std::ifstream logStream(selLogFiles.front()); |
| 103 | if (!logStream.is_open()) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 104 | { |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 105 | return selInvalidRecID; |
| 106 | } |
| 107 | std::string line; |
| 108 | std::string newestEntry; |
| 109 | while (std::getline(logStream, line)) |
| 110 | { |
| 111 | newestEntry = line; |
| 112 | } |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 113 | |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 114 | std::vector<std::string> newestEntryFields; |
| 115 | boost::split(newestEntryFields, newestEntry, boost::is_any_of(" ,"), |
| 116 | boost::token_compress_on); |
| 117 | if (newestEntryFields.size() < 4) |
| 118 | { |
| 119 | return selInvalidRecID; |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 120 | } |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 121 | |
| 122 | return std::stoul(newestEntryFields[1]); |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 123 | } |
| 124 | |
Charles Boyer | 9f476e8 | 2021-07-29 16:33:01 -0500 | [diff] [blame] | 125 | #ifdef SEL_LOGGER_CLEARS_SEL |
| 126 | static unsigned int recordId = initializeRecordId(); |
| 127 | |
| 128 | void clearSelLogFiles() |
| 129 | { |
| 130 | // Clear the SEL by deleting the log files |
| 131 | std::vector<std::filesystem::path> selLogFiles; |
| 132 | if (getSELLogFiles(selLogFiles)) |
| 133 | { |
| 134 | for (const std::filesystem::path& file : selLogFiles) |
| 135 | { |
| 136 | std::error_code ec; |
| 137 | std::filesystem::remove(file, ec); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | recordId = selInvalidRecID; |
| 142 | |
| 143 | // Reload rsyslog so it knows to start new log files |
| 144 | boost::asio::io_service io; |
| 145 | auto dbus = std::make_shared<sdbusplus::asio::connection>(io); |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 146 | sdbusplus::message_t rsyslogReload = dbus->new_method_call( |
Charles Boyer | 9f476e8 | 2021-07-29 16:33:01 -0500 | [diff] [blame] | 147 | "org.freedesktop.systemd1", "/org/freedesktop/systemd1", |
| 148 | "org.freedesktop.systemd1.Manager", "ReloadUnit"); |
| 149 | rsyslogReload.append("rsyslog.service", "replace"); |
| 150 | try |
| 151 | { |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 152 | sdbusplus::message_t reloadResponse = dbus->call(rsyslogReload); |
Charles Boyer | 9f476e8 | 2021-07-29 16:33:01 -0500 | [diff] [blame] | 153 | } |
Patrick Williams | 3f4cd97 | 2021-10-06 12:42:50 -0500 | [diff] [blame] | 154 | catch (const sdbusplus::exception_t& e) |
Charles Boyer | 9f476e8 | 2021-07-29 16:33:01 -0500 | [diff] [blame] | 155 | { |
| 156 | std::cerr << e.what() << "\n"; |
| 157 | } |
| 158 | } |
| 159 | #endif |
| 160 | |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 161 | static unsigned int getNewRecordId(void) |
| 162 | { |
Charles Boyer | 9f476e8 | 2021-07-29 16:33:01 -0500 | [diff] [blame] | 163 | #ifndef SEL_LOGGER_CLEARS_SEL |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 164 | static unsigned int recordId = initializeRecordId(); |
| 165 | |
Jason M. Bills | 6afe956 | 2019-08-29 16:33:55 -0700 | [diff] [blame] | 166 | // If the log has been cleared, also clear the current ID |
| 167 | std::vector<std::filesystem::path> selLogFiles; |
| 168 | if (!getSELLogFiles(selLogFiles)) |
| 169 | { |
| 170 | recordId = selInvalidRecID; |
| 171 | } |
Charles Boyer | 9f476e8 | 2021-07-29 16:33:01 -0500 | [diff] [blame] | 172 | #endif |
Jason M. Bills | 6afe956 | 2019-08-29 16:33:55 -0700 | [diff] [blame] | 173 | |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 174 | if (++recordId >= selInvalidRecID) |
| 175 | { |
| 176 | recordId = 1; |
| 177 | } |
| 178 | return recordId; |
| 179 | } |
Lei YU | e526b86 | 2020-12-03 15:41:59 +0800 | [diff] [blame] | 180 | #endif |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 181 | |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 182 | static void toHexStr(const std::vector<uint8_t>& data, std::string& hexStr) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 183 | { |
| 184 | std::stringstream stream; |
| 185 | stream << std::hex << std::uppercase << std::setfill('0'); |
William A. Kennington III | 2e43726 | 2021-07-30 12:04:19 -0700 | [diff] [blame] | 186 | for (int v : data) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 187 | { |
| 188 | stream << std::setw(2) << v; |
| 189 | } |
| 190 | hexStr = stream.str(); |
| 191 | } |
| 192 | |
Jason M. Bills | 97be353 | 2018-11-02 13:09:16 -0700 | [diff] [blame] | 193 | template <typename... T> |
William A. Kennington III | d585c59 | 2021-07-30 12:10:25 -0700 | [diff] [blame] | 194 | static uint16_t selAddSystemRecord([[maybe_unused]] const std::string& message, |
| 195 | const std::string& path, |
| 196 | const std::vector<uint8_t>& selData, |
| 197 | const bool& assert, const uint16_t& genId, |
| 198 | [[maybe_unused]] T&&... metadata) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 199 | { |
| 200 | // Only 3 bytes of SEL event data are allowed in a system record |
| 201 | if (selData.size() > selEvtDataMaxSize) |
| 202 | { |
| 203 | throw std::invalid_argument("Event data too large"); |
| 204 | } |
| 205 | std::string selDataStr; |
| 206 | toHexStr(selData, selDataStr); |
| 207 | |
Lei YU | e526b86 | 2020-12-03 15:41:59 +0800 | [diff] [blame] | 208 | #ifdef SEL_LOGGER_SEND_TO_LOGGING_SERVICE |
| 209 | using namespace xyz::openbmc_project::Logging::SEL; |
Lei YU | 7d8a300 | 2021-01-21 17:16:19 +0800 | [diff] [blame] | 210 | auto entryID = report<SELCreated>( |
Lei YU | e526b86 | 2020-12-03 15:41:59 +0800 | [diff] [blame] | 211 | Created::RECORD_TYPE(selSystemType), Created::GENERATOR_ID(genId), |
| 212 | Created::SENSOR_DATA(selDataStr.c_str()), Created::EVENT_DIR(assert), |
| 213 | Created::SENSOR_PATH(path.c_str())); |
Lei YU | 7d8a300 | 2021-01-21 17:16:19 +0800 | [diff] [blame] | 214 | return static_cast<uint16_t>(entryID); |
Lei YU | e526b86 | 2020-12-03 15:41:59 +0800 | [diff] [blame] | 215 | #else |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 216 | unsigned int recordId = getNewRecordId(); |
Jason M. Bills | 97be353 | 2018-11-02 13:09:16 -0700 | [diff] [blame] | 217 | sd_journal_send("MESSAGE=%s", message.c_str(), "PRIORITY=%i", selPriority, |
| 218 | "MESSAGE_ID=%s", selMessageId, "IPMI_SEL_RECORD_ID=%d", |
| 219 | recordId, "IPMI_SEL_RECORD_TYPE=%x", selSystemType, |
| 220 | "IPMI_SEL_GENERATOR_ID=%x", genId, |
| 221 | "IPMI_SEL_SENSOR_PATH=%s", path.c_str(), |
| 222 | "IPMI_SEL_EVENT_DIR=%x", assert, "IPMI_SEL_DATA=%s", |
| 223 | selDataStr.c_str(), std::forward<T>(metadata)..., NULL); |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 224 | return recordId; |
Lei YU | e526b86 | 2020-12-03 15:41:59 +0800 | [diff] [blame] | 225 | #endif |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 226 | } |
| 227 | |
William A. Kennington III | d585c59 | 2021-07-30 12:10:25 -0700 | [diff] [blame] | 228 | static uint16_t selAddOemRecord([[maybe_unused]] const std::string& message, |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 229 | const std::vector<uint8_t>& selData, |
| 230 | const uint8_t& recordType) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 231 | { |
| 232 | // A maximum of 13 bytes of SEL event data are allowed in an OEM record |
| 233 | if (selData.size() > selOemDataMaxSize) |
| 234 | { |
| 235 | throw std::invalid_argument("Event data too large"); |
| 236 | } |
| 237 | std::string selDataStr; |
| 238 | toHexStr(selData, selDataStr); |
| 239 | |
Lei YU | e526b86 | 2020-12-03 15:41:59 +0800 | [diff] [blame] | 240 | #ifdef SEL_LOGGER_SEND_TO_LOGGING_SERVICE |
| 241 | using namespace xyz::openbmc_project::Logging::SEL; |
Lei YU | 7d8a300 | 2021-01-21 17:16:19 +0800 | [diff] [blame] | 242 | auto entryID = report<SELCreated>( |
| 243 | Created::RECORD_TYPE(recordType), Created::GENERATOR_ID(0), |
| 244 | Created::SENSOR_DATA(selDataStr.c_str()), Created::EVENT_DIR(0), |
| 245 | Created::SENSOR_PATH("")); |
| 246 | return static_cast<uint16_t>(entryID); |
Lei YU | e526b86 | 2020-12-03 15:41:59 +0800 | [diff] [blame] | 247 | #else |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 248 | unsigned int recordId = getNewRecordId(); |
| 249 | sd_journal_send("MESSAGE=%s", message.c_str(), "PRIORITY=%i", selPriority, |
| 250 | "MESSAGE_ID=%s", selMessageId, "IPMI_SEL_RECORD_ID=%d", |
| 251 | recordId, "IPMI_SEL_RECORD_TYPE=%x", recordType, |
| 252 | "IPMI_SEL_DATA=%s", selDataStr.c_str(), NULL); |
| 253 | return recordId; |
Lei YU | e526b86 | 2020-12-03 15:41:59 +0800 | [diff] [blame] | 254 | #endif |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 255 | } |
| 256 | |
William A. Kennington III | d585c59 | 2021-07-30 12:10:25 -0700 | [diff] [blame] | 257 | int main(int, char*[]) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 258 | { |
| 259 | // setup connection to dbus |
| 260 | boost::asio::io_service io; |
| 261 | auto conn = std::make_shared<sdbusplus::asio::connection>(io); |
| 262 | |
| 263 | // IPMI SEL Object |
| 264 | conn->request_name(ipmiSelObject); |
| 265 | auto server = sdbusplus::asio::object_server(conn); |
| 266 | |
| 267 | // Add SEL Interface |
| 268 | std::shared_ptr<sdbusplus::asio::dbus_interface> ifaceAddSel = |
| 269 | server.add_interface(ipmiSelPath, ipmiSelAddInterface); |
| 270 | |
| 271 | // Add a new SEL entry |
| 272 | ifaceAddSel->register_method( |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 273 | "IpmiSelAdd", [](const std::string& message, const std::string& path, |
| 274 | const std::vector<uint8_t>& selData, |
| 275 | const bool& assert, const uint16_t& genId) { |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 276 | return selAddSystemRecord(message, path, selData, assert, genId); |
| 277 | }); |
| 278 | // Add a new OEM SEL entry |
| 279 | ifaceAddSel->register_method( |
| 280 | "IpmiSelAddOem", |
Zhikui Ren | 672bdfc | 2020-07-14 11:37:01 -0700 | [diff] [blame] | 281 | [](const std::string& message, const std::vector<uint8_t>& selData, |
| 282 | const uint8_t& recordType) { |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 283 | return selAddOemRecord(message, selData, recordType); |
| 284 | }); |
Charles Boyer | 9f476e8 | 2021-07-29 16:33:01 -0500 | [diff] [blame] | 285 | |
| 286 | #ifdef SEL_LOGGER_CLEARS_SEL |
| 287 | #ifndef SEL_LOGGER_SEND_TO_LOGGING_SERVICE |
| 288 | // Clear SEL entries |
| 289 | ifaceAddSel->register_method("Clear", []() { clearSelLogFiles(); }); |
| 290 | #endif |
| 291 | #endif |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 292 | ifaceAddSel->initialize(); |
| 293 | |
| 294 | #ifdef SEL_LOGGER_MONITOR_THRESHOLD_EVENTS |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 295 | sdbusplus::bus::match_t thresholdAssertMonitor = |
Zhikui Ren | 25b26e1 | 2020-06-26 20:18:19 -0700 | [diff] [blame] | 296 | startThresholdAssertMonitor(conn); |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 297 | #endif |
| 298 | |
Nikhil Potade | afbaa09 | 2019-03-06 16:18:13 -0800 | [diff] [blame] | 299 | #ifdef REDFISH_LOG_MONITOR_PULSE_EVENTS |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 300 | sdbusplus::bus::match_t pulseEventMonitor = startPulseEventMonitor(conn); |
Nikhil Potade | afbaa09 | 2019-03-06 16:18:13 -0800 | [diff] [blame] | 301 | #endif |
| 302 | |
Charles Hsu | dbd77b9 | 2020-10-29 11:20:34 +0800 | [diff] [blame] | 303 | #ifdef SEL_LOGGER_MONITOR_WATCHDOG_EVENTS |
Patrick Williams | ccef227 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 304 | sdbusplus::bus::match_t watchdogEventMonitor = |
Charles Hsu | dbd77b9 | 2020-10-29 11:20:34 +0800 | [diff] [blame] | 305 | startWatchdogEventMonitor(conn); |
| 306 | #endif |
George Hung | 486e42e | 2021-04-14 20:20:42 +0800 | [diff] [blame] | 307 | |
| 308 | #ifdef SEL_LOGGER_MONITOR_THRESHOLD_ALARM_EVENTS |
| 309 | startThresholdAlarmMonitor(conn); |
| 310 | #endif |
JinFuLin | 7c2810b | 2022-12-02 13:55:28 +0800 | [diff] [blame^] | 311 | |
| 312 | #ifdef SEL_LOGGER_MONITOR_HOST_ERROR_EVENTS |
| 313 | startHostErrorEventMonitor(conn); |
| 314 | #endif |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 315 | io.run(); |
| 316 | |
| 317 | return 0; |
| 318 | } |