mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
add Percent Used column to sel info display
This commit is contained in:
parent
ac931daa86
commit
c72e3333eb
@ -146,6 +146,8 @@ ipmi_sel_get_info(struct ipmi_intf * intf)
|
|||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
|
unsigned short e, f;
|
||||||
|
int pctfull = 0;
|
||||||
|
|
||||||
memset(&req, 0, sizeof(req));
|
memset(&req, 0, sizeof(req));
|
||||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||||
@ -165,10 +167,18 @@ ipmi_sel_get_info(struct ipmi_intf * intf)
|
|||||||
printf("SEL Information\n");
|
printf("SEL Information\n");
|
||||||
printf("Version : %x%x\n",
|
printf("Version : %x%x\n",
|
||||||
(rsp->data[0] & 0xf0) >> 4, rsp->data[0] & 0xf);
|
(rsp->data[0] & 0xf0) >> 4, rsp->data[0] & 0xf);
|
||||||
printf("Entries : %d\n",
|
|
||||||
buf2short(rsp->data + 1));
|
e = buf2short(rsp->data + 1);
|
||||||
printf("Free Space : %d\n",
|
f = buf2short(rsp->data + 3);
|
||||||
buf2short(rsp->data + 3));
|
printf("Entries : %d\n", e);
|
||||||
|
printf("Free Space : %d\n", f);
|
||||||
|
if (e) {
|
||||||
|
e *= 16;
|
||||||
|
f += e;
|
||||||
|
pctfull = (int)(100 * ( (double)e / (double)f ));
|
||||||
|
}
|
||||||
|
printf("Percent Used : %d%%\n", pctfull);
|
||||||
|
|
||||||
printf("Last Add Time : %s\n",
|
printf("Last Add Time : %s\n",
|
||||||
ipmi_sel_timestamp(buf2long(rsp->data + 5)));
|
ipmi_sel_timestamp(buf2long(rsp->data + 5)));
|
||||||
printf("Last Del Time : %s\n",
|
printf("Last Del Time : %s\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user