summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e38e934)
raw | patch | inline | side by side (parent: e38e934)
author | Korynkevych, RomanX <romanx.korynkevych@intel.com> | |
Wed, 28 Dec 2016 15:08:42 +0000 (15:08 +0000) | ||
committer | Korynkevych, RomanX <romanx.korynkevych@intel.com> | |
Wed, 28 Dec 2016 15:50:18 +0000 (15:50 +0000) |
Make deletion of event from SEL list configurable to avoid other tools
that may be subscribed for SEL events to receive an empty event.
Change-Id: Ibd578c8652d9d6df8ee28825f20df356ef46b840
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
that may be subscribed for SEL events to receive an empty event.
Change-Id: Ibd578c8652d9d6df8ee28825f20df356ef46b840
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
src/collectd.conf.in | patch | blob | history | |
src/collectd.conf.pod | patch | blob | history | |
src/ipmi.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index e85b42a5b0a9c09d5e7f2d5f41cca51e3700e6de..20a010811e17464c9026cbda90bf5215c07c1126 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# NotifySensorRemove true
# NotifySensorNotPresent false
# SELEnabled false
+# SELClearEvent false
#</Plugin>
#<Plugin iptables>
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index a164e11944f8538cbaeb700b0bfdf030e508c864..d8d30f5b37bf4eeb787eea9e82504c07209f1dae 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
@@ -3087,6 +3087,13 @@ If system event log (SEL) is enabled, plugin will listen for sensor threshold
and discrete events. When event is received the notification is sent.
Defaults to B<false>.
+=item B<SELClearEvent> I<true>|I<false>
+
+If SEL clear event is enabled, plugin will delete event from SEL list after
+it is received and successfully handled. In this case other tools that are
+subscribed for SEL events will receive an empty event.
+Defaults to B<false>.
+
=back
=head2 Plugin C<iptables>
diff --git a/src/ipmi.c b/src/ipmi.c
index 5dca1fd8a07a8262a23274ba056464a3050a5eca..39250e4faadc65cd919c01ba519fb92fe892e470 100644 (file)
--- a/src/ipmi.c
+++ b/src/ipmi.c
static const char *config_keys[] = {"Sensor", "IgnoreSelected",
"NotifySensorAdd", "NotifySensorRemove",
- "NotifySensorNotPresent", "SELEnabled"};
+ "NotifySensorNotPresent", "SELEnabled",
+ "SELClearEvent"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static ignorelist_t *ignorelist = NULL;
static int c_ipmi_notify_remove = 0;
static int c_ipmi_notify_notpresent = 0;
static int c_ipmi_sel_enabled = 0;
+static int c_ipmi_sel_clear_event = 0;
/*
* Misc private functions
plugin_dispatch_notification(&n);
/* Delete handled ipmi event from the list */
- ipmi_event_delete(event, NULL, NULL);
+ if (c_ipmi_sel_clear_event) {
+ ipmi_event_delete(event, NULL, NULL);
+ return (IPMI_EVENT_HANDLED);
+ }
- return (IPMI_EVENT_HANDLED);
+ return (IPMI_EVENT_NOT_HANDLED);
} /* int sensor_threshold_event_handler */
static int sensor_discrete_event_handler(ipmi_sensor_t *sensor,
plugin_dispatch_notification(&n);
/* Delete handled ipmi event from the list */
- ipmi_event_delete(event, NULL, NULL);
+ if (c_ipmi_sel_clear_event) {
+ ipmi_event_delete(event, NULL, NULL);
+ return (IPMI_EVENT_HANDLED);
+ }
- return (IPMI_EVENT_HANDLED);
+ return (IPMI_EVENT_NOT_HANDLED);
} /* int sensor_discrete_event_handler */
/*
} else if (strcasecmp("SELEnabled", key) == 0) {
if (IS_TRUE(value))
c_ipmi_sel_enabled = 1;
+ } else if (strcasecmp("SELClearEvent", key) == 0) {
+ if (IS_TRUE(value))
+ c_ipmi_sel_clear_event = 1;
} else {
return (-1);
}