|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Notifier that invokes a callback function. More...
#include <alert_manager.h>


Public Types | |
| using | callback_func = std::function<void(const alert&)> |
| using | group_callback_func = std::function<void(const alert_group&)> |
Public Member Functions | |
| callback_notifier (std::string notifier_name, callback_func callback, group_callback_func group_callback=nullptr) | |
| Construct callback notifier. | |
| std::string | name () const override |
| Get the name of this callback notifier. | |
| common::VoidResult | notify (const alert &a) override |
| Send a notification for an alert. | |
| common::VoidResult | notify_group (const alert_group &group) override |
| Send a notification for an alert group. | |
| bool | is_ready () const override |
| Check if the callback notifier is ready. | |
Public Member Functions inherited from kcenon::monitoring::alert_notifier | |
| virtual | ~alert_notifier ()=default |
Private Attributes | |
| std::string | name_ |
| callback_func | callback_ |
| group_callback_func | group_callback_ |
Notifier that invokes a callback function.
Allows custom notification handling via user-defined callbacks.
Definition at line 491 of file alert_manager.h.
| using kcenon::monitoring::callback_notifier::callback_func = std::function<void(const alert&)> |
Definition at line 493 of file alert_manager.h.
| using kcenon::monitoring::callback_notifier::group_callback_func = std::function<void(const alert_group&)> |
Definition at line 494 of file alert_manager.h.
|
inline |
Construct callback notifier.
| notifier_name | Name for this notifier |
| callback | Callback function for single alerts |
| group_callback | Callback function for alert groups (optional) |
Definition at line 502 of file alert_manager.h.
|
inlineoverridevirtual |
Check if the callback notifier is ready.
Implements kcenon::monitoring::alert_notifier.
Definition at line 542 of file alert_manager.h.
References callback_.
|
inlineoverridevirtual |
Get the name of this callback notifier.
Implements kcenon::monitoring::alert_notifier.
Definition at line 513 of file alert_manager.h.
References name_.
|
inlineoverridevirtual |
Send a notification for an alert.
| a | Alert to notify about |
Implements kcenon::monitoring::alert_notifier.
Definition at line 515 of file alert_manager.h.
References callback_, and kcenon::monitoring::operation_failed.
Referenced by notify_group().

|
inlineoverridevirtual |
Send a notification for an alert group.
| group | Alert group to notify about |
Implements kcenon::monitoring::alert_notifier.
Definition at line 523 of file alert_manager.h.
References kcenon::monitoring::alert_group::alerts, group_callback_, and notify().

|
private |
Definition at line 546 of file alert_manager.h.
Referenced by is_ready(), and notify().
|
private |
Definition at line 547 of file alert_manager.h.
Referenced by notify_group().
|
private |
Definition at line 545 of file alert_manager.h.
Referenced by name().