Expanded interface by collect_alerts.
Created category "EBD_PROBLEMS" for ExtBlkDev problems.
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
void KernelDevice::collect_alerts(osd_alert_list_t& alerts, const std::string& device_name)
{
BlockDevice::collect_alerts(alerts, device_name);
+ if (ebd_impl) {
+ ebd_impl->collect_alerts(alerts);
+ }
}
void KernelDevice::_aio_log_start(
#include <map>
#include <ostream>
#include <memory>
+#include "osd/osd_types.h"
#ifdef __linux__
#include <sys/capability.h>
#else
* @return 0 on success or a negative errno on error.
*/
virtual int get_plugin_id(std::string& id_str) = 0;
+
+ /**
+ * Retrieve alerts from the plugin, if any.
+ * This function is used to give plugin a way to signal health warnings.
+ *
+ * @param [out] alerts append warnings here.
+ */
+ virtual void collect_alerts(osd_alert_list_t& alerts) {}
};
typedef std::shared_ptr<ExtBlkDevInterface> ExtBlkDevInterfaceRef;
summary += " experiencing slow discard operations";
} else if (asum.first == "BLUESTORE_FREE_FRAGMENTATION") {
summary += " experiencing high free space fragmentation of BlueStore";
+ } else if (asum.first == "EXTBLKDEV") {
+ summary += " reporting problems with ExtBlkDev plugin";
}
auto& d = checks->add(asum.first, HEALTH_WARN, summary, asum.second.first);