Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 312344 Details for
Bug 456240
OpenIPMI's ipmievd daemon fails to see new events.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to implement the functionality described
ipmitool-1.8.9-add-check-overflow.patch (text/plain), 5.66 KB, created by
Olivier Fourdan
on 2008-07-22 13:30:01 UTC
(
hide
)
Description:
Patch to implement the functionality described
Filename:
MIME Type:
Creator:
Olivier Fourdan
Created:
2008-07-22 13:30:01 UTC
Size:
5.66 KB
patch
obsolete
>Proposed patch: > >Improve "ipmievd" to monitor the percentage used in the SEL buffer and log >a warning every time the percentage used increases above 80% and log another >alert syslog message when the SEL buffer is full (and no other message can be >logged). > >Olivier Fourdan <ofourdan@redhat.com> > >--- ipmitool-1.8.9/src/ipmievd.c.checkoverflow 2008-07-22 08:36:34.000000000 +0100 >+++ ipmitool-1.8.9/src/ipmievd.c 2008-07-22 09:55:39.000000000 +0100 >@@ -75,6 +75,7 @@ > #include <ipmitool/ipmi_strings.h> > #include <ipmitool/ipmi_main.h> > >+#define WARNING_THRESHOLD 80 > #define DEFAULT_PIDFILE _PATH_VARRUN "ipmievd.pid" > char pidfile[64]; > >@@ -83,6 +84,8 @@ > int csv_output = 0; > uint16_t selwatch_count = 0; /* number of entries in the SEL */ > uint16_t selwatch_lastid = 0; /* current last entry in the SEL */ >+int selwatch_pctused = 0; /* current percent usage in the SEL */ >+int selwatch_overflow = 0; /* SEL overflow */ > int selwatch_timeout = 10; /* default to 10 seconds */ > > /* event interface definition */ >@@ -98,6 +101,13 @@ > struct ipmi_intf * intf; > }; > >+/* Data from SEL we are interested in */ >+typedef struct sel_data { >+ uint16_t entries; >+ int pctused; >+ int overflow; >+} sel_data; >+ > static void log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt); > > /* ~~~~~~~~~~~~~~~~~~~~~~ openipmi ~~~~~~~~~~~~~~~~~~~~ */ >@@ -183,6 +193,20 @@ > return NULL; > } > >+static int >+compute_pctfull(uint16_t entries, uint16_t freespace) >+{ >+ int pctfull = 0; >+ >+ if (entries) { >+ entries *= 16; >+ freespace += entries; >+ pctfull = (int)(100 * ( (double)entries / (double)freespace )); >+ } >+ return pctfull; >+} >+ >+ > static void > log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt) > { >@@ -459,11 +483,12 @@ > /*************************************************************************/ > /** SEL Watch Functions **/ > /*************************************************************************/ >-static uint16_t >-selwatch_get_count(struct ipmi_intf * intf) >+static int >+selwatch_get_data(struct ipmi_intf * intf, struct sel_data *data) > { > struct ipmi_rs * rsp; > struct ipmi_rq req; >+ uint16_t freespace; > > memset(&req, 0, sizeof(req)); > req.msg.netfn = IPMI_NETFN_STORAGE; >@@ -480,8 +505,17 @@ > return 0; > } > >- lprintf(LOG_DEBUG, "SEL count is %d", buf2short(rsp->data+1)); >- return buf2short(rsp->data+1); >+ freespace = buf2short(rsp->data + 3); >+ data->entries = buf2short(rsp->data + 1); >+ data->pctused = compute_pctfull (data->entries, freespace); >+ data->overflow = rsp->data[13] & 0x80; >+ >+ lprintf(LOG_DEBUG, "SEL count is %d", data->entries); >+ lprintf(LOG_DEBUG, "SEL freespace is %d", freespace); >+ lprintf(LOG_DEBUG, "SEL Percent Used: %d%%\n", data->pctused); >+ lprintf(LOG_DEBUG, "SEL Overflow: %s", data->overflow ? "true" : "false"); >+ >+ return 1; > } > > static uint16_t >@@ -521,14 +555,29 @@ > static int > selwatch_setup(struct ipmi_event_intf * eintf) > { >- /* save current sel record count */ >- selwatch_count = selwatch_get_count(eintf->intf); >- lprintf(LOG_DEBUG, "Current SEL count is %d", selwatch_count); >- >- /* save current last record ID */ >- selwatch_lastid = selwatch_get_lastid(eintf->intf); >- lprintf(LOG_DEBUG, "Current SEL lastid is %04x", selwatch_lastid); >+ struct sel_data data; >+ >+ /* save current sel record count */ >+ if (selwatch_get_data(eintf->intf, &data)) { >+ selwatch_count = data.entries; >+ selwatch_pctused = data.pctused; >+ selwatch_overflow = data.overflow; >+ lprintf(LOG_DEBUG, "Current SEL count is %d", selwatch_count); >+ /* save current last record ID */ >+ selwatch_lastid = selwatch_get_lastid(eintf->intf); >+ lprintf(LOG_DEBUG, "Current SEL lastid is %04x", selwatch_lastid); >+ /* display alert/warning immediatly as startup if relevant */ >+ if (selwatch_pctused >= WARNING_THRESHOLD) { >+ lprintf(LOG_WARNING, "SEL buffer used at %d%%, please consider clearing the SEL buffer", selwatch_pctused); >+ } >+ if (selwatch_overflow) { >+ lprintf(LOG_ALERT, "SEL buffer overflow, no SEL message can be logged until the SEL buffer is cleared"); >+ } >+ >+ return 1; >+ } > >+ lprintf(LOG_ERR, "Unable to retrieve SEL data"); > return 0; > } > >@@ -541,13 +590,29 @@ > selwatch_check(struct ipmi_event_intf * eintf) > { > uint16_t old_count = selwatch_count; >- selwatch_count = selwatch_get_count(eintf->intf); >- if (selwatch_count == 0) { >- lprintf(LOG_DEBUG, "SEL count is 0 (old=%d), resetting lastid to 0", old_count); >- selwatch_lastid = 0; >- } else if (selwatch_count < old_count) { >- selwatch_lastid = selwatch_get_lastid(eintf->intf); >- lprintf(LOG_DEBUG, "SEL count lowered, new SEL lastid is %04x", selwatch_lastid); >+ int old_pctused = selwatch_pctused; >+ int old_overflow = selwatch_overflow; >+ struct sel_data data; >+ >+ if (selwatch_get_data(eintf->intf, &data)) { >+ selwatch_count = data.entries; >+ selwatch_pctused = data.pctused; >+ selwatch_overflow = data.overflow; >+ if (old_overflow && !selwatch_overflow) { >+ lprintf(LOG_NOTICE, "SEL overflow is cleared"); >+ } else if (!old_overflow && selwatch_overflow) { >+ lprintf(LOG_ALERT, "SEL buffer overflow, no new SEL message will be logged until the SEL buffer is cleared"); >+ } >+ if ((selwatch_pctused >= WARNING_THRESHOLD) && (selwatch_pctused > old_pctused)) { >+ lprintf(LOG_WARNING, "SEL buffer is %d%% full, please consider clearing the SEL buffer", selwatch_pctused); >+ } >+ if (selwatch_count == 0) { >+ lprintf(LOG_DEBUG, "SEL count is 0 (old=%d), resetting lastid to 0", old_count); >+ selwatch_lastid = 0; >+ } else if (selwatch_count < old_count) { >+ selwatch_lastid = selwatch_get_lastid(eintf->intf); >+ lprintf(LOG_DEBUG, "SEL count lowered, new SEL lastid is %04x", selwatch_lastid); >+ } > } > return (selwatch_count > old_count); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 456240
: 312344